public void Register(string key, BaseModule module) { if (!_dicModules.ContainsKey(key)) { _dicModules.Add(key, module); } }
/// <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> /// Uns the register. /// </summary> /// <param name="module">Module.</param> public void UnRegister(BaseModule module) { Type t = module.GetType(); UnRegister(t.ToString()); }
private void LoadModule(Type moduleType) { BaseModule bm = System.Activator.CreateInstance(moduleType) as BaseModule; bm.Load(); }
public void Register(BaseModule module) { Type t = module.GetType(); Register(t.ToString(), module); }