using System.Threading;
using System.Runtime.Remoting;
using System.Security.Permissions;
+using System.Runtime.InteropServices;
namespace System
{
[Serializable]
+ [ComVisible (true)]
+ [StructLayout (LayoutKind.Sequential)]
public abstract class MarshalByRefObject
{
[NonSerialized]
}
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
- public virtual ObjRef CreateObjRef (Type type)
+ public virtual ObjRef CreateObjRef (Type requestedType)
{
// This method can only be called when this object has been marshalled
if (_identity == null)
throw new RemotingException (Locale.GetText ("No remoting information was found for the object."));
- return _identity.CreateObjRef (type);
+ return _identity.CreateObjRef (requestedType);
}
+ // corcompare says it is "virtual final", so there is likely
+ // an internal interface in .NET.
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
- public virtual object GetLifetimeService ()
+ public object GetLifetimeService ()
{
if (_identity == null)
return null;
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
public virtual object InitializeLifetimeService ()
{
- return new System.Runtime.Remoting.Lifetime.Lease();
+ if (_identity != null && _identity.Lease != null)
+ return _identity.Lease;
+ else
+ return new System.Runtime.Remoting.Lifetime.Lease();
+ }
+
+ protected MarshalByRefObject MemberwiseClone (bool cloneIdentity)
+ {
+ MarshalByRefObject mbr = (MarshalByRefObject) MemberwiseClone ();
+ if (!cloneIdentity)
+ mbr._identity = null;
+ return mbr;
}
}
}