Example #1
0
        /// <summary>
        /// 解析子panel
        /// </summary>
        /// <param name="node"></param>
        /// <param name="childPanelItems"></param>
        private void ParseNodeBodyChildPanel(XmlNode node, Collection <FanLayoutPanel> childPanelItems)
        {
            XmlNodeList childPanelNodeList = XmlLoader.GetChildNodesByName(node, "subPanel");

            if (childPanelNodeList == null || childPanelNodeList.Count == 0)
            {
                return;
            }
            foreach (XmlNode childPanelNode in childPanelNodeList)
            {
                FanLayoutPanel panel = new FanLayoutPanel();
                panel.Guid          = XmlLoader.ReadAttrValue(childPanelNode, "guid");
                panel.Title         = XmlLoader.ReadAttrValue(childPanelNode, "title");
                panel.Name          = XmlLoader.ReadAttrValue(childPanelNode, "name");
                panel.Width         = XmlLoader.ReadAttrIntValue(childPanelNode, "width", 200);
                panel.Height        = XmlLoader.ReadAttrIntValue(childPanelNode, "height", 300);
                panel.DockPosistion = FanLayoutDockPositionEnumHelper.Parse(XmlLoader.ReadAttrValue(childPanelNode, "position"));
                panel.TabView       = ("true" == XmlLoader.ReadAttrValue(childPanelNode, "tabView"));
                panel.Type          = FanLayoutPanelTypeEnumHelper.Parse(XmlLoader.ReadAttrValue(childPanelNode, "type"));
                panel.Assembly      = XmlLoader.ReadAttrValue(childPanelNode, "assembly");
                panel.AssemblyType  = XmlLoader.ReadAttrValue(childPanelNode, "assembly-type");

                childPanelItems.Add(panel);

                //读取uiView
                //ParseNodeUiView(childPanelNode, ref panel.UiViewControl);
            }
        }
Example #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);
                }
            }
        }