예제 #1
0
 public void RemoveChangeListener(IPreferenceChangeListener listener)
 {
     if (_listenerList != null)
     {
         _listenerList.Remove(listener);
     }
 }
예제 #2
0
        protected void ProtectedRemoveListener(object source, IWeakEventListener listener)
        {
            ListenerList list = sourceData[source] as ListenerList;

            if (list != null)
            {
                list.Remove(listener);
            }
        }
예제 #3
0
        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;
                }
            }
        }
예제 #4
0
            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);
                    }
                }
            }
        }
예제 #6
0
 public void RemoveListener(ITerminalSettingsChangeListener l)
 {
     _listeners.Remove(l);
 }
예제 #7
0
 public void RemoveSessionListener(ISessionListener listener)
 {
     _sessionListeners.Remove(listener);
 }
예제 #8
0
 public void RemoveActiveDocumentChangeListener(IActiveDocumentChangeListener listener)
 {
     _activeDocumentChangeListeners.Remove(listener);
 }