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

Definition

Finds the surrogate that represents the specified object's type, starting with the specified surrogate selector for the specified serialization context.

public:
 System::Runtime::Serialization::ISerializationSurrogate ^ GetSurrogate(Type ^ type, System::Runtime::Serialization::StreamingContext context, [Runtime::InteropServices::Out] System::Runtime::Serialization::ISurrogateSelector ^ % selector);
[System.Security.SecurityCritical]
public 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 * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate

Parameters

type
Type Type Type

The Type of object (class) that needs a surrogate.

context
StreamingContext StreamingContext StreamingContext

The source or destination context for the current serialization.

selector
ISurrogateSelector ISurrogateSelector ISurrogateSelector

When this method returns, contains a ISurrogateSelector that holds a reference to the surrogate selector where the appropriate surrogate was found. This parameter is passed uninitialized.

Returns

The appropriate surrogate for the given type in the given context.

Exceptions

The caller does not have the required permission.

Remarks

This method is protected by a SecurityAction.LinkDemand for the SecurityPermission with the SecurityPermissionFlag.SerializationFormatter specified.

Applies to