Sdílet prostřednictvím


SurrogateSelector.GetSurrogate Metoda

Definice

Vrátí náhradu pro konkrétní typ.

public:
 virtual System::Runtime::Serialization::ISerializationSurrogate ^ GetSurrogate(Type ^ type, System::Runtime::Serialization::StreamingContext context, [Runtime::InteropServices::Out] System::Runtime::Serialization::ISurrogateSelector ^ % selector);
public virtual System.Runtime.Serialization.ISerializationSurrogate? GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
public virtual System.Runtime.Serialization.ISerializationSurrogate GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, 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 * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
override this.GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
[<System.Security.SecurityCritical>]
abstract member GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
override this.GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
Public Overridable Function GetSurrogate (type As Type, context As StreamingContext, ByRef selector As ISurrogateSelector) As ISerializationSurrogate

Parametry

type
Type

Jedná se Type o náhradu, pro kterou je požadován náhradník.

context
StreamingContext

Kontext datového proudu.

selector
ISurrogateSelector

Náhradník, který se má použít.

Návraty

Náhrada pro určitý typ.

Implementuje

Atributy

Výjimky

Parametr type je null.

Volající nemá požadované oprávnění.

Poznámky

Pokud aktuální selektor nemůže poskytnout náhradní objekt, zkontroluje před vrácením všechny podřízené nullobjekty .

Platí pro