语言

RpcMarshalableOptionalInterfaceAttribute 类

定义

要用于标记的 RpcMarshalableAttribute 接口的属性,以指示封送对象也可以实现接口 OptionalInterface。

[System.AttributeUsage(System.AttributeTargets.Interface, AllowMultiple=true, Inherited=false)]
public class RpcMarshalableOptionalInterfaceAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Interface, AllowMultiple=true, Inherited=false)>]
type RpcMarshalableOptionalInterfaceAttribute = class
    inherit Attribute
Public Class RpcMarshalableOptionalInterfaceAttribute
Inherits Attribute
继承
RpcMarshalableOptionalInterfaceAttribute
属性

注解

当实现的对象 OptionalInterface 被封送为其标记 RpcMarshalableOptionalInterfaceAttribute的基接口时, OptionalInterfaceCode 将包含在 StreamJsonRpc 消息中,允许创建也实现的 OptionalInterface代理。

如果收到消息时未 OptionalInterfaceCode 包含任何值,则对于具有已知可选接口的封送接口,将使用基接口创建代理。 创建代理时,将忽略未知 OptionalInterfaceCode 值。

RpcMarshalableOptionalInterfaceAttribute 仅当通过 RPC 方法封送对象时,才会使用该属性所分配给的接口的 RPC 方法: RpcMarshalableOptionalInterfaceAttribute 应用于扩展或扩展属性所分配给的接口的属性将被忽略。

构造函数

名称 说明
RpcMarshalableOptionalInterfaceAttribute(Int32, Type)

初始化 RpcMarshalableOptionalInterfaceAttribute 类的新实例。

属性

名称 说明
OptionalInterface

Type获取可封送对象可能实现的已知可选接口。

OptionalInterfaceCode

获取要序列化的代码,以指定应生成实现接口的 OptionalInterface 封送对象代理。

适用于