Esempio n. 1
0
        private void _ApplyLayout(LayoutSetting.LayoutSetting layout)
        {
            HideAll();

            int id;
            var rootNode = layout.Layout;

            foreach (var item in rootNode.Element("Elements").Elements())
            {
                id = int.Parse(item.Attribute("ID").Value);
                if (_dockControls.ContainsKey(id))
                {
                    _dockControls[id].ProtoType.Load(item);
                }
            }

            _root.LoadLayout(rootNode.Element("ToolBar"));

            _LoadRootPanel(rootNode.Element("Panel"));

            _LoadFloatWindows(rootNode.Element("FloatWindows"));

            var node = rootNode.Element("ActiveItem");

            if (node != null)
            {
                id = int.Parse(node.Value);
                if (_dockControls.ContainsKey(id))
                {
                    _dockControls[id].SetActive();
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// If name has exist, it will override the current layout,otherwise create a new layout.
 /// </summary>
 /// <param name="name">layout name</param>
 public void SaveCurrentLayout(string name)
 {
     if (_layouts.ContainsKey(name))
     {
         _layouts[name].Layout = _GenerateCurrentLayout();
     }
     else
     {
         _layouts[name] = new LayoutSetting.LayoutSetting(name, _GenerateCurrentLayout());
     }
 }