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

 

Returns the surrogate for a particular type.

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

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

Parameters

type
Type: System::Type^

The Type for which the surrogate is requested.

context
Type: System.Runtime.Serialization::StreamingContext

The streaming context.

selector
Type: System.Runtime.Serialization::ISurrogateSelector^%

The surrogate to use.

Return Value

Type: System.Runtime.Serialization::ISerializationSurrogate^

The surrogate for a particular type.

Exception Condition
ArgumentNullException

The type parameter is null.

SecurityException

The caller does not have the required permission.

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

SecurityPermission

for providing serialization services. Associated enumeration: SecurityPermissionFlag::SerializationFormatter.

.NET Framework
Available since 1.1
Return to top
Show: