ChannelFactoryBase.GetProperty<T> 方法

定义

从通道堆栈的适当层返回所请求的类型化对象(如果存在)。Returns a typed object requested, if present, from the appropriate layer in the channel stack.

public:
generic <typename T>
 where T : class virtual T GetProperty();
public virtual T GetProperty<T> () where T : class;
abstract member GetProperty : unit -> 'T (requires 'T : null)
override this.GetProperty : unit -> 'T (requires 'T : null)
Public Overridable Function GetProperty(Of T As Class) () As T

类型参数

T

方法正在查询的类型化对象。The typed object for which the method is querying.

返回

T

如果存在,则为所请求的类型化对象 T,如果不存在,则为 nullThe typed object T requested if it is present or null if it is not.

实现

注解

使用此方法可请求从通道工厂堆栈的适当层返回类型化对象,如用于设置属性或获取状态的接口。Use this to request a typed object such as an interface for setting properties or getting status from the appropriate layer in the channel factory stack. 如果某个层支持返回所请求的对象,则该层会返回对象。If a layer supports returning the requested object, it returns it. 如果不支持,则该层仅仅将调用委托给堆栈中的下一层。If not, it simply delegates the call down to the next layer in the stack. 如果到达堆栈底部仍然没有通道工厂层支持所请求的对象,则该方法返回 nullIf it gets to the bottom of the stack and no channel factory layer supported the requested object, then the method returns null.

这类似于 COM + 的 QueryService 接口。This is similar to COM+'s QueryService interface.

适用于