public void RemoveChangeListener(IPreferenceChangeListener listener) { if (_listenerList != null) { _listenerList.Remove(listener); } }
protected void ProtectedRemoveListener(object source, IWeakEventListener listener) { ListenerList list = sourceData[source] as ListenerList; if (list != null) { list.Remove(listener); } }
private void RemoveListener(INotifyPropertyChanged source, string propertyName, IWeakEventListener listener, EventHandler <PropertyChangedEventArgs> handler) { using (WriteLock) { HybridDictionary dict = (HybridDictionary)this[source]; if (dict != null) { ListenerList list = (ListenerList)dict[propertyName]; if (list != null) { // make sure list is ready for writing if (ListenerList.PrepareForWriting(ref list)) { dict[propertyName] = list; } // remove a listener from the list if (handler != null) { ListenerList <PropertyChangedEventArgs> hlist = (ListenerList <PropertyChangedEventArgs>)list; hlist.RemoveHandler(handler); } else { list.Remove(listener); } // when the last listener goes away, remove the list if (list.IsEmpty) { dict.Remove(propertyName); } } if (dict.Count == 0) { StopListening(source); Remove(source); } dict.Remove(AllListenersKey); // invalidate list of all listeners _proposedAllListenersList = null; } } }
internal void Remove(IWeakEventListener listener) { if (listener == null) { return; } ListenerList.PrepareForWriting(ref _listeners); _listeners.Remove(listener); if (_listeners.IsEmpty) { StopListening(); } }
private void RemoveListener(object source, object target, Delegate handler) { object sourceKey = (source != null) ? source : StaticSource; using (Table.WriteLock) { ListenerList list = (ListenerList)Table[this, sourceKey]; if (list != null) { // make sure list is ready for writing if (ListenerList.PrepareForWriting(ref list)) { Table[this, sourceKey] = list; } // remove the target from the list of listeners if (handler != null) { list.RemoveHandler(handler); } else { list.Remove((IWeakEventListener)target); } // after removing the last listener, stop listening if (list.IsEmpty) { Table.Remove(this, sourceKey); StopListening(source); } } } }
public void RemoveListener(ITerminalSettingsChangeListener l) { _listeners.Remove(l); }
public void RemoveSessionListener(ISessionListener listener) { _sessionListeners.Remove(listener); }
public void RemoveActiveDocumentChangeListener(IActiveDocumentChangeListener listener) { _activeDocumentChangeListeners.Remove(listener); }