SurrogateSelector.GetSurrogate(Type, StreamingContext, ISurrogateSelector) SurrogateSelector.GetSurrogate(Type, StreamingContext, ISurrogateSelector) SurrogateSelector.GetSurrogate(Type, StreamingContext, ISurrogateSelector) Method

Definition

Returns the surrogate for a particular type.

public:
 virtual System::Runtime::Serialization::ISerializationSurrogate ^ GetSurrogate(Type ^ type, System::Runtime::Serialization::StreamingContext context, [Runtime::InteropServices::Out] System::Runtime::Serialization::ISurrogateSelector ^ % selector);
[System.Security.SecurityCritical]
public virtual System.Runtime.Serialization.ISerializationSurrogate GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
abstract member GetSurrogate : Type * System.Runtime.Serialization.StreamingContext *  -> System.Runtime.Serialization.ISerializationSurrogate
override this.GetSurrogate : Type * System.Runtime.Serialization.StreamingContext *  -> System.Runtime.Serialization.ISerializationSurrogate

Parameters

type
Type Type Type

The Type for which the surrogate is requested.

context
StreamingContext StreamingContext StreamingContext

The streaming context.

Returns

Implements

Exceptions

The caller does not have the required permission.

Remarks

If the current selector cannot provide a surrogate, it checks all its child objects before returning null.

Security

SecurityPermission
for providing serialization services. Associated enumeration: SerializationFormatter.

Applies to