Beispiel #1
0
 private bool _AssertSplitMode(DropMode mode)
 {
     return(DropMode == DropMode.Left_WithSplit ||
            DropMode == DropMode.Right_WithSplit ||
            DropMode == DropMode.Top_WithSplit ||
            DropMode == DropMode.Bottom_WithSplit);
 }
Beispiel #2
0
 public void CloseDropWindow()
 {
     if (_dragWnd != null)
     {
         _dropMode       = DropMode.None;
         _dragWnd.IsOpen = false;
         _dragWnd        = null;
     }
 }
Beispiel #3
0
        public void AttachWith(IDockView source, AttachMode mode = AttachMode.Center)
        {
            switch (mode)
            {
            case AttachMode.Left:
                _dropMode = DropMode.Left;
                break;

            case AttachMode.Top:
                _dropMode = DropMode.Top;
                break;

            case AttachMode.Right:
                _dropMode = DropMode.Right;
                break;

            case AttachMode.Bottom:
                _dropMode = DropMode.Bottom;
                break;

            case AttachMode.Left_WithSplit:
                _dropMode = DropMode.Left_WithSplit;
                break;

            case AttachMode.Top_WithSplit:
                _dropMode = DropMode.Top_WithSplit;
                break;

            case AttachMode.Right_WithSplit:
                _dropMode = DropMode.Right_WithSplit;
                break;

            case AttachMode.Bottom_WithSplit:
                _dropMode = DropMode.Bottom_WithSplit;
                break;

            case AttachMode.Center:
                _dropMode = DropMode.Center;
                break;

            default:
                _dropMode = DropMode.None;
                break;
            }
            DragItem item = new DragItem(source, DockMode.Normal, DragMode.None, new Point(), Rect.Empty, Size.Empty);

            OnDrop(item);
            _dropMode = DropMode.None;
        }
Beispiel #4
0
        public void AttachTo(LayoutGroupPanel panel, IDockView source, DropMode mode)
        {
            int index = panel.Children.IndexOf(this);

            switch (mode)
            {
            case DropMode.Left:
                if (panel.Direction == Direction.Vertical)
                {
                    var _subpanel = new LayoutGroupPanel(Model.Side)
                    {
                        Direction     = Direction.Horizontal,
                        DesiredWidth  = Math.Max(ActualWidth, Constants.DockDefaultWidthLength),
                        DesiredHeight = Math.Max(ActualHeight, Constants.DockDefaultHeightLength),
                        IsAnchorPanel = true
                    };
                    panel._DetachChild(this);
                    panel._AttachChild(_subpanel, Math.Min(index, panel.Count));
                    _subpanel._AttachChild(this, 0);
                    _subpanel.AttachChild(source, AttachMode.Left, 0);
                }
                else
                {
                    panel._AttachChild(source, index);
                }
                break;

            case DropMode.Top:
                if (panel.Direction == Direction.Horizontal)
                {
                    var _subpanel = new LayoutGroupPanel(Model.Side)
                    {
                        Direction     = Direction.Vertical,
                        DesiredWidth  = Math.Max(ActualWidth, Constants.DockDefaultWidthLength),
                        DesiredHeight = Math.Max(ActualHeight, Constants.DockDefaultHeightLength),
                        IsAnchorPanel = true
                    };
                    panel._DetachChild(this);
                    panel._AttachChild(_subpanel, Math.Min(index, panel.Count));
                    _subpanel._AttachChild(this, 0);
                    _subpanel.AttachChild(source, AttachMode.Top, 0);
                }
                else
                {
                    panel._AttachChild(source, index);
                }
                break;

            case DropMode.Right:
                if (panel.Direction == Direction.Vertical)
                {
                    var _subpanel = new LayoutGroupPanel(Model.Side)
                    {
                        Direction     = Direction.Horizontal,
                        DesiredWidth  = Math.Max(ActualWidth, Constants.DockDefaultWidthLength),
                        DesiredHeight = Math.Max(ActualHeight, Constants.DockDefaultHeightLength),
                        IsAnchorPanel = true
                    };
                    panel._DetachChild(this);
                    _subpanel._AttachChild(this, 0);
                    _subpanel.AttachChild(source, AttachMode.Right, 1);
                    panel._AttachChild(_subpanel, Math.Min(index, panel.Count));
                }
                else
                {
                    panel._AttachChild(source, index + 1);
                }
                break;

            case DropMode.Bottom:
                if (panel.Direction == Direction.Horizontal)
                {
                    var _subpanel = new LayoutGroupPanel(Model.Side)
                    {
                        Direction     = Direction.Vertical,
                        DesiredWidth  = Math.Max(ActualWidth, Constants.DockDefaultWidthLength),
                        DesiredHeight = Math.Max(ActualHeight, Constants.DockDefaultHeightLength),
                        IsAnchorPanel = true
                    };
                    panel._DetachChild(this);
                    _subpanel._AttachChild(this, 0);
                    _subpanel.AttachChild(source, AttachMode.Bottom, 1);
                    panel._AttachChild(_subpanel, Math.Min(index, panel.Count));
                }
                else
                {
                    panel._AttachChild(source, index + 1);
                }
                break;
            }
        }
Beispiel #5
0
 public MaxConcurrentRequestsEnqueuer(int maxQueueLength, DropMode dropMode, int maxTimeInQueue)
 {
     _maxQueueLength = maxQueueLength;
     _dropMode       = dropMode;
     _maxTimeInQueue = maxTimeInQueue;
 }
Beispiel #6
0
 private bool SetDropMode(DropMode mode)
 {
     DragMode = mode;
     return(mode != DropMode.None);
 }
        public void AttachTo(LayoutGroupPanel panel, IDockView source, DropMode mode)
        {
            int index = panel.Children.IndexOf(this);

            switch (mode)
            {
            case DropMode.Left:
                if (panel.Direction == Direction.UpToDown)
                {
                    var _subpanel = new LayoutGroupPanel(Model.Side)
                    {
                        Direction     = Direction.LeftToRight,
                        DesiredWidth  = ActualWidth,
                        DesiredHeight = ActualHeight,
                        IsAnchorPanel = true
                    };
                    panel._DetachChild(this);
                    panel._AttachChild(_subpanel, Math.Min(index, panel.Count));
                    _subpanel._AttachChild(this, 0);
                    _subpanel.AttachChild(source, AttachMode.Left, 0);
                }
                else
                {
                    panel._AttachChild(source, index);
                }
                break;

            case DropMode.Top:
                if (panel.Direction == Direction.LeftToRight)
                {
                    var _subpanel = new LayoutGroupPanel(Model.Side)
                    {
                        Direction     = Direction.UpToDown,
                        DesiredWidth  = ActualWidth,
                        DesiredHeight = ActualHeight,
                        IsAnchorPanel = true
                    };
                    panel._DetachChild(this);
                    panel._AttachChild(_subpanel, Math.Min(index, panel.Count));
                    _subpanel._AttachChild(this, 0);
                    _subpanel.AttachChild(source, AttachMode.Top, 0);
                }
                else
                {
                    panel._AttachChild(source, index);
                }
                break;

            case DropMode.Right:
                if (panel.Direction == Direction.UpToDown)
                {
                    var _subpanel = new LayoutGroupPanel(Model.Side)
                    {
                        Direction     = Direction.LeftToRight,
                        DesiredWidth  = ActualWidth,
                        DesiredHeight = ActualHeight,
                        IsAnchorPanel = true
                    };
                    panel._DetachChild(this);
                    _subpanel._AttachChild(this, 0);
                    _subpanel.AttachChild(source, AttachMode.Right, 1);
                    panel._AttachChild(_subpanel, Math.Min(index, panel.Count));
                }
                else
                {
                    panel._AttachChild(source, index + 1);
                }
                break;

            case DropMode.Bottom:
                if (panel.Direction == Direction.LeftToRight)
                {
                    var _subpanel = new LayoutGroupPanel(Model.Side)
                    {
                        Direction     = Direction.UpToDown,
                        DesiredWidth  = ActualWidth,
                        DesiredHeight = ActualHeight,
                        IsAnchorPanel = true
                    };
                    panel._DetachChild(this);
                    _subpanel._AttachChild(this, 0);
                    _subpanel.AttachChild(source, AttachMode.Bottom, 1);
                    panel._AttachChild(_subpanel, Math.Min(index, panel.Count));
                }
                else
                {
                    panel._AttachChild(source, index + 1);
                }
                break;
            }
        }