private void NotifyListeners(IResource parent, Operation op, IResource res, IPropertyChangeSet cs) { lock ( _listeners ) { ArrayList listenerList = (ArrayList)_listeners [parent.Id]; if (listenerList != null) { for (int i = 0; i < listenerList.Count; i++) { IResourceListListener listener = (IResourceListListener)listenerList [i]; switch (op) { case Operation.Added: listener.ResourceAdded(res); break; case Operation.Changed: listener.ResourceChanged(res, cs); break; case Operation.Deleting: listener.ResourceDeleting(res); break; } } } } }
public void UnregisterListener(IResource parent, IResourceListListener listener) { lock ( _listeners ) { ArrayList listenerList = (ArrayList)_listeners [parent.Id]; if (listenerList != null) { listenerList.Remove(listener); } } }
public void RegisterListener(IResource parent, IResourceListListener listener) { lock ( _listeners ) { ArrayList listenerList = (ArrayList)_listeners [parent.Id]; if (listenerList == null) { listenerList = new ArrayList(); _listeners [parent.Id] = listenerList; } listenerList.Add(listener); } }
public void UnregisterTreeListener(IResource parent, int parentProp, IResourceListListener listener) { TreeListenerManager manager; lock ( _treeListenerManagers ) { manager = (TreeListenerManager)_treeListenerManagers [parentProp]; } if (manager != null) { manager.UnregisterListener(parent, listener); } }
public void RegisterTreeListener(IResource parent, int parentProp, IResourceListListener listener) { TreeListenerManager manager; lock ( _treeListenerManagers ) { manager = (TreeListenerManager)_treeListenerManagers [parentProp]; if (manager == null) { manager = new TreeListenerManager(parentProp); _treeListenerManagers [parentProp] = manager; } } manager.RegisterListener(parent, listener); }