IContextManager インターフェイス

定義

チャネルのコンテキストを取得および設定できるインターフェイスを定義します。

public interface class IContextManager
public interface IContextManager
type IContextManager = interface
Public Interface IContextManager

注釈

WSHttpContextBinding値が設定されたNotAllowedを使用するチャネルの場合、セッションを確立する新しいチャネルがチャネルにIContextManagerセマンティクスを適用GetProperty毎回作成されるため、NotAllowedを使用してクライアントでコンテキストを取得できません。 つまり、この場合、コンテキストはクライアントに正しく反映されますが、 IContextManagerを使用して取得することはできません。 次のコードに示すように、 ContextMessageProperty を使用して取得することもできます。

using (new OperationContextScope((IContextChannel)channel))
{
    channel.MyChannel("Test");
    ContextMessageProperty context;
    if (ContextMessageProperty.TryGet(OperationContext.Current.IncomingMessageProperties, out context))
    {
        Console.WriteLine(context.Count);
    }
}

プロパティ

名前 説明
Enabled

コンテキスト管理が有効かどうかを示す値を取得または設定します。

メソッド

名前 説明
GetContext()

コンテキストを取得します。

SetContext(IDictionary<String,String>)

コンテキストを設定します。

適用対象