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.AddSurrogate

Adds a surrogate to the list of surrogates checked.

[Visual Basic]
Overridable Public Sub AddSurrogate( _
   ByVal type As Type, _
   ByVal context As StreamingContext, _
   ByVal surrogate As ISerializationSurrogate _
)
[C#]
public virtual void AddSurrogate(
   Type type,
   StreamingContext context,
   ISerializationSurrogate surrogate
);
[C++]
public: virtual void AddSurrogate(
   Type* type,
   StreamingContext context,
   ISerializationSurrogate* surrogate
);
[JScript]
public function AddSurrogate(
   type : Type,
   context : StreamingContext,
   surrogate : ISerializationSurrogate
);

Parameters

type
The type for which the surrogate is required
context
The context specific data.
surrogate
The surrogate to call.

Exceptions

Exception Type Condition
ArgumentNullException The type or surrogate parameter is a null reference (in Visual Basic Nothing).
ArgumentException A surrogate already exists for this type and context.

See Also

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