/// <summary> /// Adds the event handler to the manager. /// </summary> /// <param name='handler'> /// Handler to add. /// </param> public void AddEventHandler(SyncEventHandler handler) { // The zero-based index of item in the sorted List<T>, // if item is found; otherwise, a negative number that // is the bitwise complement of the index of the next // element that is larger than item or. int pos = this.handler.BinarySearch(handler); if (pos < 0) { pos = ~pos; } this.handler.Insert(pos, handler); }
/// <summary> /// Removes the event handler. /// </summary> /// <param name='handler'> /// Handler to remove. /// </param> public void RemoveEventHandler(SyncEventHandler handler) { this.handler.Remove(handler); }