Beispiel #1
0
        /// <summary>Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1" />.</summary>
        /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
        /// <returns>
        /// <see langword="true" /> if <paramref name="item" /> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1" />; otherwise, <see langword="false" />. This method also returns <see langword="false" /> if <paramref name="item" /> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1" />.</returns>
        /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only.</exception>
        public bool Remove(ProcessingStep <TIn, TIn, TResult> item)
        {
            var index = Steps.IndexOf(item);

            if (index == -1)
            {
                return(false);
            }

            RemoveAt(index);
            return(true);
        }
Beispiel #2
0
 /// <summary>Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1" />.</summary>
 /// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only.</exception>
 public void Add(ProcessingStep <TIn, TIn, TResult> item)
 {
     Steps.Add(item);
     Sync(Steps.Count - 1);
 }
Beispiel #3
0
 /// <summary>Determines whether the <see cref="T:System.Collections.Generic.ICollection`1" /> contains a specific value.</summary>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
 /// <returns>
 /// <see langword="true" /> if <paramref name="item" /> is found in the <see cref="T:System.Collections.Generic.ICollection`1" />; otherwise, <see langword="false" />.</returns>
 public bool Contains(ProcessingStep <TIn, TIn, TResult> item)
 {
     return(Steps.Contains(item));
 }
Beispiel #4
0
 /// <summary>Inserts an item to the <see cref="T:System.Collections.Generic.IList`1" /> at the specified index.</summary>
 /// <param name="index">The zero-based index at which <paramref name="item" /> should be inserted.</param>
 /// <param name="item">The object to insert into the <see cref="T:System.Collections.Generic.IList`1" />.</param>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 /// <paramref name="index" /> is not a valid index in the <see cref="T:System.Collections.Generic.IList`1" />.</exception>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IList`1" /> is read-only.</exception>
 public void Insert(int index, ProcessingStep <TIn, TIn, TResult> item)
 {
     Steps.Insert(index, item);
     Sync(index);
 }
Beispiel #5
0
 /// <summary>Determines the index of a specific item in the <see cref="T:System.Collections.Generic.IList`1" />.</summary>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.IList`1" />.</param>
 /// <returns>The index of <paramref name="item" /> if found in the list; otherwise, -1.</returns>
 public int IndexOf(ProcessingStep <TIn, TIn, TResult> item)
 {
     return(Steps.IndexOf(item));
 }
 /// <inheritdoc />
 public override ProcessingStep <TIn, T, TResult> ContinueWith <T>(ProcessingStep <TNext, T, TResult> next)
 {
     _tail.ContinueWith(next);
     return(new WrappedProcessingStep <TIn, TNext, T, TResult>(_head, next));
 }
 /// <inheritdoc />
 public override ProcessingStep <TIn, TResult> EndWith(ProcessingStep <TNext, TResult> next)
 {
     _tail.EndWith(next);
     return(_head);
 }
 /// <summary>
 /// Creates a new instance of <see cref="WrappedProcessingStep{TIn,TInTail,TNext,TResult}"/>
 /// </summary>
 /// <param name="head"></param>
 /// <param name="tail"></param>
 public WrappedProcessingStep(ProcessingStep <TIn, TResult> head, ProcessingStep <TInTail, TNext, TResult> tail)
 {
     _head = head;
     _tail = tail;
 }