/// <summary>
 /// Calls <see cref="IConnectionOutputControlFeature.Suspend"/> when
 /// a scope is created.
 /// </summary>
 /// <param name="feature">The <seealso cref="IConnectionOutputControlFeature"/> to suspend.</param>
 /// <returns>The new <seealso cref="ConnectionOutputControlScope"/>.</returns>
 public static ConnectionOutputControlScope Create(IConnectionOutputControlFeature feature)
 {
     feature.Suspend();
     return(new ConnectionOutputControlScope
     {
         _feature = feature
     });
 }
Exemplo n.º 2
0
 /// <summary>
 /// Calls <seealso cref="IConnectionOutputControlFeature.Suspend"/> and returns
 /// an <seealso cref="IDisposable"/> scope object. When <seealso cref="IDisposable"/>
 /// is called a corresponding call to <seealso cref="IConnectionOutputControlFeature.Resume"/>
 /// is made automatically.
 /// </summary>
 /// <param name="outputControl">An <seealso cref="IConnectionOutputControlFeature"/> interface
 /// to Suspend.</param>
 /// <returns>A <seealso cref="ConnectionOutputControlScope"/> object.</returns>
 public static ConnectionOutputControlScope SuspendScope(this IConnectionOutputControlFeature outputControl)
 {
     return(ConnectionOutputControlScope.Create(outputControl));
 }