Share via


RpcMarshalableOptionalInterfaceAttribute Class

Definition

Attribute to be used on an interface marked with RpcMarshalableAttribute to indicate that the marshalable object may also implement the interface 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
Inheritance
RpcMarshalableOptionalInterfaceAttribute
Attributes

Remarks

When an object that implements OptionalInterface is marshaled as its base interface marked with RpcMarshalableOptionalInterfaceAttribute, OptionalInterfaceCode is included in the StreamJsonRpc message allowing the creation of a proxy which also implements OptionalInterface.

If a message is received containing no OptionalInterfaceCode values, for a marshalable interface that has known optional interfaces, a proxy will be created using the base interface. Unknown OptionalInterfaceCode values will be ignored when creating the proxy.

RpcMarshalableOptionalInterfaceAttribute is honored only when an object is marshaled through an RPC method that used exactly the interface the attribute is assigned to: RpcMarshalableOptionalInterfaceAttribute attributes applied to interfaces extending or extended from the one the attribute is assigned to are ignored.

Constructors

RpcMarshalableOptionalInterfaceAttribute(Int32, Type)

Initializes a new instance of the RpcMarshalableOptionalInterfaceAttribute class.

Properties

OptionalInterface

Gets the Type of the known optional interface that the marshalable object may implement.

OptionalInterfaceCode

Gets the code to be serialized to specify that the marshaled object proxy should be generated implementing the OptionalInterface interface.

Applies to