語言

RpcMarshalableOptionalInterfaceAttribute 類別

定義

屬性用於標記為 的 RpcMarshalableAttribute 介面,表示可標記的 marchhalable 物件也可能實作介面 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方法編組,且該方法正好使用該屬性所指派的介面時,才會被尊重: RpcMarshalableOptionalInterfaceAttribute 對於從該屬性分配到介面延伸或延伸的屬性則被忽略。

建構函式

名稱 Description
RpcMarshalableOptionalInterfaceAttribute(Int32, Type)

初始化 RpcMarshalableOptionalInterfaceAttribute 類別的新執行個體。

屬性

名稱 Description
OptionalInterface

取得 Type 可封存物件可能實作的已知可選介面之一。

OptionalInterfaceCode

取得要序列化的程式碼,指定應產生編組物件代理並實作介面 OptionalInterface 。

適用於