System.Runtime.Remoting.Messaging.RemotingSurrogateSelector Class

Assembly: Mscorlib.dll
Namespace: System.Runtime.Remoting.Messaging
Summary
Selects the remoting surrogate that can be used to serialize an object that derives from a MarshalByRefObject.
C# Syntax:
public class RemotingSurrogateSelector : ISurrogateSelector
Remarks
A surrogate is an object that can handle the serialization requirements of an object. Remoting surrogates handle remoting serialization requirements of objects that derive from MarshalByRefObject. The RemotingSurrogateSelector manages registered surrogates for use by the BinaryFormatter and SoapFormatter.

During serialization for remoting purposes of a MarshalByRefObject, the remoting surrogate creates an ObjRef that contains all the relevant information required to activate and communicate with the remote object. The newly created ObjRef can then be sent to a remote location and used to create a proxy.

See also:
System.Runtime.Remoting.Messaging Namespace | ObjRef | BinaryFormatter | SoapFormatter

System.Runtime.Remoting.Messaging.RemotingSurrogateSelector Member List:

Public Constructors
ctor #1 Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Initializes a new instance of the RemotingSurrogateSelector class.
Public Properties
Filter Read-write

Gets or sets the MessageSurrogateFilter delegate for the current instance of the RemotingSurrogateSelector.
Public Methods
ChainSelector Adds the specified ISurrogateSelector to the surrogate selector chain.
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.
GetNextSelector Returns the next ISurrogateSelector in the chain of surrogate selectors.
GetRootObject Returns the object at the root of the object graph.
GetSurrogate Returns the appropriate surrogate for the given type in the given context.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
SetRootObject Sets the object at the root of the object graph.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
UseSoapFormat
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.Remoting.Messaging.RemotingSurrogateSelector Member Details

ctor #1
Summary
Initializes a new instance of the RemotingSurrogateSelector class.

Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
public RemotingSurrogateSelector();

Return to top


Property: Filter (read-write)
Summary
Gets or sets the MessageSurrogateFilter delegate for the current instance of the RemotingSurrogateSelector.
C# Syntax:
public MessageSurrogateFilter Filter {get; set;}

Return to top


Method: ChainSelector(
   ISurrogateSelector selector
)
Summary
Adds the specified ISurrogateSelector to the surrogate selector chain.
C# Syntax:
public virtual void ChainSelector(
   ISurrogateSelector selector
);
Parameters:

selector

The next ISurrogateSelector to examine.

Implements:
ISurrogateSelector.ChainSelector
Remarks
Remoting surrogates are arranged in chains that are attached to an instance of the RemotingSurrogateSelector. Each chain contains the remoting surrogates that the surrogate selector checks to find a compatible surrogate for a given object type. The current method adds a new remoting surrogate selector to the surrogate chain that is examined for compatible surrogates.

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:
~RemotingSurrogateSelector();

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: GetNextSelector()
Summary
Returns the next ISurrogateSelector in the chain of surrogate selectors.
C# Syntax:
public virtual ISurrogateSelector GetNextSelector();
Return Value:
The next ISurrogateSelector in the chain of surrogate selectors.
Implements:
ISurrogateSelector.GetNextSelector

Return to top


Method: GetRootObject()
Summary
Returns the object at the root of the object graph.
C# Syntax:
public object GetRootObject();
Return Value:
The object at the root of the object graph.

Return to top


Method: GetSurrogate(
   Type type,
   StreamingContext context,
   out ISurrogateSelector ssout
)
Summary
Returns the appropriate surrogate for the given type in the given context.
C# Syntax:
public virtual ISerializationSurrogate GetSurrogate(
   Type type,
   StreamingContext context,
   out ISurrogateSelector ssout
);
Parameters:

type

The Type for which the surrogate is requested.

context

The source or destination of serialization.

ssout

When this method returns, contains an ISurrogateSelector that is appropriate for the specified object type. This parameter is passed uninitialized.

Return Value:
The appropriate surrogate for the given type in the given context.
Implements:
ISurrogateSelector.GetSurrogate
Remarks
A remoting surrogate handles the remoting serialization requirements of an object that derives from a MarshalByRefObject. During serialization of an object that derives from MarshalByRefObject to a remote location, the remoting surrogate creates an ObjRef that contains all the relevant information required to activate and communicate with the remote object. The newly created ObjRef can then be sent to a remote location and used to create a proxy.

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: SetRootObject(
   object obj
)
Summary
Sets the object at the root of the object graph.
C# Syntax:
public void SetRootObject(
   object obj
);
Parameters:

obj

The object at the root of the object graph.

Exceptions
Exception Type Condition
ArgumentNullException The obj parameter is null.

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


Method: UseSoapFormat()
Summary
Sets up the current surrogate selector to use the SOAP format.
C# Syntax:
public virtual void UseSoapFormat();
Remarks
The current method is used with the SOAP formatter sinks.

Return to top


Top of page

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