コード例 #1
0
        protected override void PrepareAdornerLayer(DockAdornerWindow adornerLayer, ViewElement floatingElement)
        {
            DockTarget      target           = (DockTarget)adornerLayer.AdornedElement;
            ConstrainedView constrainedView1 = target.TargetElement as ConstrainedView;
            ConstrainedView constrainedView2 = floatingElement as ConstrainedView;

            if (constrainedView2 != null)
            {
                constrainedView2.ApplyFloatingConstraints(adornerLayer, target);
            }
            if (constrainedView1 == null)
            {
                return;
            }
            constrainedView1.ApplyDockTargetConstraints(adornerLayer, floatingElement);
        }
コード例 #2
0
        internal override DraggedTabInfo GetAutodockTarget(DragAbsoluteEventArgs args)
        {
            FloatingElement ancestor = Microsoft.VisualStudio.PlatformUI.ExtensionMethods.FindAncestor <FloatingElement>((Visual)(args.OriginalSource as DragUndockHeader));

            if (ancestor != null)
            {
                FloatSite floatSite = ancestor.DataContext as FloatSite;
                if (floatSite != null)
                {
                    ConstrainedView constrainedView = floatSite.Child as ConstrainedView;
                    if (constrainedView != null && !constrainedView.CanAutoDock())
                    {
                        return((DraggedTabInfo)null);
                    }
                }
            }
            return(base.GetAutodockTarget(args));
        }
コード例 #3
0
        protected override bool IsValidFillPreviewOperation(DockTarget dockTarget, ViewElement dockingView)
        {
            if (!base.IsValidFillPreviewOperation(dockTarget, dockingView))
            {
                return(false);
            }
            ConstrainedView constrainedView1 = dockTarget.TargetElement as ConstrainedView;
            ConstrainedView constrainedView2 = dockingView as ConstrainedView;

            if (constrainedView1 != null && !constrainedView1.IsValidFillPreviewOperation(dockTarget, dockingView))
            {
                return(false);
            }
            if (constrainedView2 != null)
            {
                return(constrainedView2.IsValidFillPreviewOperation(dockTarget, dockingView));
            }
            return(true);
        }
コード例 #4
0
        protected override bool IsValidDockTarget(DockTarget target, IList <DockSiteType> types, ViewElement floatingElement)
        {
            if (!base.IsValidDockTarget(target, types, floatingElement))
            {
                return(false);
            }
            ConstrainedView constrainedView1 = target.TargetElement as ConstrainedView;
            ConstrainedView constrainedView2 = floatingElement as ConstrainedView;

            if (constrainedView1 != null && !constrainedView1.IsFloatingElementValidForDock(floatingElement))
            {
                return(false);
            }
            if (constrainedView2 != null)
            {
                return(constrainedView2.IsDockTargetValidForDock(target));
            }
            return(true);
        }