| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // System.Runtime.Remoting.ObjectHandle.cs
- //
- // Authors:
- // Dietmar Maurer ([email protected])
- // Gonzalo Paniagua ([email protected])
- // Jaime Anguiano Olarra ([email protected])
- //
- // (C) Ximian, Inc. http://www.ximian.com
- //
- //
- using System;
- using System.Runtime.Serialization;
- using System.Runtime.Remoting.Lifetime;
- namespace System.Runtime.Remoting {
- public class ObjectHandle : MarshalByRefObject, IObjectHandle {
- private object _wrapped;
- private object life_ctrl;
-
- public ObjectHandle (object o)
- {
- _wrapped = o;
- }
- [MonoTODO]
- public override object InitializeLifetimeService ()
- {
- life_ctrl = base.InitializeLifetimeService ();
- ILease ilife_ctrl = life_ctrl as ILease;
-
- if (ilife_ctrl != null)
- // I can't see in the .NET docs if the lifetime counter
- // must be initialized to the time the object is created
- // or if a relativistic time is enough (as both differ in
- // fact just in a constant. In the meantime I'll use 0.
-
- ilife_ctrl.InitialLeaseTime = new TimeSpan ((long) 0);
-
- return ilife_ctrl;
- }
- public object Unwrap ()
- {
- return _wrapped;
- }
- }
- }
|