context: using System.ComponentModel;
  using System.Drawing;
  using System.Drawing.Drawing2D;
  using System.Windows.Forms;
  
  namespace WeifenLuo.WinFormsUI.Docking
  {
      partial class DockPanel
      {
          #region PaneIndicator
  
          internal class DefaultPaneIndicator : PictureBox, IPaneIndicator
          {
              private static readonly Bitmap _bitmapPaneDiamond = Resources.DockIndicator_PaneDiamond;
              private static readonly Bitmap _bitmapPaneDiamondLeft = Resources.DockIndicator_PaneDiamond_Left;
              private static readonly Bitmap _bitmapPaneDiamondRight = Resources.DockIndicator_PaneDiamond_Right;
              private static readonly Bitmap _bitmapPaneDiamondTop = Resources.DockIndicator_PaneDiamond_Top;
              private static readonly Bitmap _bitmapPaneDiamondBottom = Resources.DockIndicator_PaneDiamond_Bottom;
              private static readonly Bitmap _bitmapPaneDiamondFill = Resources.DockIndicator_PaneDiamond_Fill;
              private static readonly Bitmap _bitmapPaneDiamondHotSpot = Resources.DockIndicator_PaneDiamond_HotSpot;
  
              private static readonly Bitmap _bitmapPaneDiamondHotSpotIndex =
                  Resources.DockIndicator_PaneDiamond_HotSpotIndex;
  
              private static readonly HotSpotIndex[] _hotSpots =
              {
                  new HotSpotIndex(1, 0, DockStyle.Top),
                  new HotSpotIndex(0, 1, DockStyle.Left),
                  new HotSpotIndex(1, 1, DockStyle.Fill),
                  new HotSpotIndex(2, 1, DockStyle.Right),
                  new HotSpotIndex(1, 2, DockStyle.Bottom)
              };
  
              private readonly GraphicsPath _displayingGraphicsPath =
                  DrawHelper.CalculateGraphicsPathFromBitmap(_bitmapPaneDiamond);
  
              private DockStyle m_status = DockStyle.None;
  
              public DefaultPaneIndicator()
              {
                  SizeMode = PictureBoxSizeMode.AutoSize;
                  Image = _bitmapPaneDiamond;
                  Region = new Region(DisplayingGraphicsPath);
              }
  
              public GraphicsPath DisplayingGraphicsPath
              {
                  get { return _displayingGraphicsPath; }
              }
  
              public DockStyle HitTest(Point pt)
              {
                  if (!Visible)
                      return DockStyle.None;
  
                  pt = PointToClient(pt);
                  if (!ClientRectangle.Contains(pt))
                      return DockStyle.None;
  
                  for (int i = _hotSpots.GetLowerBound(0); i <= _hotSpots.GetUpperBound(0); i++)
                  {
                      if (_bitmapPaneDiamondHotSpot.GetPixel(pt.X, pt.Y) ==
                          _bitmapPaneDiamondHotSpotIndex.GetPixel(_hotSpots[i].X, _hotSpots[i].Y))
                          return _hotSpots[i].DockStyle;
                  }
  
                  return DockStyle.None;
              }
  
              public DockStyle Status
              {
                  get { return m_status; }
                  set
                  {
                      m_status = value;
                      if (m_status == DockStyle.None)
                          Image = _bitmapPaneDiamond;
                      else if (m_status == DockStyle.Left)
                          Image = _bitmapPaneDiamondLeft;
                      else if (m_status == DockStyle.Right)
                          Image = _bitmapPaneDiamondRight;
                      else if (m_status == DockStyle.Top)
                          Image = _bitmapPaneDiamondTop;
                      else if (m_status == DockStyle.Bottom)
                          Image = _bitmapPaneDiamondBottom;
                      else if (m_status == DockStyle.Fill)
                          Image = _bitmapPaneDiamondFill;
                  }
              }
          }
  
          public struct HotSpotIndex
          {
              private readonly DockStyle m_dockStyle;
              private readonly int m_x;
  
              private readonly int m_y;
  
              public HotSpotIndex(int x, int y, DockStyle dockStyle)
              {
                  m_x = x;
                  m_y = y;
                  m_dockStyle = dockStyle;
              }
  
              public int X
              {
                  get { return m_x; }
              }
  
              public int Y
              {
                  get { return m_y; }
              }
  
              public DockStyle DockStyle
              {
                  get { return m_dockStyle; }
              }
          }
  
          public interface IPaneIndicator : IHitTest
          {
              Point Location { get; set; }
  
              bool Visible { get; set; }
  
              int Left { get; }
  
              int Top { get; }
  
              int Right { get; }
  
              int Bottom { get; }
  
              Rectangle ClientRectangle { get; }
  
              int Width { get; }
  
              int Height { get; }
  
              GraphicsPath DisplayingGraphicsPath { get; }
          }
  
          #endregion PaneIndicator
  
          #region IHitTest
  
          public interface IHitTest
          {
              DockStyle Status { get; set; }
  
              DockStyle HitTest(Point pt);
          }
  
          #endregion IHitTest
  
          #region PanelIndicator
  
          internal class DefaultPanelIndicator : PictureBox, IPanelIndicator
          {
              private static readonly Image _imagePanelLeft = Resources.DockIndicator_PanelLeft;
              private static readonly Image _imagePanelRight = Resources.DockIndicator_PanelRight;
              private static readonly Image _imagePanelTop = Resources.DockIndicator_PanelTop;
              private static readonly Image _imagePanelBottom = Resources.DockIndicator_PanelBottom;
              private static readonly Image _imagePanelFill = Resources.DockIndicator_PanelFill;
              private static readonly Image _imagePanelLeftActive = Resources.DockIndicator_PanelLeft_Active;
              private static readonly Image _imagePanelRightActive = Resources.DockIndicator_PanelRight_Active;
              private static readonly Image _imagePanelTopActive = Resources.DockIndicator_PanelTop_Active;
              private static readonly Image _imagePanelBottomActive = Resources.DockIndicator_PanelBottom_Active;
              private static readonly Image _imagePanelFillActive = Resources.DockIndicator_PanelFill_Active;
  
              private readonly DockStyle m_dockStyle;
              private bool m_isActivated;
  
              private DockStyle m_status;
  
              public DefaultPanelIndicator(DockStyle dockStyle)
              {
                  m_dockStyle = dockStyle;
                  SizeMode = PictureBoxSizeMode.AutoSize;
                  Image = ImageInactive;
              }
  
              private DockStyle DockStyle
              {
                  get { return m_dockStyle; }
              }
  
              private Image ImageInactive
              {
                  get
                  {
                      if (DockStyle == DockStyle.Left)
                          return _imagePanelLeft;
                      if (DockStyle == DockStyle.Right)
                          return _imagePanelRight;
                      if (DockStyle == DockStyle.Top)
                          return _imagePanelTop;
                      if (DockStyle == DockStyle.Bottom)
                          return _imagePanelBottom;
                      if (DockStyle == DockStyle.Fill)
                          return _imagePanelFill;
                      return null;
                  }
              }
  
              private Image ImageActive
              {
                  get
                  {
                      if (DockStyle == DockStyle.Left)
                          return _imagePanelLeftActive;
                      if (DockStyle == DockStyle.Right)
                          return _imagePanelRightActive;
                      if (DockStyle == DockStyle.Top)
                          return _imagePanelTopActive;
                      if (DockStyle == DockStyle.Bottom)
                          return _imagePanelBottomActive;
                      if (DockStyle == DockStyle.Fill)
                          return _imagePanelFillActive;
                      return null;
                  }
              }
  
              private bool IsActivated
              {
                  get { return m_isActivated; }
                  set
                  {
                      m_isActivated = value;
                      Image = IsActivated ? ImageActive : ImageInactive;
                  }
              }
  
              public DockStyle Status
              {
                  get { return m_status; }
                  set
                  {
                      if (value != DockStyle && value != DockStyle.None)
                          throw new InvalidEnumArgumentException();
  
                      if (m_status == value)
                          return;
  
                      m_status = value;
                      IsActivated = (m_status != DockStyle.None);
                  }
              }
  
              public DockStyle HitTest(Point pt)
              {
                  return Visible && ClientRectangle.Contains(PointToClient(pt)) ? DockStyle : DockStyle.None;
              }
          }
  
          public interface IPanelIndicator : IHitTest
          {
              Point Location { get; set; }
  
              bool Visible { get; set; }
  
  
gt:             Rectangle Bounds { get; }