Permalink
Browse files

Move some MOBILE bits under DISABLE_REMOTING as a remoting enabled ru…

…ntime will need them for

basic functionality.
  • Loading branch information...
kumpera committed Mar 7, 2013
1 parent e46ddbb commit 861811b3fb77da8f6ee2484139536cd2c09162ec
@@ -107,7 +107,7 @@ static RemotingServices ()
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static MethodBase GetVirtualMethod (Type type, MethodBase method);
-#if MOBILE
+#if DISABLE_REMOTING
public static bool IsTransparentProxy (object proxy)
{
throw new NotSupportedException ();
@@ -282,7 +282,7 @@ public static object CreateInstance (Type type, object [] args, object [] activa
CheckAbstractType (type);
if (activationAttributes != null && activationAttributes.Length > 0) {
-#if MOBILE
+#if DISABLE_REMOTING
throw new NotSupportedException ("Activation attributes are not supported");
#else
if (!type.IsMarshalByRef) {
@@ -74,7 +74,7 @@ public Delegate DeserializeDelegate (SerializationInfo info)
Type dt = dasm.GetType (type);
Delegate del;
if (realTarget != null) {
-#if !MOBILE
+#if !DISABLE_REMOTING
if (RemotingServices.IsTransparentProxy (realTarget)) {
// The call to IsInstanceOfType will force the proxy
// to load the real type of the remote object. This is
@@ -42,7 +42,7 @@ namespace System
public abstract class MarshalByRefObject
{
[NonSerialized]
-#if MOBILE
+#if DISABLE_REMOTING
private object _identity; //Keep layout equal to avoid runtime issues
#else
private ServerIdentity _identity; // Holds marshalling iformation of the object
@@ -52,7 +52,7 @@ protected MarshalByRefObject ()
{
}
-#if MOBILE
+#if DISABLE_REMOTING
internal ServerIdentity ObjectIdentity {
get { throw new NotSupportedException (); }
set { throw new NotSupportedException (); }
@@ -84,7 +84,7 @@ internal Identity GetObjectIdentity (MarshalByRefObject obj, out bool IsClient)
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
public virtual ObjRef CreateObjRef (Type requestedType)
{
-#if MOBILE
+#if DISABLE_REMOTING
throw new NotSupportedException ();
#else
// This method can only be called when this object has been marshalled
@@ -99,10 +99,9 @@ public virtual ObjRef CreateObjRef (Type requestedType)
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
public object GetLifetimeService ()
{
-#if MOBILE
+#if DISABLE_REMOTING
throw new NotSupportedException ();
#else
-
if (_identity == null)
return null;
else return _identity.Lease;
@@ -112,7 +111,7 @@ public object GetLifetimeService ()
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
public virtual object InitializeLifetimeService ()
{
-#if MOBILE
+#if DISABLE_REMOTING
throw new NotSupportedException ();
#else
if (_identity != null && _identity.Lease != null)
@@ -124,7 +123,7 @@ public virtual object InitializeLifetimeService ()
protected MarshalByRefObject MemberwiseClone (bool cloneIdentity)
{
-#if MOBILE
+#if DISABLE_REMOTING
throw new NotSupportedException ();
#else
MarshalByRefObject mbr = (MarshalByRefObject) MemberwiseClone ();

0 comments on commit 861811b

Please sign in to comment.