SurrogateSelector.GetSurrogate-Methode

Gibt den Ersatz für einen bestimmten Typ zurück.

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

Syntax

'Declaration
Public Overridable Function GetSurrogate ( _
    type As Type, _
    context As StreamingContext, _
    <OutAttribute> ByRef selector As ISurrogateSelector _
) As ISerializationSurrogate
'Usage
Dim instance As SurrogateSelector
Dim type As Type
Dim context As StreamingContext
Dim selector As ISurrogateSelector
Dim returnValue As ISerializationSurrogate

returnValue = instance.GetSurrogate(type, context, selector)
public virtual ISerializationSurrogate GetSurrogate (
    Type type,
    StreamingContext context,
    out ISurrogateSelector selector
)
public:
virtual ISerializationSurrogate^ GetSurrogate (
    Type^ type, 
    StreamingContext context, 
    [OutAttribute] ISurrogateSelector^% selector
)
public ISerializationSurrogate GetSurrogate (
    Type type, 
    StreamingContext context, 
    /** @attribute OutAttribute() */ /** @ref */ ISurrogateSelector selector
)
JScript unterstützt die Übergabe von Werttypargumenten als Verweis nicht.

Parameter

  • type
    Der Type, für den der Ersatz angefordert wird.
  • context
    Der Streamingkontext.
  • selector
    Der zu verwendende Ersatz.

Rückgabewert

Der Ersatz für einen bestimmten Typ.

Ausnahmen

Ausnahmetyp Bedingung

ArgumentNullException

Der type-Parameter ist NULL (Nothing in Visual Basic).

SecurityException

Der Aufrufer verfügt nicht über die erforderliche Berechtigung.

Hinweise

Wenn der aktuelle Selektor keinen Ersatz bereitstellen kann, überprüft er alle untergeordneten Objekte, bevor er NULL (Nothing in Visual Basic) zurückgibt.

.NET Framework-Sicherheit

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

SurrogateSelector-Klasse
SurrogateSelector-Member
System.Runtime.Serialization-Namespace