Ejemplo n.º 1
0
        /// <summary>
        /// Clones the given disposable.
        /// </summary>
        /// <returns></returns>
        public DisposableContainer Clone()
        {
            var clone = new DisposableContainer();

            clone.Add(this.m_disposables);
            return(clone);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// The operator is required to support the += operator.
 /// </summary>
 /// <param name="container">The disposable container on the left side of the += operator.</param>
 /// <param name="disposables">The disposables sequence on the right side of the += operator.</param>
 /// <returns>The same disposable container.</returns>
 public static DisposableContainer operator +(DisposableContainer container, IEnumerable <IDisposable> disposables)
 {
     if (container == null)
     {
         container = new DisposableContainer();
     }
     container.Add(disposables);
     return(container);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// The operator is required to support the += operator.
 /// </summary>
 /// <param name="container">The disposable container on the left side of the += operator.</param>
 /// <param name="disposable">The disposable on the right side of the += operator.</param>
 /// <returns>The same disposable container.</returns>
 public static DisposableContainer operator +(DisposableContainer container, IDisposable disposable)
 {
     if (container == null)
     {
         container = new DisposableContainer();
     }
     container.Add(disposable);
     return(container);
 }