Example #1
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 #3
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 #5
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));
        }