System.ServiceModel 4.0.0.0 System.Object System.IDisposable

Use the class to create a scope for a specific object or a scope for a new object using a specified object. An can be used in a indigo1 service or indigo2 client application.

Once the object has established the current operation context, you can use the to:

Access and modify incoming and outgoing message headers and other properties.

Access the runtime, including dispatchers, the host, channel, and extensions.

Access other types of contexts, such as security, instance, and request contexts.

Access the channel associated with the object or (if the channel implements ) the associated channel's session identifier.

When an is created, the current is stored and the new becomes the one returned by the property. When the is disposed, the original is restored.

Do not use the asynchronous “await” pattern within a OperationContextScope block. When the continuation occurs, it may run on a different thread and OperationContextScope is thread specific. If you need to call “await” for an async call, use it outside of the OperationContextScope block.

Creates a block within which an object is in scope.

- Constructor
  4.0.0.0

  Use the constructor to create a new for a client channel that can be used to add or modify outbound message headers, read incoming message headers, or access other run-time properties of the .

  The headers added to the property of the newly created apply only to the channel that was passed to the constructor. If the user creates a new channel within its scope then the headers are not applied to messages sent on the new channel.

  Initializes a new instance of the class that uses the specified to create a new for the scope.

  The channel to use when creating the scope for a new .
- Constructor
  4.0.0.0

  Use the constructor to create a code block within which the specified object is the current scope.

  Initializes a new instance of the class to create a scope for the specified object.

  The active in the created scope.
- Method
  4.0.0.0
  System.Void To be added.

  Restores the original to the active context and recycles the object.