NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

SurrogateSelector.GetSurrogate

Gets the surrogate for a particular type.

[Visual Basic]
Overridable Public Function GetSurrogate( _
   ByVal type As Type, _
   ByVal context As StreamingContext, _
   ByRef selector As ISurrogateSelector _
) As ISerializationSurrogate
[C#]
public virtual ISerializationSurrogate GetSurrogate(
   Type type,
   StreamingContext context,
   ref ISurrogateSelector selector
);
[C++]
public: virtual ISerializationSurrogate* GetSurrogate(
   Type* type,
   StreamingContext context,
   ISurrogateSelector** selector
);
[JScript]
public function GetSurrogate(
   type : Type,
   context : StreamingContext,
   selector : ISurrogateSelector
) : ISerializationSurrogate;

Parameters

type
The type for which we need to fetch the surrogate.
context
The streaming context.
selector
The surrogate to use.

Exceptions

Exception Type Condition
ArgumentNullException The type parameter is a null reference (in Visual Basic Nothing).

Remarks

If this selector can't provide a surrogate, it checks with all of its children before returning a null reference (Nothing).

See Also

SurrogateSelector Class | SurrogateSelector Members | System.Runtime.Serialization Namespace