Ejemplo n.º 1
0
        public List <SplitPanel> Deserialize(RadDock dock, RadDockComponentFactory componentFactory)
        {
            MainDocumentTabStripAdded = false;
            NewDockWindowsDictionary  = new Dictionary <Guid, DockWindow>();
            OldContainers             = new List <TabStripPanel>();

            List <SplitPanel> list = new List <SplitPanel>();

            if (dock == null)
            {
                return(list);
            }

            if (this.Sites != null)
            {
                int siteCount = this.Sites.Count;
                if (siteCount > 0)
                {
                    XmlDockNode dockNode = this.Sites[0].RootNode;
                    while (dockNode != null)
                    {
                        if (XmlDockNode.HasBothChildren(dockNode))
                        {
                            dock.Orientation = XmlDockNode.GetReversedOrientation(dockNode);
                            break;
                        }
                        dockNode = dockNode.Left;
                    }
                }

                for (int i = 0; i < siteCount; i++)
                {
                    list.AddRange(this.Sites[i].Deserialize(dock, componentFactory));
                }
            }

            dock.SplitPanels.AddRange(list);

            this.ProcessNewDockWindowDictionary(dock);
            this.RemoveOldContainers(dock);

            return(list);
        }
Ejemplo n.º 2
0
        public List <SplitPanel> DeserializeNode(RadDock dock, RadSplitContainer splitContainer, RadDockComponentFactory componentFactory)
        {
            List <SplitPanel> splitPanelList = new List <SplitPanel>();

            TabStripPanel dockableContainer = this.CreateDockableContainer(this.Dockables, componentFactory);

            if (dockableContainer != null)
            {
                foreach (XmlDockable dockable in this.Dockables)
                {
                    TabPanel panel = dockable.Deserialize(dock, splitContainer, componentFactory);
                    dockableContainer.TabPanels.Add(panel);
                }
                this.ProcessDockableContainer(dockableContainer, dock, splitPanelList, componentFactory);
            }

            RadSplitContainer  childSplitContainer = null;
            IList <SplitPanel> tempList            = splitPanelList;

            if (XmlDockNode.HasBothChildren(this))
            {
                Orientation orientation = XmlDockNode.GetReversedOrientation(this);
                if (orientation != splitContainer.Orientation)
                {
                    childSplitContainer = this.CreateSplitContainer(dock, componentFactory);
                    if (childSplitContainer != null)
                    {
                        childSplitContainer.Orientation = orientation;
                        splitPanelList.Add(childSplitContainer);
                        tempList = childSplitContainer.SplitPanels;
                    }
                }
            }

            this.DeserializeChildNode(this.Left, splitContainer, childSplitContainer, tempList, componentFactory, dock);
            this.DeserializeChildNode(this.Right, splitContainer, childSplitContainer, tempList, componentFactory, dock);

            return(splitPanelList);
        }