ISurrogateSelector::GetSurrogate Method (Type^, StreamingContext, ISurrogateSelector^%)

 

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

Namespace:   System.Runtime.Serialization
Assembly:  mscorlib (in mscorlib.dll)

[SecurityCriticalAttribute]
ISerializationSurrogate^ GetSurrogate(
	Type^ type,
	StreamingContext context,
	[OutAttribute] ISurrogateSelector^% selector
)

Parameters

type
Type: System::Type^

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

context
Type: System.Runtime.Serialization::StreamingContext

The source or destination context for the current serialization.

selector
Type: System.Runtime.Serialization::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.

Return Value

Type: System.Runtime.Serialization::ISerializationSurrogate^

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

Exception Condition
SecurityException

The caller does not have the required permission.

.NET Framework
Available since 1.1
Return to top
Show: