System.Runtime.Serialization.SerializationBinder Class

Assembly: Mscorlib.dll
Namespace: System.Runtime.Serialization
Summary
Allows users to control class loading and mandate what class to load.
C# Syntax:
[Serializable]
public abstract class SerializationBinder
Remarks
During serialization, a formatter transmits the information required to create an instance of an object of the correct type and version. This information generally includes the full type name and assembly name of the object. The assembly name includes the name, version, and strong name (see the conceptual topic at MSDN: strong-namedassemblies) hash of the assembly. By default, deserialization uses this information to create an instance of an identical object (with the exception of any assembly loading restricted by the security policy). Some users need to control which class to load, either because the class has moved between assemblies or a different version of the class is required on the server and client.

This is an abstract base class. All binders extend this class.



Notes to inheritors: When you inherit from SerializationBinder, you must override the following member: SerializationBinder.BindToType.
See also:
System.Runtime.Serialization Namespace | StrongName

System.Runtime.Serialization.SerializationBinder Member List:

Public Methods
BindToType When overridden in a derived class, controls the binding of a serialized object to a type.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Constructors
ctor #1 Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Runtime.Serialization.SerializationBinder Member Details

ctor #1
Summary:
Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
protected SerializationBinder();

Return to top


Method: BindToType(
   string assemblyName,
   string typeName
)
Summary
When overridden in a derived class, controls the binding of a serialized object to a type.
C# Syntax:
public abstract Type BindToType(
   string assemblyName,
   string typeName
);
Parameters:

assemblyName

Specifies the Assembly name of the serialized object.

typeName

Specifies the Type name of the serialized object.

Return Value:
The type of the object the formatter creates a new instance of.
Remarks


Notes to inheritors: You must implement the current method in a derived class.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~SerializationBinder();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.