2 // System.Runtime.Remoting.ObjectHandle.cs
5 // Dietmar Maurer (dietmar@ximian.com)
6 // Gonzalo Paniagua (gonzalo@ximian.com)
7 // Jaime Anguiano Olarra (jaime@gnome.org)
9 // (C) Ximian, Inc. http://www.ximian.com
14 using System.Runtime.Serialization;
15 using System.Runtime.Remoting.Lifetime;
17 namespace System.Runtime.Remoting {
19 public class ObjectHandle : MarshalByRefObject, IObjectHandle {
20 private object _wrapped;
21 private object life_ctrl;
23 public ObjectHandle (object o)
29 public override object InitializeLifetimeService ()
31 life_ctrl = base.InitializeLifetimeService ();
32 ILease ilife_ctrl = life_ctrl as ILease;
34 if (ilife_ctrl != null)
36 // I can't see in the .NET docs if the lifetime counter
37 // must be initialized to the time the object is created
38 // or if a relativistic time is enough (as both differ in
39 // fact just in a constant. In the meantime I'll use 0.
41 ilife_ctrl.InitialLeaseTime = new TimeSpan ((long) 0);
46 public object Unwrap ()