ISurrogateSelector::GetSurrogate Method (Type^, StreamingContext, ISurrogateSelector^%)
.NET Framework (current version)
Finds the surrogate that represents the specified object's type, starting with the specified surrogate selector for the specified serialization context.
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. |
This method is protected by a SecurityAction::LinkDemand for the SecurityPermission with the SecurityPermissionFlag::SerializationFormatter specified.
.NET Framework
Available since 1.1
Available since 1.1
Show: