Share via


IContextManager.GetContext 方法

定义

获取上下文。

public:
 System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ GetContext();
public System.Collections.Generic.IDictionary<string,string> GetContext ();
abstract member GetContext : unit -> System.Collections.Generic.IDictionary<string, string>
Public Function GetContext () As IDictionary(Of String, String)

返回

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

示例

下面的代码演示如何从客户端上的类型化代理实例获取上下文。

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

适用于