/// <summary> /// Uns the register. /// </summary> /// <param name="key">Key.</param> public void UnRegister(string key) { if (dicModules.ContainsKey(key)) { BaseModule module = dicModules[key]; module.Release(); dicModules.Remove(key); module = null; } }
/// <summary> /// Register the specified module. /// </summary> /// <param name="module">Module.</param> public void Register(BaseModule module) { Type t = module.GetType(); Register(t.ToString(), module); }
/// <summary> /// Uns the register. /// </summary> /// <param name="module">Module.</param> public void UnRegister(BaseModule module) { Type t = module.GetType(); UnRegister(t.ToString()); }
//(System.Activator.CreateInstance)为创建类型的一个实例 public void LoadModule(Type moduleType) { BaseModule bm = System.Activator.CreateInstance(moduleType) as BaseModule; bm.Load(); }