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

namespace TD.SandDock
{
	internal class q : a
	{
		public new delegate void a(LayoutSystemBase A_0, LayoutSystemBase A_1, int A_2, int A_3);

		internal new const int a = 25;

		private new DockContainer m_b = null;

		private new SplitLayoutSystem m_c = null;

		private LayoutSystemBase m_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 a l;

		private EventHandler m;

		[MethodImpl(MethodImplOptions.Synchronized)]
		[SpecialName]
		public void b(a A_0)
		{
			l = (a)Delegate.Combine(l, A_0);
		}

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

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

		[MethodImpl(MethodImplOptions.Synchronized)]
		[SpecialName]
		public void b(EventHandler A_0)
		{
			m = (EventHandler)Delegate.Remove(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, A_2: false)
		{
			this.m_b = A_0;
			this.m_c = A_1;
			this.m_d = A_2;
			e = A_3;
			f = A_4;
			if (A_1.SplitMode == Orientation.Horizontal)
			{
				g = A_2.Bounds.Y + 25;
				h = A_3.Bounds.Bottom - 25;
				i = (int)A_2.f.Height + (int)A_3.f.Height;
			}
			else
			{
				g = A_2.Bounds.X + 25;
				h = A_3.Bounds.Right - 25;
				i = (int)A_2.f.Width + (int)A_3.f.Width;
			}
			a(A_4);
		}

		[SpecialName]
		public SplitLayoutSystem d()
		{
			return this.m_c;
		}

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

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

		public override void a(Point A_0)
		{
			Rectangle rectangle = Rectangle.Empty;
			if (this.m_c.SplitMode == Orientation.Horizontal)
			{
				rectangle = new Rectangle(this.m_c.Bounds.X, A_0.Y - 2, this.m_c.Bounds.Width, 4);
				if (rectangle.Y < g)
				{
					rectangle.Y = g;
				}
				if (rectangle.Y > h - 4)
				{
					rectangle.Y = h - 4;
				}
				j = rectangle.Y - this.m_d.Bounds.Y;
				k = i - j;
			}
			else
			{
				rectangle = new Rectangle(A_0.X - 2, this.m_c.Bounds.Y, 4, this.m_c.Bounds.Height);
				if (rectangle.X < g)
				{
					rectangle.X = g;
				}
				if (rectangle.X > h - 4)
				{
					rectangle.X = h - 4;
				}
				j = rectangle.X - this.m_d.Bounds.X;
				k = i - j;
			}
			a(new Rectangle(this.m_b.PointToScreen(rectangle.Location), rectangle.Size), A_1: false);
		}
	}
}
