/// <summary> /// Удалить обработчик /// </summary> /// <param name="operation">операция - функция делегат</param> public void RemoveOperation(OperationDoHandler operation) { if (false == _mutex.WaitOne(100)) { return; } try { if (_operations.Contains(operation)) { _operations.Remove(operation); } } finally { _mutex.ReleaseMutex(); } }
public static new void RemoveOperation(OperationDoHandler operation) { GetInstance().RemoveOperation(operation); }
/// <summary> /// Проверяет, обработчик уже есть в списке, и возвращает true, если есть /// </summary> /// <param name="operation"></param> /// <returns></returns> public bool ContainsOperation(OperationDoHandler operation) { return(_operations.Exists(it => it == operation)); }
public static new void AddOperation(OperationDoHandler operation) { GetInstance().AddOperation(operation); }