IContextManager.SetContext(IDictionary<String,String>) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定背景。
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);