Merge pull request #2962 from marek-safar/referencesource-submodule-move
[mono.git] / mcs / class / referencesource / System / compmod / system / componentmodel / TypeDescriptor.cs
index 22f7cdc5dec5a5dc5e5d9b78847c97d4f49fd2ee..c1e1c43b23199a3ba9b9cfc98f580dd81d3699bc 100644 (file)
@@ -365,7 +365,7 @@ namespace System.ComponentModel
             {
                 throw new ArgumentNullException("type");
             }
-#if !MOBILE
+#if !DISABLE_CAS_USE
             PermissionSet typeDescriptorPermission = new PermissionSet(PermissionState.None);
             typeDescriptorPermission.AddPermission(new TypeDescriptorPermission(TypeDescriptorPermissionFlags.RestrictedRegistrationAccess));
 
@@ -401,7 +401,7 @@ namespace System.ComponentModel
             {
                 throw new ArgumentNullException("instance");
             }
-#if !MOBILE
+#if !DISABLE_CAS_USE
             Type type = instance.GetType();
 
             PermissionSet typeDescriptorPermission = new PermissionSet(PermissionState.None);
@@ -475,13 +475,17 @@ namespace System.ComponentModel
                     // sense that they provide a public API while not necessarily being public themselves. As such,
                     // we need to allow instantiation of internal TypeDescriptionProviders. See the thread attached
                     // to VSWhidbey #500522 for a more detailed discussion.
+#if !DISABLE_CAS_USE
                     IntSecurity.FullReflection.Assert();
                     try {
+#endif
                         prov = (TypeDescriptionProvider)Activator.CreateInstance(providerType);
+#if !DISABLE_CAS_USE
                     }
                     finally {
                         CodeAccessPermission.RevertAssert();
                     }
+#endif
                     Trace("Providers : Default provider found : {0}", providerType.Name);
                     AddProvider(prov, type);
                     providerAdded = true;
@@ -3240,7 +3244,7 @@ namespace System.ComponentModel
             {
                 throw new ArgumentNullException("type");
             }
-#if !MOBILE
+#if !DISABLE_CAS_USE
             PermissionSet typeDescriptorPermission = new PermissionSet(PermissionState.None);
             typeDescriptorPermission.AddPermission(new TypeDescriptorPermission(TypeDescriptorPermissionFlags.RestrictedRegistrationAccess));
 
@@ -3275,7 +3279,7 @@ namespace System.ComponentModel
             {
                 throw new ArgumentNullException("instance");
             }
-#if !MOBILE
+#if !DISABLE_CAS_USE
             Type type = instance.GetType();
 
             PermissionSet typeDescriptorPermission = new PermissionSet(PermissionState.None);