语言

IContextManager.SetContext(IDictionary<String,String>) 方法

定义

设置上下文。

public:
 void SetContext(System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ context);
public void SetContext(System.Collections.Generic.IDictionary<string,string> context);
abstract member SetContext : System.Collections.Generic.IDictionary<string, string> -> unit
Public Sub SetContext (context As IDictionary(Of String, String))

参数

context
IDictionary<String,String>

键 IDictionary<TKey,TValue> /值对与设置的上下文的命名空间和名称。

示例

以下代码演示如何在客户端上设置上下文。

IDictionary<string, string> context;
CalculatorProxy proxy;
IContextManager cm = proxy.InnerChannel.GetProperty<IContextManager>();
if (cm != null)
    cm.SetContext(context);

适用于