Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


SurrogateSelector.GetSurrogate Method

Definition

Returns the surrogate for a particular type.

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);

Parameters

type
Type

The Type for which the surrogate is requested.

context
StreamingContext

The streaming context.

selector
ISurrogateSelector

The surrogate to use.

Returns

The surrogate for a particular type.

Implements

Attributes

Exceptions

The type parameter is null.

The caller does not have the required permission.

Remarks

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

Applies to

Termék Verziók
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1