Exemplo n.º 1
0
 public DockManager()
 {
     Root          = new DockRoot(this);
     _dragManager  = new DragManager(this);
     _dockControls = new Dictionary <int, IDockControl>();
     _floatWindows = new List <BaseFloatWindow>();
     backwards     = new Stack <int>();
     forwards      = new Stack <int>();
 }
Exemplo n.º 2
0
 protected override bool ValidateOrReplaceDockRoot(ref DockRoot dockRoot, WindowProfileValidationContext context)
 {
     if (!(dockRoot is ExpressionDockRoot))
     {
         DockRoot dockRoot1 = ViewElementFactory.Current.CreateDockRoot();
         if (dockRoot1 == null || !(dockRoot1 is ExpressionDockRoot))
         {
             return(false);
         }
         this.CopyDockRootProperties(dockRoot, dockRoot1);
         dockRoot = dockRoot1;
     }
     return(true);
 }
Exemplo n.º 3
0
        private void _Init(int fixCount)
        {
            Root          = new DockRoot();
            _dragManager  = new DragManager(this);
            _dockControls = new SortedDictionary <int, IDockControl>();
            _floatWindows = new List <BaseFloatWindow>();
            _backwards    = new Stack <int>();
            _forwards     = new Stack <int>();

            _layouts    = new SortedDictionary <string, LayoutSetting.LayoutSetting>();
            _fixCount   = fixCount;
            _id         = _fixCount;
            _disposedID = new Stack <int>();
        }
Exemplo n.º 4
0
 protected virtual bool ValidateOrReplaceDockRoot(ref DockRoot dockRoot, WindowProfileValidationContext context)
 {
     return(true);
 }
Exemplo n.º 5
0
        protected bool ValidateOrReplaceViewGroup(ref ViewGroup viewGroup, WindowProfileValidationContext context)
        {
            DockOperations.TryCollapse((ViewElement)viewGroup);
            DockGroup dockGroup = viewGroup as DockGroup;

            if (dockGroup != null)
            {
                bool flag = this.ValidateOrReplaceDockGroup(ref dockGroup, context);
                viewGroup = (ViewGroup)dockGroup;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            NestedGroup nestedGroup = viewGroup as NestedGroup;

            if (nestedGroup != null)
            {
                bool flag = this.ValidateOrReplaceNestedGroup(ref nestedGroup, context);
                viewGroup = (ViewGroup)nestedGroup;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            AutoHideGroup autoHideGroup = viewGroup as AutoHideGroup;

            if (autoHideGroup != null)
            {
                autoHideGroup.SelectedElement = (ViewElement)null;
                bool flag = this.ValidateOrReplaceAutoHideGroup(ref autoHideGroup, context);
                viewGroup = (ViewGroup)autoHideGroup;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            AutoHideChannel autoHideChannel = viewGroup as AutoHideChannel;

            if (autoHideChannel != null)
            {
                bool flag = this.ValidateOrReplaceAutoHideChannel(ref autoHideChannel, context);
                viewGroup = (ViewGroup)autoHideChannel;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            ViewSite viewSite = viewGroup as ViewSite;

            if (viewSite != null)
            {
                bool flag = this.ValidateOrReplaceViewSite(ref viewSite, context);
                viewGroup = (ViewGroup)viewSite;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            AutoHideRoot autoHideRoot = viewGroup as AutoHideRoot;

            if (autoHideRoot != null)
            {
                bool flag = this.ValidateOrReplaceAutoHideRoot(ref autoHideRoot, context);
                viewGroup = (ViewGroup)autoHideRoot;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            DockRoot dockRoot = viewGroup as DockRoot;

            if (dockRoot == null)
            {
                return(this.ValidateOrReplaceCustomViewGroup(ref viewGroup, context));
            }
            bool flag1 = this.ValidateOrReplaceDockRoot(ref dockRoot, context);

            viewGroup = (ViewGroup)dockRoot;
            this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
            return(flag1);
        }
Exemplo n.º 6
0
 private void CopyDockRootProperties(DockRoot from, DockRoot to)
 {
     this.CopyViewGroupProperties((ViewGroup)from, (ViewGroup)to);
 }
Exemplo n.º 7
0
        /// <inheritdoc/>
        public override IDock CreateDefaultLayout()
        {
            // Dashboard

            var dashboardView = new DashboardView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Dashboard"
            };

            // Page

            var pageView = new PageView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Page"
            };

            // Left / Top

            var projectView = new ProjectView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Project"
            };

            var optionsView = new OptionsView
            {
                Dock   = "",
                Width  = 200,
                Height = 200,
                Title  = "Options"
            };

            var imagesView = new ImagesView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Images"
            };

            // Left / Bottom

            var groupsView = new GroupsView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Groups"
            };

            var databasesView = new DatabasesView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Databases"
            };

            // Right / Top

            var stylesView = new StylesView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Styles"
            };

            var templatesView = new TemplatesView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Templates"
            };

            var containerView = new ContainerView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Container"
            };

            var zoomView = new ZoomView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Zoom"
            };

            // Right / Bottom

            var toolsView = new ToolsView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Tools"
            };

            var shapeView = new ShapeView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Shape"
            };

            var dataView = new DataView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Data"
            };

            var styleView = new StyleView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Style"
            };

            var templateView = new TemplateView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Template"
            };

            // Left

            var leftPane = new DockLayout
            {
                Dock        = "Left",
                Width       = 200,
                Height      = double.NaN,
                Title       = "EditorLeft",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "EditorLeftTop",
                        CurrentView = projectView,
                        Views       = new ObservableCollection <IDock>
                        {
                            projectView,
                            optionsView,
                            imagesView
                        }
                    },
                    new DockSplitter()
                    {
                        Dock = "Top", Title = "LeftTopSplitter"
                    },
                    new DockStrip
                    {
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "EditorLeftBottom",
                        CurrentView = groupsView,
                        Views       = new ObservableCollection <IDock>
                        {
                            groupsView,
                            databasesView
                        }
                    }
                }
            };

            // Right

            var rightPane = new DockLayout
            {
                Dock        = "Right",
                Width       = 240,
                Height      = double.NaN,
                Title       = "EditorRight",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "EditorRightTop",
                        CurrentView = stylesView,
                        Views       = new ObservableCollection <IDock>
                        {
                            stylesView,
                            templatesView,
                            containerView,
                            zoomView
                        }
                    },
                    new DockSplitter()
                    {
                        Dock = "Top", Title = "RightTopSplitter"
                    },
                    new DockStrip
                    {
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "EditorRightBottom",
                        CurrentView = toolsView,
                        Views       = new ObservableCollection <IDock>
                        {
                            toolsView,
                            shapeView,
                            dataView,
                            styleView,
                            templateView
                        }
                    }
                }
            };

            // Editor

            var editorLayout = new DockLayout
            {
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "EditorLayout",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    leftPane,
                    new DockSplitter()
                    {
                        Dock = "Left", Title = "LeftSplitter"
                    },
                    rightPane,
                    new DockSplitter()
                    {
                        Dock = "Right", Title = "RightSplitter"
                    },
                    pageView
                }
            };

            var editorView = new EditorView
            {
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Editor",
                CurrentView = editorLayout,
                Views       = new ObservableCollection <IDock>
                {
                    editorLayout
                }
            };

            // About

            var aboutView = new AboutView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "About"
            };

            // Browser

            var browserView = new BrowserView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Browser"
            };

            // Document

            var documentView = new DocumentView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Document"
            };

            // Main

            var layout = new DockRoot
            {
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                CurrentView = dashboardView,
                Views       = new ObservableCollection <IDock>
                {
                    dashboardView,
                    editorView,
                    aboutView,
                    browserView,
                    documentView
                }
            };

            return(layout);
        }
Exemplo n.º 8
0
        /// <inheritdoc/>
        public override IDock CreateLayout()
        {
            // Home

            var homeView = new HomeView
            {
                Id     = "Home",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Home"
            };

            // Center

            var centerView = new CenterView
            {
                Id     = "Center",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Center"
            };

            // Left / Top

            var leftTopView1 = new LeftTopView1
            {
                Id     = "LeftTop1",
                Dock   = "LeftTop1",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftTop1"
            };

            var leftTopView2 = new LeftTopView2
            {
                Id     = "LeftTop2",
                Dock   = "",
                Width  = 200,
                Height = 200,
                Title  = "LeftTop2"
            };

            var leftTopView3 = new LeftTopView3
            {
                Id     = "LeftTop3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftTop3"
            };

            // Left / Bottom

            var leftBottomView1 = new LeftBottomView1
            {
                Id     = "LeftBottom1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom1"
            };

            var leftBottomView2 = new LeftBottomView2
            {
                Id     = "LeftBottom2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom2"
            };

            var leftBottomView3 = new LeftBottomView3
            {
                Id     = "LeftBottom3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom3"
            };

            // Right / Top

            var rightTopView1 = new RightTopView1
            {
                Id     = "RightTop1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop1"
            };

            var rightTopView2 = new RightTopView2
            {
                Id     = "RightTop2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop2"
            };

            var rightTopView3 = new RightTopView3
            {
                Id     = "RightTop3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop3"
            };

            // Right / Bottom

            var rightBottomView1 = new RightBottomView1
            {
                Id     = "RightBottom1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom1"
            };

            var rightBottomView2 = new RightBottomView2
            {
                Id     = "RightBottom2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom2"
            };

            var rightBottomView3 = new RightBottomView3
            {
                Id     = "RightBottom3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom3"
            };

            // Left Pane

            var leftPane = new DockLayout
            {
                Id          = "LeftPane",
                Dock        = "Left",
                Width       = 200,
                Height      = double.NaN,
                Title       = "LeftPane",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Id          = "LeftPaneTop",
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "LeftPaneTop",
                        CurrentView = leftTopView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            leftTopView1,
                            leftTopView2,
                            leftTopView3
                        }
                    },
                    new DockSplitter()
                    {
                        Id    = "LeftPaneTopSplitter",
                        Dock  = "Top",
                        Title = "LeftPaneTopSplitter"
                    },
                    new DockStrip
                    {
                        Id          = "LeftPaneBottom",
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "LeftPaneBottom",
                        CurrentView = leftBottomView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            leftBottomView1,
                            leftBottomView2,
                            leftBottomView3
                        }
                    }
                }
            };

            // Right Pane

            var rightPane = new DockLayout
            {
                Id          = "RightPane",
                Dock        = "Right",
                Width       = 240,
                Height      = double.NaN,
                Title       = "RightPane",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Id          = "RightPaneTop",
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "RightPaneTop",
                        CurrentView = rightTopView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            rightTopView1,
                            rightTopView2,
                            rightTopView3
                        }
                    },
                    new DockSplitter()
                    {
                        Id    = "RightPaneTopSplitter",
                        Dock  = "Top",
                        Title = "RightPaneTopSplitter"
                    },
                    new DockStrip
                    {
                        Id          = "RightPaneBottom",
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "RightPaneBottom",
                        CurrentView = rightBottomView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            rightBottomView1,
                            rightBottomView2,
                            rightBottomView3
                        }
                    }
                }
            };

            // Main

            var mainLayout = new DockLayout
            {
                Id          = "MainLayout",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "MainLayout",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    leftPane,
                    new DockSplitter()
                    {
                        Id    = "LeftSplitter",
                        Dock  = "Left",
                        Title = "LeftSplitter"
                    },
                    rightPane,
                    new DockSplitter()
                    {
                        Id    = "RightSplitter",
                        Dock  = "Right",
                        Title = "RightSplitter"
                    },
                    centerView
                }
            };

            var mainView = new MainView
            {
                Id          = "Main",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Main",
                CurrentView = mainLayout,
                Views       = new ObservableCollection <IDock>
                {
                    mainLayout
                }
            };

            // Root

            var layout = new DockRoot
            {
                Id          = "Root",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Root",
                CurrentView = homeView,
                DefaultView = homeView,
                Views       = new ObservableCollection <IDock>
                {
                    homeView,
                    mainView,
                }
            };

            return(layout);
        }