Ejemplo n.º 1
0
        //private void ParseNodeUiView(XmlNode node, ref FanLayoutUiView uiView)
        //{
        //    XmlNode uiViewNode = XmlLoader.GetFirstChildNodeByName(node, "uiView");
        //    if (uiViewNode != null)
        //    {
        //        uiView = new FanLayoutUiView();
        //        uiView.Title = XmlLoader.ReadAttrValue(uiViewNode, "title");
        //        uiView.Name = XmlLoader.ReadAttrValue(uiViewNode, "name");
        //        uiView.Type = FanLayoutUiViewTypeEnumHelper.Parse(XmlLoader.ReadAttrValue(uiViewNode, "type"));
        //        uiView.Assembly = XmlLoader.ReadAttrValue(uiViewNode, "assembly");
        //        uiView.AssemblyType = XmlLoader.ReadAttrValue(uiViewNode, "assembly-type");
        //    }
        //    else
        //    {
        //        uiView = null;
        //    }
        //}

        private void ParseNodeBodyDocumentContainer(XmlNode node, FanLayoutBody layoutBody)
        {
            XmlNode documentContainerNode = XmlLoader.GetFirstChildNodeByName(node, "documentContainer");

            if (documentContainerNode == null)
            {
                return;
            }

            string title = XmlLoader.ReadAttrValue(documentContainerNode, "title");
            string name  = XmlLoader.ReadAttrValue(documentContainerNode, "name");

            if (layoutBody is FanLayoutDock)
            {
                FanLayoutDock bodyDock = (FanLayoutDock)layoutBody;
                bodyDock.DocumentContainer       = new FanLayoutDocumentContainer();
                bodyDock.DocumentContainer.Title = title;
                bodyDock.DocumentContainer.Name  = name;

                ParseNodeBodyTabView(documentContainerNode, bodyDock.DocumentContainer.TabViews);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 解析Panel
        /// </summary>
        /// <param name="node"></param>
        /// <param name="layoutBody"></param>
        private void ParseNodeBodyPanel(XmlNode node, FanLayoutBody layoutBody)
        {
            XmlNodeList panelNodeList = XmlLoader.GetChildNodesByName(node, "panel");

            if (panelNodeList == null || panelNodeList.Count == 0)
            {
                return;
            }
            foreach (XmlNode panelNode in panelNodeList)
            {
                if (layoutBody is FanLayoutDock)
                {
                    FanLayoutDock bodyDock = (FanLayoutDock)layoutBody;

                    FanLayoutPanel panel = new FanLayoutPanel();
                    panel.Guid          = XmlLoader.ReadAttrValue(panelNode, "guid");
                    panel.Title         = XmlLoader.ReadAttrValue(panelNode, "title");
                    panel.Name          = XmlLoader.ReadAttrValue(panelNode, "name");
                    panel.Width         = XmlLoader.ReadAttrIntValue(panelNode, "width", 200);
                    panel.Height        = XmlLoader.ReadAttrIntValue(panelNode, "height", 300);
                    panel.DockPosistion = FanLayoutDockPositionEnumHelper.Parse(XmlLoader.ReadAttrValue(panelNode, "position"));
                    panel.TabView       = ("true" == XmlLoader.ReadAttrValue(panelNode, "tabView"));
                    panel.Type          = FanLayoutPanelTypeEnumHelper.Parse(XmlLoader.ReadAttrValue(panelNode, "type"));
                    panel.Assembly      = XmlLoader.ReadAttrValue(panelNode, "assembly");
                    panel.AssemblyType  = XmlLoader.ReadAttrValue(panelNode, "assembly-type");

                    //子Panel
                    ParseNodeBodyChildPanel(panelNode, panel.ChildPanelItems);

                    bodyDock.Panels.Add(panel);

                    //读取uiView
                    //ParseNodeUiView(panelNode, ref panel.UiViewControl);
                }
            }
        }