/// <summary> /// 更新样式文件 /// </summary> protected virtual void UpdataStyleXML(StylePar Par) { string xmlfile = Lemon.GetCSFRootDirectory() + @"\Styles\Data\" + Par.WindowClassFullName + ".xml"; File.Delete(xmlfile); CreateStyleXML(Par); }
/// <summary> /// 创建菜单项目集合 /// </summary> /// <returns></returns> public Dictionary <string, PtMenuItem> CreateMenuItems() { this.xmlfilepath = Lemon.GetCSFRootDirectory() + "\\Menu.xml"; CreateMenu(); //EasyComeEasyGo(); return(this.items); }
/// <summary> /// 读取模块管理器配置 /// </summary> /// <returns></returns> protected virtual Lemonade.Frame.Running.IRunningRules LoadRules() { Lemonade.Frame.Running.IRunningRules result = null; string s = Lemon.GetCSFRootDirectory(); result = Lemon.FindInstanceFromDirectory <Lemonade.Frame.Running.IRunningRules>(s); return(result); }
/// <summary> /// 读取模块管理器配置 /// </summary> /// <returns></returns> protected virtual Lemonade.Frame.Running.ISystemExceptionDefine LoadExceptionDefine() { Lemonade.Frame.Running.ISystemExceptionDefine result = null; string s = Lemon.GetCSFRootDirectory(); result = Lemon.FindInstanceFromDirectory <Lemonade.Frame.Running.ISystemExceptionDefine>(s); return(result); }
/// <summary> /// 读取模块管理器配置 /// </summary> /// <returns></returns> protected virtual Lemonade.Frame.Module.IModuleManager loadModuleManager() { Lemonade.Frame.Module.IModuleManager result = null; string s = Lemon.GetCSFRootDirectory(); result = Lemon.FindInstanceFromDirectory <Lemonade.Frame.Module.IModuleManager>(s); return(result); }
/// <summary> /// 加载数据交换池 /// </summary> /// <returns></returns> protected virtual Lemonade.Frame.Swapping.ISwapPool LoadSwapPool() { Lemonade.Frame.Swapping.ISwapPool result = null; string s = Lemon.GetCSFRootDirectory(); result = Lemon.FindInstanceFromDirectory <Lemonade.Frame.Swapping.ISwapPool>(s); return(result); }
/// <summary> /// 从框架的模块存储路径中自动获取菜单工厂的实例 /// </summary> /// <returns></returns> protected virtual Lemonade.Frame.Menu.IMenuItemFactory LoadMenuItemFactory() { Lemonade.Frame.Menu.IMenuItemFactory result = null; string s = Lemon.GetCSFRootDirectory(); result = Lemon.FindInstanceFromDirectory <Lemonade.Frame.Menu.IMenuItemFactory>(s); return(result); }
/// <summary> /// 从框架的模块存储路径中自动获取菜单工厂的实例 /// </summary> /// <returns></returns> protected virtual Lemonade.Frame.UI.ILayoutManager LoadUI() { Lemonade.Frame.UI.ILayoutManager result = null; string s = Lemon.GetCSFRootDirectory(); result = Lemon.FindInstanceFromDirectory <Lemonade.Frame.UI.ILayoutManager>(s); return(result); }
/// <summary> /// /// </summary> public LayoutSplitC() { object tmpobj = Lemon.Deserialize(typeof(LayoutSplitCConfig), Lemon.GetCSFRootDirectory() + @"Styles\LayoutSplitCConfig.xml"); if (tmpobj != null) { this.UIConfig = (LayoutSplitCConfig)tmpobj; } }
/// <summary> /// 搜索所有模块程序集 /// </summary> /// <returns></returns> protected virtual void LocaStyle() { this.winstyles = new List <IWindowStyle>(); string styledir = Lemon.GetCSFRootDirectory() + @"\Styles\"; this.winstyles = Lemon.FindInstanceFromDirectory <IWindowStyle>(styledir, false); this.layouts = Lemon.FindInstanceFromDirectory <ILayout>(styledir, false); //styledir = Lemon.GetCSFRootDirectory() + @"\Styles\Data\"; //LoadStyleXml(styledir); }
/// <summary> /// 添加处理器 /// </summary> protected virtual void AddProcess() { object tbs = Lemon.Deserialize(typeof(ExceptionDefine), Lemon.GetCSFRootDirectory() + @"\SystemException\ExceptionDefine.xml"); if (tbs != null) { Lemonade.Frame.Message.IMsgProcess msgp = new AutomaticRecording((ExceptionDefine)tbs); Lemon.AddMsgProcess(msgp); } }
/// <summary> /// 从框架根目录中加载工具栏管理器 /// </summary> /// <returns></returns> protected virtual Tools.IToolsBarManager LoadToolsBarManager() { Tools.IToolsBarManager result = null; string s = Lemon.GetCSFRootDirectory(); result = Lemon.FindInstanceFromDirectory <Tools.IToolsBarManager>(s); if (result != null) { result.LoadToolsBar(); } return(result); }
/// <summary> /// 从框架根目录中加载动作管理器 /// </summary> /// <returns></returns> protected virtual IActionManager LoadActionManager() { Lemonade.Frame.Running.IActionManager result = null; string s = Lemon.GetCSFRootDirectory(); result = Lemon.FindInstanceFromDirectory <Lemonade.Frame.Running.IActionManager>(s); if (result != null) { result.LoadActionsContext(); } return(result); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void Frm_Main_Load(object sender, EventArgs e) { this.Envir.SystemRoundOff = new RoundOff(this); waitingobj = new Lemonade.Daemon.WaitingProgram(this); Protein.Enzyme.Message.MessageObject msg = new Protein.Enzyme.Message.MessageObject(Protein.Enzyme.Message.MessageType.Debug); msg.Message = "启动"; XmlHelper xfile = new XmlHelper(Lemon.GetCSFRootDirectory() + "config\\Setting.xml"); string title = xfile.GetNodeValue("descendant::LabelText/WelcomeTitle"); this.Text = title; }
/// <summary> /// 加载工具栏 /// </summary> public void LoadToolsBar() { object tbs = Lemon.Deserialize(typeof(ToolsBarData), Lemon.GetCSFRootDirectory() + @"\ToolBar\ToolsBarData.xml"); if (tbs != null) { //转换为工具栏 ToolsBarFactroy tbfac = new ToolsBarFactroy((ToolsBarData)tbs); this.barsetting = tbfac.BarSetting; if (this.barsetting != null) { tbfac.BuildToolsButton(); } } }
/// <summary> /// 获取 /// </summary> /// <param name="SourceException"></param> public virtual string GetCustomException(string SourceExceptionMsg) { string result = "未定义"; object tbs = Lemon.Deserialize(typeof(ExceptionDefine), Lemon.GetCSFRootDirectory() + @"\SystemException\ExceptionDefine.xml"); if (tbs != null) { var tagce = ((ExceptionDefine)tbs).ExList.Find(delegate(CustomException ce) { return(ce.Value == SourceExceptionMsg); }); if (tagce != null) { result = tagce.Title; } } return(result); }
/// <summary> /// 获取样式参数 /// </summary> /// <param name="WindowClassFullName"></param> /// <returns></returns> public StylePar GetStyleParameter(string WindowClassFullName) { string xmlfile = Lemon.GetCSFRootDirectory() + @"\Styles\Data\" + WindowClassFullName + ".xml"; if (File.Exists(xmlfile)) { object tmpobj = Lemon.Deserialize(typeof(StylePar), xmlfile); if (tmpobj != null) { if (Lemon.GetObjType(tmpobj) == typeof(StylePar)) { return((StylePar)tmpobj); } } } return(null); }
/// <summary> /// 启动守护线程 /// </summary> /// <returns></returns> protected virtual INazgul LaunchSummon() { ISummon summon = null; string s = Lemon.GetCSFRootDirectory(); summon = Lemon.FindInstanceFromDirectory <ISummon>(s); if (summon != null) { INazgul nazgul = summon.RingtoWear(); nazgul.LoadNazgulSkill(); nazgul.UseAllSkill(); return(nazgul); } else { return(null); } }
/// <summary> /// 记录 /// </summary> /// <param name="Msg"></param> public virtual void Process(object Msg, DateTime Date) { bool isExt = false; if (Lemon.GetObjType(Msg) == typeof(string)) { isExt = CheckString((string)Msg); } else if (Lemon.GetObjType(Msg) == typeof(Exception)) { isExt = CheckString(((Exception)Msg).Message); } if (!isExt) { //不存在 写入一条新的记录 Lemon.XmlSerialize <ExceptionDefine>(Lemon.GetCSFRootDirectory() + @"\SystemException\ExceptionDefine.xml", Encoding.Unicode, this.exdefine); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void Frm_Welcome_Load(object sender, EventArgs e) { this.label5.Text = DateTime.Now.ToString("yyyy'年'MM'月'dd'日'"); //加载图片 string picfile = Lemon.GetCSFRootDirectory() + "welcome.jpg"; //是否存在文件 if (System.IO.File.Exists(picfile)) { this.BackgroundImage = Image.FromFile(picfile); } //文字 XmlHelper xfile = new XmlHelper(Lemon.GetCSFRootDirectory() + "config\\Setting.xml"); string title = xfile.GetNodeValue("descendant::LabelText/WelcomeTitle"); this.label2.Text = title; string Halftitle = xfile.GetNodeValue("descendant::LabelText/WelcomeHalfTitle"); this.label3.Text = Halftitle; xfile = null; }
/// <summary> /// 加载动作上下文处理器到模板 /// </summary> /// <returns></returns> public void LoadActionsContext() { string styledir = Lemon.GetCSFRootDirectory() + @"\Actions\"; this.contexttemplates = Lemon.FindInstanceFromDirectory <IActionContext>(styledir, false); }
/// <summary> /// 创建样式xml /// </summary> /// <param name="TargetForm"></param> protected virtual void CreateStyleXML(StylePar Sp) { string xmlfile = Lemon.GetCSFRootDirectory() + @"\Styles\Data\" + Sp.WindowClassFullName + ".xml"; Lemon.XmlSerialize <StylePar>(xmlfile, Encoding.Unicode, Sp); }
/// <summary> /// 数据转换到控件 /// </summary> protected ToolsBarSetting DataConvterCtrl(ToolsBarData BarData) { string pathbase = Lemon.GetCSFRootDirectory(); ToolsBarSetting result = new ToolsBarSetting(); //工具栏 foreach (TBar tbar in BarData.Bars) { ToolsBar newBar = new ToolsBar(); newBar.ParentFormName = tbar.ParentFormName; newBar.ToolsBarCode = tbar.ToolsBarCode; newBar.ToolsBarName = tbar.ToolsBarName; result.Bars.Add(newBar); } //按钮 foreach (TButton tbtn in BarData.Buttons) { ToolsButton newBtn = new ToolsButton(); newBtn.AssemblyPath = pathbase + tbtn.Assembly; newBtn.FullClassName = tbtn.FullClassName; newBtn.GroupName = tbtn.GroupName; newBtn.ItemImage = pathbase + tbtn.ItemImage; newBtn.ItemIndex = tbtn.ItemIndex; newBtn.Title = tbtn.Title; newBtn.ToolsBarCode = tbtn.ToolsBarCode; IControlToolsButton elm = Lemon.GetInstance <IControlToolsButton>(newBtn.AssemblyPath, newBtn.FullClassName); if (elm != null) { newBtn.UIElement = elm; result.Buttons.Add(newBtn); } else { Lemon.SendMsgDebug("配置的工具栏按钮" + newBtn.ToolsBarCode + "没有实现IUIElement接口"); } } //下拉框 foreach (TComboBox tcb in BarData.ComboBoxs) { ToolsComboBox newCb = new ToolsComboBox(); newCb.GroupName = tcb.GroupName; newCb.ItemIndex = tcb.ItemIndex; newCb.ToolsBarCode = tcb.ToolsBarCode; IControlToolsComoBoxItem cbelm = Lemon.GetInstance <IControlToolsComoBoxItem>(tcb.Assembly, tcb.FullClassName); if (cbelm != null) { newCb.UIElement = cbelm; } else { Lemon.SendMsgDebug("配置的工具栏下拉框" + newCb.ToolsBarCode + "没有实现IUIElement接口"); } foreach (TComboBoxItem ti in tcb.Items) { ToolsComboBoxItem newItem = new ToolsComboBoxItem(); ti.Assembly = pathbase + ti.Assembly; newItem.ItemData = ti; IControlToolsComoBoxItem elm = Lemon.GetInstance <IControlToolsComoBoxItem>(ti.Assembly, ti.FullClassName); if (elm != null) { newItem.UIElement = elm; newCb.Items.Add(newItem); } else { Lemon.SendMsgDebug("配置的工具栏下拉框的选项" + ti.Title + "没有实现IUIElement接口"); } } result.ComboBoxs.Add(newCb); } //分栏 foreach (TSeparator tsep in BarData.Separator) { ToolsSeparator newSep = new ToolsSeparator(); newSep.GroupName = tsep.GroupName; newSep.ItemIndex = tsep.ItemIndex; newSep.ToolsBarCode = tsep.ToolsBarCode; result.Separator.Add(newSep); } return(result); }
/// <summary> /// 加载戒灵技能 /// </summary> public void LoadNazgulSkill() { string s = Lemon.GetCSFRootDirectory() + @"\Skills\"; this.skills = Lemon.FindInstanceFromDirectory <INazgulSkill>(s, false); }