NameInvariantSurrogateSelectorGetSurrogate Method

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

Definition

Namespace: KGySoft.Serialization.Binary
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
[SecurityCriticalAttribute]
public ISerializationSurrogate? GetSurrogate(
	Type type,
	StreamingContext context,
	out ISurrogateSelector selector
)

Parameters

type  Type
The Type of object that needs a surrogate.
context  StreamingContext
The source or destination context for the current serialization.
selector  ISurrogateSelector
When this method returns, contains a ISurrogateSelector that holds a reference to the surrogate selector where the appropriate surrogate was found.

Return Value

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

Implements

ISurrogateSelectorGetSurrogate(Type, StreamingContext, ISurrogateSelector)

Exceptions

SecurityExceptionThe caller does not have the required permission.

See Also