語言

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);

適用於