public void RemoveTransactionFilter(IDdemlTransactionFilter filter) { if (IsDisposed) throw new ObjectDisposedException(GetType().ToString()); if (filter == null) throw new ArgumentNullException("filter"); if (!_Filters.Contains(filter)) throw new InvalidOperationException(Resources.FilterNotAddedMessage); _Filters.Remove(filter); }
public void AddTransactionFilter(IDdemlTransactionFilter filter) { if (IsDisposed) { throw new ObjectDisposedException(this.GetType().ToString()); } if (filter == null) { throw new ArgumentNullException("filter"); } if (_Filters.Contains(filter)) { throw new InvalidOperationException(Resources.FilterAlreadyAddedMessage); } _Filters.Add(filter); }
/// <summary> /// This removes a transaction filter and stops it from monitoring DDE transactions. /// </summary> /// <param name="filter"> /// The implementation of <c>ITransactionFilter</c> that you want to remove. /// </param> /// <exception cref="ArgumentNullException"> /// This is thrown when filter is a null reference. /// </exception> /// <exception cref="InvalidOperationException"> /// This is thrown when the filter was not previously added. /// </exception> /// <remarks> /// <para> /// Transaction filters can be used to intercept the DDEML callback. /// </para> /// <para> /// <note type="caution"> /// Incorrect usage of the DDEML can cause this library to function incorrectly and can lead to resource leaks. /// </note> /// </para> /// </remarks> public void RemoveTransactionFilter(IDdeTransactionFilter filter) { ThreadStart method = delegate { IDdemlTransactionFilter tf = filter == null ? null : new DdemlTransactionFilter(filter); DdemlObject.RemoveTransactionFilter(tf); }; try { Invoke(method); } catch (ObjectDisposedException e) { throw new ObjectDisposedException(GetType().ToString(), e); } }
public void RemoveTransactionFilter(IDdemlTransactionFilter filter) { if (IsDisposed) { throw new ObjectDisposedException(this.GetType().ToString()); } if (filter == null) { throw new ArgumentNullException("filter"); } if (!_Filters.Contains(filter)) { throw new InvalidOperationException(Resources.FilterNotAddedMessage); } _Filters.Remove(filter); }