mscorlib(4.0.0.0) API with additions
ObjectHandle.cs
3 using System.Security;
4 
6 {
8  [ClassInterface(ClassInterfaceType.AutoDual)]
9  [ComVisible(true)]
11  {
12  private object WrappedObject;
13 
14  private ObjectHandle()
15  {
16  }
17 
20  public ObjectHandle(object o)
21  {
22  WrappedObject = o;
23  }
24 
27  public object Unwrap()
28  {
29  return WrappedObject;
30  }
31 
34  [SecurityCritical]
35  public override object InitializeLifetimeService()
36  {
37  MarshalByRefObject marshalByRefObject = WrappedObject as MarshalByRefObject;
38  if (marshalByRefObject != null)
39  {
40  object obj = marshalByRefObject.InitializeLifetimeService();
41  if (obj == null)
42  {
43  return null;
44  }
45  }
46  return (ILease)base.InitializeLifetimeService();
47  }
48  }
49 }
ObjectHandle(object o)
Initializes an instance of the T:System.Runtime.Remoting.ObjectHandle class, wrapping the given objec...
Definition: ObjectHandle.cs:20
Defines a lifetime lease object that is used by the remoting lifetime service.
Definition: ILease.cs:8
Definition: __Canon.cs:3
Defines the interface for unwrapping marshal-by-value objects from indirection.
Definition: IObjectHandle.cs:9
virtual object InitializeLifetimeService()
Obtains a lifetime service object to control the lifetime policy for this instance.
Wraps marshal-by-value object references, allowing them to be returned through an indirection.
Definition: ObjectHandle.cs:10
override object InitializeLifetimeService()
Initializes the lifetime lease of the wrapped object.
Definition: ObjectHandle.cs:35
ClassInterfaceType
Identifies the type of class interface that is generated for a class.
object Unwrap()
Returns the wrapped object.
Definition: ObjectHandle.cs:27
Enables access to objects across application domain boundaries in applications that support remoting.