Exemple #1
0
        private void CreateDocumentGroup(ViewElement view, Orientation orientation)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            DocumentGroup documentGroup1 = view.Parent as DocumentGroup;

            if (documentGroup1 == null)
            {
                throw new InvalidOperationException("View that is being moved must be child of a DocumentGroup.");
            }
            DocumentGroupContainer documentGroupContainer = documentGroup1.Parent as DocumentGroupContainer;

            if (documentGroupContainer == null)
            {
                throw new InvalidOperationException("DocumentGroup must be child of a DocumentGroupContainer");
            }
            DocumentGroup documentGroup2 = DocumentGroup.Create();

            documentGroup2.FloatingHeight = 200.0;
            documentGroup2.FloatingWidth  = 300.0;
            documentGroup2.IsVisible      = true;
            documentGroup1.Children.Remove(view);
            documentGroup2.Children.Add(view);
            if (documentGroupContainer.VisibleChildren.Count <= 1)
            {
                documentGroupContainer.Orientation = orientation;
            }
            int num = documentGroupContainer.Children.IndexOf((ViewElement)documentGroup1);

            documentGroupContainer.Children.Insert(num + 1, (ViewElement)documentGroup2);
            documentGroup2.SelectedElement = view;
        }
        private bool ValidateElement(DocumentGroupContainer container)
        {
            bool flag = true;

            if (container.Children.Count == 0)
            {
                container.Children.Add((ViewElement)DocumentGroup.Create());
            }
            return(flag);
        }
Exemple #3
0
        internal static ViewElement CreateDefaultMainSiteContent()
        {
            AutoHideChannel autoHideChannel1 = AutoHideChannel.Create();

            autoHideChannel1.Dock        = Dock.Left;
            autoHideChannel1.Orientation = Orientation.Vertical;
            AutoHideChannel autoHideChannel2 = AutoHideChannel.Create();

            autoHideChannel2.Dock        = Dock.Right;
            autoHideChannel2.Orientation = Orientation.Vertical;
            AutoHideChannel autoHideChannel3 = AutoHideChannel.Create();

            autoHideChannel3.Dock        = Dock.Top;
            autoHideChannel3.Orientation = Orientation.Horizontal;
            AutoHideChannel autoHideChannel4 = AutoHideChannel.Create();

            autoHideChannel4.Dock        = Dock.Bottom;
            autoHideChannel4.Orientation = Orientation.Horizontal;
            DocumentGroupContainer documentGroupContainer = DocumentGroupContainer.Create();

            documentGroupContainer.DockedWidth  = new SplitterLength(1.0, SplitterUnitType.Fill);
            documentGroupContainer.DockedHeight = new SplitterLength(1.0, SplitterUnitType.Fill);
            documentGroupContainer.Children.Add((ViewElement)DocumentGroup.Create());
            DockRoot dockRoot = DockRoot.Create();

            dockRoot.DockedWidth  = new SplitterLength(1.0, SplitterUnitType.Fill);
            dockRoot.DockedHeight = new SplitterLength(1.0, SplitterUnitType.Fill);
            dockRoot.Children.Add((ViewElement)documentGroupContainer);
            AutoHideRoot autoHideRoot = AutoHideRoot.Create();

            autoHideRoot.DockedWidth  = new SplitterLength(1.0, SplitterUnitType.Fill);
            autoHideRoot.DockedHeight = new SplitterLength(1.0, SplitterUnitType.Fill);
            autoHideRoot.Children.Add((ViewElement)autoHideChannel1);
            autoHideRoot.Children.Add((ViewElement)autoHideChannel2);
            autoHideRoot.Children.Add((ViewElement)autoHideChannel3);
            autoHideRoot.Children.Add((ViewElement)autoHideChannel4);
            autoHideRoot.Children.Add((ViewElement)dockRoot);
            return((ViewElement)autoHideRoot);
        }