public PluginMenuItem(PluginBase plugin, IPluginObserver observer) { pPlugin = plugin; pObserver = observer; Click += PluginMenuItemClick; Text = plugin.Name; }
public void Unsubscribe(Type messageType, IPluginObserver observer) { IList <IPluginObserver> observersList; if (_dicObservers.TryGetValue(messageType, out observersList)) { if (observersList.Contains(observer)) { observersList.Remove(observer); } } }
public void Subscribe(Type messageType, IPluginObserver observer) { IList <IPluginObserver> observersList; if (!_dicObservers.TryGetValue(messageType, out observersList)) { _dicObservers.TryAdd(messageType, new List <IPluginObserver> { observer }); } else { if (!observersList.Contains(observer)) { observersList.Add(observer); } } }
public void Init(IPluginObserver observer) { pObserver = observer; }