public override void ShowAddDialog(IConfigType type, IConfigManager manager) { Text = "新增" + (type != null ? type.Desc : "视频源"); mIsOk = false; mManager = manager as IConfigManager <IVideoSourceConfig>; mType = type as IVideoSourceType; mConfig = null; if (type.Verify(ACOpts.Manager_Add, false)) { InitTypeList(mManager.SystemContext); if (InitDialog()) { ShowDialog(); } } }
public I CreateConfigInstance(IConfigType type, string name) { IConfig config = null; if (type != null && type.Verify(ACOpts.Manager_Add)) { if (!type.ConfigClass.Equals("")) { if (!type.FileName.Equals("")) { config = CommonUtil.CreateInstance(SystemContext, type.FileName, type.ConfigClass) as IConfig; } else { config = CommonUtil.CreateInstance(type.ConfigClass) as IConfig; } ((CConfig)config).Manager = this; ((CConfig)config).SystemContext = this.SystemContext; } } if (config == null) { config = CreateConfigInstance(); } if (config != null) { if (name != null) { ((CConfig)config).Name = name; } ITypeConfig tc = config as ITypeConfig; if (tc != null) { tc.Type = type.Name; } } return((I)config); }