Bagikan melalui


IContextManager.SetContext(IDictionary<String,String>) Metode

Definisi

Mengatur konteks.

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

Parameter

context
IDictionary<String,String>

Pasangan IDictionary<TKey,TValue> kunci/nilai dengan namespace layanan dan nama konteks yang ditetapkan.

Contoh

Kode berikut menunjukkan bagaimana konteks dapat diatur pada klien.

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

Berlaku untuk