/// <summary> /// /// </summary> public bool Remove(ItemType item) { if (ItemRemoveDelegate != null) { if (ItemRemoveDelegate(this, item) == false) {// Confirmative owner delegate denied item addition. return(false); } } lock (this) { if (_items.Remove(item) == false) {// Item remove failed. return(false); } if (_itemIsOperational) { ((IOperational)item).OperationalStateChangedEvent -= new OperationalStateChangedDelegate(GenericKeeper_OperationalStatusChangedEvent); } } if (ItemRemovedEvent != null) { ItemRemovedEvent(this, item); } return(true); }
/// <summary> /// /// </summary> public bool RemoteFilter(TracerFilter filter) { lock (this) { if (_filters.Remove(filter)) { filter.FilterUpdatedEvent -= new TracerFilter.FilterUpdatedDelegate(filter_FilterUpdatedEvent); return(true); } } return(false); }
/// <summary> /// Remove tracer item sink from tracer. /// </summary> /// <param name="sink"></param> /// <returns></returns> public bool Remove(ITracerItemSink sink) { bool result; lock (this) { result = _itemSinks.Remove(sink); } if (result) { sink.Dispose(); } return(result); }
public virtual bool RemoveSlaveControl(ITimeControl control) { lock (_slaveControls) { return(_slaveControls.Remove(control)); } }