private LoadComponent method_0(string string_0) { LoadComponent component = this.hashtable_0[string_0] as LoadComponent; if (component == null) { component = new LoadComponent(); component.LoadComponentLibrary(string_0); this.hashtable_1[string_0] = component; } return(component); }
public void LoadTools(IApplication pApp, string FileName) { LoadComponent component = new LoadComponent(); ComponentList list = new ComponentList(FileName); list.beginRead(); string str = ""; string str2 = ""; int subType = -1; for (int i = 0; i < list.GetComponentCount(); i++) { str2 = list.getClassName(i); str = Application.StartupPath + @"\" + list.getfilename(i); subType = list.getSubType(i); bool flag = component.LoadComponentLibrary(str); try { ICommand pCommand = null; pCommand = component.LoadClass(str2) as ICommand; if (pCommand == null) { Logger.Current.Error("", null, "无法创建:" + str2); } else { pCommand.OnCreate(pApp); if (subType != -1) { (pCommand as ICommandSubType).SetSubType(subType); } BarItem item = this.barManager1.Items[pCommand.Name]; if (item == null) { item = this.CreateBarItem(pCommand); } if ((pCommand is IBarEditItem) && (item is BarEditItem)) { (pCommand as IBarEditItem).BarEditItem = new YTComboxBarItem(item); } if (item != null) { item.Tag = pCommand; } } } catch (Exception exception) { CErrorLog.writeErrorLog(null, exception, ""); } } }