void SaveLayout(string LayoutName)
 {
     if (!string.IsNullOrEmpty(LayoutName))
     {
         XmlLayoutSerializer serializer = new XmlLayoutSerializer(WorkingArea);                                                                                            //创建序列化器
         serializer.Serialize(FileFolder.LinkPath(AppController.GetInstence().appPath, "Frame", FrameController.GetInstence().frameName, "Layout") + LayoutName + ".xml"); //根据路径储存布局
         MsgCenter.SendMsg(new MsgVar <string>(AllAppMsg.SaveUserVisible, LayoutName));
     }
 }
Example #2
0
        public void LoadUserVisible <T>(MsgBase msg)
        {
            MsgVar <string> tmpMSg = msg as MsgVar <string>;

            userVisible = bool.Parse(RWXml.TemporaryReadContent(
                                         PanelInfo.name,
                                         FileFolder.LinkPath(AppController.GetInstence().appPath, "Frame", FrameController.GetInstence().frameName, "Layout") + tmpMSg.parameter + ".xml",
                                         "UserVisible"
                                         ));
        }
Example #3
0
        public void SaveUserVisible <T>(MsgBase msg)
        {
            MsgVar <string> tmpMSg = msg as MsgVar <string>;

            RWXml.TemporaryAddPropertySetContent(
                PanelInfo.name,
                userVisible.ToString(),
                FileFolder.LinkPath(AppController.GetInstence().appPath, "Frame", FrameController.GetInstence().frameName, "Layout") + tmpMSg.parameter + ".xml",
                "UserVisible"
                );
        }
Example #4
0
 /// <summary>
 /// 显示 加载布局 的对话窗口
 /// </summary>
 public static void ShowLoadLayoutWindow()
 {
     ShowDialogue(new List <FormStruct>
     {
         new FormStruct
         {
             name       = "布局:",
             type       = FormItemType.DropDown,
             parameters = FileFolder.GetAllFileName(AppController.GetInstence().appPath, "Frame", FrameController.GetInstence().frameName, "Layout")
         }
     }, AllAppMsg.LoadLayout);//显示对话框
 }
 public FramePackage(string name)
 {
     this.name = name;
     if (File.Exists(AppController.GetInstence().appPath + "Package/" + name + ".dll"))
     {
         targetDll = Assembly.LoadFile(AppController.GetInstence().appPath + "Package/" + name + ".dll");
     }
     else if (File.Exists(AppController.GetInstence().appPath + "Frame/" + FrameController.GetInstence().frameName + "/Package/" + name + ".dll"))
     {
         targetDll = Assembly.LoadFile(AppController.GetInstence().appPath + "Frame/" + FrameController.GetInstence().frameName + "/Package/" + name + ".dll");
     }
     else
     {
         targetDll = Assembly.LoadFile("D:/OfficialProject/Model_Struct_Builder/BasicLib/bin/Debug/BasicLib.dll");
     }
 }
Example #6
0
        /// <summary>
        /// 显示 保存布局 的对话窗口
        /// </summary>
        public static void ShowSaveLayoutWindow()
        {
            List <string> tmp = FileFolder.GetAllFileName(AppController.GetInstence().appPath, "Frame", FrameController.GetInstence().frameName, "Layout"); //在布局文件夹中查找所有布局

            tmp.Remove("Common");                                                                                                                           //移除 默认布局,默认布局禁止用户修改
            tmp.Remove("Last");                                                                                                                             //移除 上次退出时的布局,该布局禁止用户修改
            ShowDialogue(new List <FormStruct>
            {
                new FormStruct
                {
                    name       = "布局:",
                    type       = FormItemType.InputDropDown,
                    parameters = tmp,
                }
            }, AllAppMsg.SaveLayout);//显示对话框
        }
        void LoadLayout(string LayoutName)
        {
            if (!string.IsNullOrEmpty(LayoutName))
            {
                using (AppController.GetInstence().LoadLayoutState.SetScope())
                {
                    MsgCenter.SendMsg(new MsgVar <string>(AllAppMsg.LoadUserVisible, LayoutName));
                    List <string> tmp = new List <string>(ViewModelLocator.instence.Main.WindowActionList.Keys);
                    foreach (string t in tmp)
                    {
                        ViewModelLocator.instence.Main.WindowActionList[t] = true;
                    }

                    MsgCenter.SendMsg(new MsgVar <string>(AllAppMsg.LoadUserVisible, LayoutName));
                    XmlLayoutSerializer serializer = new XmlLayoutSerializer(WorkingArea);//创建序列化器
                    serializer.Deserialize(FileFolder.LinkPath(AppController.GetInstence().appPath, "Frame", FrameController.GetInstence().frameName, "Layout") + LayoutName + ".xml");
                }
            }
        }
Example #8
0
        /// <summary>
        /// 加载一个模板
        /// </summary>
        void LoadTemplate <T>(MsgBase msg)
        {
            MsgVar <string> tmpMsg = (MsgVar <string>)msg;

            frameName = tmpMsg.parameter;
            //加载框架信息
            mainFrameData = new RXml(AppController.GetInstence().appPath + "Frame/" + frameName, "FrameData.xml");
            foreach (var path in mainFrameData.GetDoubleLayerElements("Load", "Xml"))
            {
                foreach (var file in path.Value)
                {
                    allFrameData.Add(file.Value, new RXml(AppController.GetInstence().appPath + "Frame/" + frameName + "/" + path.Key, file.Key + ".xml"));
                }
            }
            //加载框架所需的包
            foreach (var package in mainFrameData.GetAllElementContent("Load", "Package"))
            {
                FramePackage p = new FramePackage(package.Value);
                allPackage.Add(package.Key, p);
            }
            MsgCenter.SendMsg(new MsgBase(AllAppMsg.FrameLoadComplete));
        }