using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;

namespace TD.SandDock
{
	internal class q : TD.SandDock.a
	{
		[MethodImpl(MethodImplOptions.Synchronized)]
		public void b(q.a A_0)
		{
			this.l = (q.a)Delegate.Combine(this.l, A_0);
		}

		[MethodImpl(MethodImplOptions.Synchronized)]
		public void a(q.a A_0)
		{
			this.l = (q.a)Delegate.Remove(this.l, A_0);
		}

		[MethodImpl(MethodImplOptions.Synchronized)]
		public void a(EventHandler A_0)
		{
			this.m = (EventHandler)Delegate.Combine(this.m, A_0);
		}

		[MethodImpl(MethodImplOptions.Synchronized)]
		public void b(EventHandler A_0)
		{
			this.m = (EventHandler)Delegate.Remove(this.m, A_0);
		}

		public q(DockContainer A_0, SplitLayoutSystem A_1, LayoutSystemBase A_2, LayoutSystemBase A_3, Point A_4, DockingHints A_5) : base(A_0, A_5, false)
		{
			this.b = A_0;
			this.c = A_1;
			this.d = A_2;
			this.e = A_3;
			this.f = A_4;
			if (A_1.SplitMode == Orientation.Horizontal)
			{
				this.g = A_2.Bounds.Y + 25;
				this.h = A_3.Bounds.Bottom - 25;
				this.i = (int)A_2.f.Height + (int)A_3.f.Height;
			}
			else
			{
				this.g = A_2.Bounds.X + 25;
				this.h = A_3.Bounds.Right - 25;
				this.i = (int)A_2.f.Width + (int)A_3.f.Width;
			}
			this.a(A_4);
		}

		public SplitLayoutSystem d()
		{
			return this.c;
		}

		public override void a()
		{
			base.a();
			if (this.l != null)
			{
				this.l(this.d, this.e, this.j, this.k);
			}
		}

		public override void c()
		{
			base.c();
			if (this.m != null)
			{
				this.m(this, EventArgs.Empty);
			}
		}

		public override void a(Point A_0)
		{
			Rectangle empty = Rectangle.Empty;
			if (this.c.SplitMode == Orientation.Horizontal)
			{
				empty = new Rectangle(this.c.Bounds.X, A_0.Y - 2, this.c.Bounds.Width, 4);
				if (empty.Y < this.g)
				{
					empty.Y = this.g;
				}
				if (empty.Y > this.h - 4)
				{
					empty.Y = this.h - 4;
				}
				this.j = empty.Y - this.d.Bounds.Y;
				this.k = this.i - this.j;
			}
			else
			{
				empty = new Rectangle(A_0.X - 2, this.c.Bounds.Y, 4, this.c.Bounds.Height);
				if (empty.X < this.g)
				{
					empty.X = this.g;
				}
				if (empty.X > this.h - 4)
				{
					empty.X = this.h - 4;
				}
				this.j = empty.X - this.d.Bounds.X;
				this.k = this.i - this.j;
			}
			base.a(new Rectangle(this.b.PointToScreen(empty.Location), empty.Size), false);
		}

		internal new const int a = 25;

		private new DockContainer b = null;

		private new SplitLayoutSystem c = null;

		private LayoutSystemBase d = null;

		private LayoutSystemBase e = null;

		private new Point f = Point.Empty;

		private int g;

		private int h;

		private int i;

		private int j;

		private int k;

		private new q.a l;

		private EventHandler m;

		public new delegate void a(LayoutSystemBase A_0, LayoutSystemBase A_1, int A_2, int A_3);
	}
}
