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;
Exception Type | Condition |
---|---|
ArgumentNullException | The type parameter is a null reference (in Visual Basic Nothing). |
If this selector can't provide a surrogate, it checks with all of its children before returning a null reference (Nothing).
SurrogateSelector Class | SurrogateSelector Members | System.Runtime.Serialization Namespace