Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorRodrigo Kumpera <kumpera@gmail.com>2013-01-15 04:34:30 +0400
committerRodrigo Kumpera <kumpera@gmail.com>2013-02-12 01:03:28 +0400
commitb96d05dac32d311ceb42aacfd30977cdf94d2acc (patch)
tree61f4a68201a0f037ef949f2c8b5d3d7cc110887c /mcs
parent438e0d8b925ae1567eac4eee08e81585c0bdeb7a (diff)
Kill the MOONLIGHT define in corlib.
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs5
-rw-r--r--mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs5
-rw-r--r--mcs/class/corlib/Mono.Security.Cryptography/CryptoTools.cs5
-rw-r--r--mcs/class/corlib/Mono.Security.Cryptography/KeyPairPersistence.cs5
-rw-r--r--mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs4
-rw-r--r--mcs/class/corlib/Mono.Security.Cryptography/PKCS8.cs5
-rw-r--r--mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs47
-rw-r--r--mcs/class/corlib/Mono.Security.X509/X509Certificate.cs16
-rw-r--r--mcs/class/corlib/Mono.Security.X509/X509CertificateCollection.cs2
-rw-r--r--mcs/class/corlib/Mono.Security.X509/X509Extension.cs2
-rw-r--r--mcs/class/corlib/Mono.Security.X509/X509Extensions.cs2
-rw-r--r--mcs/class/corlib/Mono.Security/ASN1.cs3
-rw-r--r--mcs/class/corlib/Mono.Security/StrongName.cs2
-rw-r--r--mcs/class/corlib/System.Collections/IStructuralComparable.cs2
-rw-r--r--mcs/class/corlib/System.Collections/IStructuralEquatable.cs2
-rw-r--r--mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs24
-rw-r--r--mcs/class/corlib/System.Diagnostics/StackFrame.cs14
-rw-r--r--mcs/class/corlib/System.Globalization/Calendar.cs2
-rw-r--r--mcs/class/corlib/System.Globalization/CompareInfo.cs50
-rw-r--r--mcs/class/corlib/System.Globalization/CultureInfo.cs10
-rw-r--r--mcs/class/corlib/System.Globalization/CultureNotFoundException.cs2
-rw-r--r--mcs/class/corlib/System.Globalization/TimeSpanStyles.cs2
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs3
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs2
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileEnumerator.cs3
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs2
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs5
-rw-r--r--mcs/class/corlib/System.IO/Directory.cs15
-rw-r--r--mcs/class/corlib/System.IO/DirectoryInfo.cs11
-rw-r--r--mcs/class/corlib/System.IO/File.cs2
-rw-r--r--mcs/class/corlib/System.IO/FileInfo.cs5
-rw-r--r--mcs/class/corlib/System.IO/FileStream.cs31
-rw-r--r--mcs/class/corlib/System.IO/MonoIO.cs8
-rw-r--r--mcs/class/corlib/System.IO/Path.cs11
-rw-r--r--mcs/class/corlib/System.IO/Stream.cs2
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs9
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs2
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs6
-rw-r--r--mcs/class/corlib/System.Reflection/Assembly.cs30
-rw-r--r--mcs/class/corlib/System.Reflection/EventInfo.cs8
-rw-r--r--mcs/class/corlib/System.Reflection/MethodInfo.cs2
-rw-r--r--mcs/class/corlib/System.Reflection/Module.cs6
-rw-r--r--mcs/class/corlib/System.Reflection/MonoAssembly.cs23
-rw-r--r--mcs/class/corlib/System.Reflection/MonoModule.cs54
-rw-r--r--mcs/class/corlib/System.Reflection/ParameterInfo.cs2
-rw-r--r--mcs/class/corlib/System.Resources/ResourceManager.cs2
-rw-r--r--mcs/class/corlib/System.Resources/ResourceSet.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/ConditionalWeakTable.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/ContractHelper.cs24
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/ReferenceAssemblyAttribute.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/TypeForwardedFromAttribute.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs17
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs4
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs7
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/ConstructionCall.cs5
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Proxies/ProxyAttribute.cs4
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs6
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs10
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryCommon.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs4
-rw-r--r--mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesAttribute.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesOptions.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Versioning/TargetFrameworkAttribute.cs2
-rw-r--r--mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs7
-rw-r--r--mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs23
-rw-r--r--mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs2
-rw-r--r--mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs2
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs2
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/CryptoConfig_2_1.cs36
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs5
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs4
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs4
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs4
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs4
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs5
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs4
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs4
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs2
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs5
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs2
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/Rijndael.cs70
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs5
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs4
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs3
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA384.cs56
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs5
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA512.cs56
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs5
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs7
-rw-r--r--mcs/class/corlib/System.Security.Permissions/PublisherIdentityPermissionAttribute.cs5
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SecurityAction.cs8
-rw-r--r--mcs/class/corlib/System.Security.Policy/Evidence.cs3
-rw-r--r--mcs/class/corlib/System.Security.Policy/Hash.cs5
-rw-r--r--mcs/class/corlib/System.Security.Policy/HashMembershipCondition.cs5
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyLevel.cs5
-rw-r--r--mcs/class/corlib/System.Security.Policy/Zone.cs5
-rw-r--r--mcs/class/corlib/System.Security.Policy/ZoneMembershipCondition.cs5
-rw-r--r--mcs/class/corlib/System.Security/IPermission.cs4
-rw-r--r--mcs/class/corlib/System.Security/SecurityFrame.cs2
-rw-r--r--mcs/class/corlib/System.Security/SecurityManager.cs2
-rw-r--r--mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs2
-rw-r--r--mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs2
-rw-r--r--mcs/class/corlib/System.Text/Encoding.cs27
-rw-r--r--mcs/class/corlib/System.Text/StringBuilder.cs14
-rw-r--r--mcs/class/corlib/System.Threading/ExecutionContext.cs10
-rw-r--r--mcs/class/corlib/System.Threading/LazyThreadSafetyMode.cs2
-rw-r--r--mcs/class/corlib/System.Threading/Monitor.cs2
-rw-r--r--mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs2
-rw-r--r--mcs/class/corlib/System.Threading/Thread.cs61
-rw-r--r--mcs/class/corlib/System.Threading/ThreadPool.cs17
-rw-r--r--mcs/class/corlib/System.Threading/Timer.cs8
-rw-r--r--mcs/class/corlib/System.Threading/WaitHandle.cs6
-rw-r--r--mcs/class/corlib/System/Action.cs9
-rw-r--r--mcs/class/corlib/System/Activator.cs9
-rw-r--r--mcs/class/corlib/System/AppDomain.cs47
-rw-r--r--mcs/class/corlib/System/AppDomainSetup.cs23
-rw-r--r--mcs/class/corlib/System/Array.cs4
-rw-r--r--mcs/class/corlib/System/Console.cs4
-rw-r--r--mcs/class/corlib/System/ContextStaticAttribute.cs3
-rw-r--r--mcs/class/corlib/System/Enum.cs4
-rw-r--r--mcs/class/corlib/System/Environment.cs6
-rw-r--r--mcs/class/corlib/System/Exception.cs4
-rw-r--r--mcs/class/corlib/System/ExecutionEngineException.cs2
-rw-r--r--mcs/class/corlib/System/Funcs.cs16
-rw-r--r--mcs/class/corlib/System/GC.cs2
-rw-r--r--mcs/class/corlib/System/Guid.cs6
-rw-r--r--mcs/class/corlib/System/InvalidTimeZoneException.cs2
-rw-r--r--mcs/class/corlib/System/Lazy.cs2
-rw-r--r--mcs/class/corlib/System/STAThreadAttribute.cs3
-rw-r--r--mcs/class/corlib/System/String.cs10
-rw-r--r--mcs/class/corlib/System/TimeSpan.cs32
-rw-r--r--mcs/class/corlib/System/TimeZoneNotFoundException.cs2
-rw-r--r--mcs/class/corlib/System/Tuple.cs2
-rw-r--r--mcs/class/corlib/System/Tuples.cs2
-rw-r--r--mcs/class/corlib/System/TypeAccessException.cs2
-rw-r--r--mcs/class/corlib/System/Version.cs2
-rw-r--r--mcs/class/corlib/System/_AppDomain.cs14
-rw-r--r--mcs/class/corlib/Test/System.Text/StringBuilderTest.cs2
140 files changed, 244 insertions, 1054 deletions
diff --git a/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs b/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs
index c766628f6fc..bee47e7b045 100644
--- a/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs
+++ b/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System;
using System.IO;
using System.Security.Cryptography;
@@ -281,6 +279,3 @@ namespace Mono.Security.Authenticode {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs b/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
index 647fd419659..a92affc4e54 100644
--- a/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
+++ b/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System;
using System.IO;
using System.Runtime.InteropServices;
@@ -456,6 +454,3 @@ namespace Mono.Security.Authenticode {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/Mono.Security.Cryptography/CryptoTools.cs b/mcs/class/corlib/Mono.Security.Cryptography/CryptoTools.cs
index e88c21cf74a..a528714f861 100644
--- a/mcs/class/corlib/Mono.Security.Cryptography/CryptoTools.cs
+++ b/mcs/class/corlib/Mono.Security.Cryptography/CryptoTools.cs
@@ -48,13 +48,8 @@ namespace Mono.Security.Cryptography {
static RandomNumberGenerator Rng {
get {
-#if MOONLIGHT
- if (rng == null)
- rng = new RNGCryptoServiceProvider ();
-#else
if (rng == null)
rng = RandomNumberGenerator.Create ();
-#endif
return rng;
}
}
diff --git a/mcs/class/corlib/Mono.Security.Cryptography/KeyPairPersistence.cs b/mcs/class/corlib/Mono.Security.Cryptography/KeyPairPersistence.cs
index c118cc3785c..0615770aaf5 100644
--- a/mcs/class/corlib/Mono.Security.Cryptography/KeyPairPersistence.cs
+++ b/mcs/class/corlib/Mono.Security.Cryptography/KeyPairPersistence.cs
@@ -26,8 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System;
using System.Globalization;
using System.IO;
@@ -454,6 +452,3 @@ namespace Mono.Security.Cryptography {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs b/mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs
index ca979eec32c..3b3252db949 100644
--- a/mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs
+++ b/mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs
@@ -68,10 +68,8 @@ namespace Mono.Security.Cryptography {
private static byte[] emptySHA1 = { 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90, 0xaf, 0xd8, 0x07, 0x09 };
private static byte[] emptySHA256 = { 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55 };
-#if !MOONLIGHT
private static byte[] emptySHA384 = { 0x38, 0xb0, 0x60, 0xa7, 0x51, 0xac, 0x96, 0x38, 0x4c, 0xd9, 0x32, 0x7e, 0xb1, 0xb1, 0xe3, 0x6a, 0x21, 0xfd, 0xb7, 0x11, 0x14, 0xbe, 0x07, 0x43, 0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda, 0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb, 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b };
private static byte[] emptySHA512 = { 0xcf, 0x83, 0xe1, 0x35, 0x7e, 0xef, 0xb8, 0xbd, 0xf1, 0x54, 0x28, 0x50, 0xd6, 0x6d, 0x80, 0x07, 0xd6, 0x20, 0xe4, 0x05, 0x0b, 0x57, 0x15, 0xdc, 0x83, 0xf4, 0xa9, 0x21, 0xd3, 0x6c, 0xe9, 0xce, 0x47, 0xd0, 0xd1, 0x3c, 0x5d, 0x85, 0xf2, 0xb0, 0xff, 0x83, 0x18, 0xd2, 0x87, 0x7e, 0xec, 0x2f, 0x63, 0xb9, 0x31, 0xbd, 0x47, 0x41, 0x7a, 0x81, 0xa5, 0x38, 0x32, 0x7a, 0xf9, 0x27, 0xda, 0x3e };
-#endif
private static byte[] GetEmptyHash (HashAlgorithm hash)
{
@@ -79,12 +77,10 @@ namespace Mono.Security.Cryptography {
return emptySHA1;
else if (hash is SHA256)
return emptySHA256;
-#if !MOONLIGHT
else if (hash is SHA384)
return emptySHA384;
else if (hash is SHA512)
return emptySHA512;
-#endif
else
return hash.ComputeHash ((byte[])null);
}
diff --git a/mcs/class/corlib/Mono.Security.Cryptography/PKCS8.cs b/mcs/class/corlib/Mono.Security.Cryptography/PKCS8.cs
index 84b830f2458..d26b85c9c75 100644
--- a/mcs/class/corlib/Mono.Security.Cryptography/PKCS8.cs
+++ b/mcs/class/corlib/Mono.Security.Cryptography/PKCS8.cs
@@ -272,10 +272,6 @@ namespace Mono.Security.Cryptography {
param.InverseQ = Normalize (privateKey [8].Value, keysize2);
param.P = Normalize (privateKey [4].Value, keysize2);
param.Q = Normalize (privateKey [5].Value, keysize2);
-#if MOONLIGHT
- RSA rsa = RSA.Create ();
- rsa.ImportParameters (param);
-#else
RSA rsa = null;
try {
rsa = RSA.Create ();
@@ -290,7 +286,6 @@ namespace Mono.Security.Cryptography {
rsa = new RSACryptoServiceProvider (csp);
rsa.ImportParameters (param);
}
-#endif
return rsa;
}
diff --git a/mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs b/mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs
index d82701c5c52..221f0fb695d 100644
--- a/mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs
+++ b/mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs
@@ -51,10 +51,8 @@ namespace Mono.Security.Cryptography {
private byte[] workBuff;
private byte[] workout;
protected PaddingMode padmode;
-#if !MOONLIGHT
// Silverlight 2.0 does not support any feedback mode
protected int FeedBackByte;
-#endif
private bool m_disposed = false;
protected bool lastBlock;
@@ -80,9 +78,7 @@ namespace Mono.Security.Cryptography {
temp = new byte [BlockSizeByte];
Buffer.BlockCopy (rgbIV, 0, temp, 0, System.Math.Min (BlockSizeByte, rgbIV.Length));
temp2 = new byte [BlockSizeByte];
-#if !MOONLIGHT
FeedBackByte = (algo.FeedbackSize >> 3);
-#endif
// transform buffers
workBuff = new byte [BlockSizeByte];
workout = new byte [BlockSizeByte];
@@ -135,10 +131,6 @@ namespace Mono.Security.Cryptography {
// i.e. Any padding must be done before calling this method
protected virtual void Transform (byte[] input, byte[] output)
{
-#if MOONLIGHT
- // Silverlight 2.0 only supports CBC
- CBC (input, output);
-#else
switch (algo.Mode) {
case CipherMode.ECB:
ECB (input, output);
@@ -158,7 +150,6 @@ namespace Mono.Security.Cryptography {
default:
throw new NotImplementedException ("Unkown CipherMode" + algo.Mode.ToString ());
}
-#endif
}
// Electronic Code Book (ECB)
@@ -182,7 +173,6 @@ namespace Mono.Security.Cryptography {
}
}
-#if !MOONLIGHT
// Cipher-FeedBack (CFB)
// this is how *CryptoServiceProvider implements CFB
// only AesCryptoServiceProvider support CFB > 8
@@ -224,7 +214,6 @@ namespace Mono.Security.Cryptography {
{
throw new CryptographicException ("CTS isn't supported by the framework");
}
-#endif
private void CheckInput (byte[] inputBuffer, int inputOffset, int inputCount)
{
@@ -253,14 +242,9 @@ namespace Mono.Security.Cryptography {
// ordered to avoid possible integer overflow
int len = outputBuffer.Length - inputCount - outputOffset;
-#if MOONLIGHT
- // only PKCS7 is supported Silverlight 2.0
- if (KeepLastBlock) {
-#else
if (!encrypt && (0 > len) && ((padmode == PaddingMode.None) || (padmode == PaddingMode.Zeros))) {
throw new CryptographicException ("outputBuffer", Locale.GetText ("Overflow"));
} else if (KeepLastBlock) {
-#endif
if (0 > len + BlockSizeByte) {
throw new CryptographicException ("outputBuffer", Locale.GetText ("Overflow"));
}
@@ -278,12 +262,7 @@ namespace Mono.Security.Cryptography {
private bool KeepLastBlock {
get {
-#if MOONLIGHT
- // only PKCS7 is supported Silverlight 2.0
- return !encrypt;
-#else
return ((!encrypt) && (padmode != PaddingMode.None) && (padmode != PaddingMode.Zeros));
-#endif
}
}
@@ -333,7 +312,6 @@ namespace Mono.Security.Cryptography {
return total;
}
-#if !MOONLIGHT
RandomNumberGenerator _rng;
private void Random (byte[] buffer, int start, int length)
@@ -355,7 +333,6 @@ namespace Mono.Security.Cryptography {
msg += String.Format (Locale.GetText (" Error found at position {0}."), position);
throw new CryptographicException (msg);
}
-#endif
protected virtual byte[] FinalEncrypt (byte[] inputBuffer, int inputOffset, int inputCount)
{
@@ -364,10 +341,6 @@ namespace Mono.Security.Cryptography {
int rem = inputCount - full;
int total = full;
-#if MOONLIGHT
- // only PKCS7 is supported Silverlight 2.0
- total += BlockSizeByte;
-#else
switch (padmode) {
case PaddingMode.ANSIX923:
case PaddingMode.ISO10126:
@@ -391,7 +364,6 @@ namespace Mono.Security.Cryptography {
}
break;
}
-#endif // NET_2_1
byte[] res = new byte [total];
int outputOffset = 0;
@@ -406,13 +378,6 @@ namespace Mono.Security.Cryptography {
// now we only have a single last block to encrypt
byte padding = (byte) (BlockSizeByte - rem);
-#if MOONLIGHT
- // only PKCS7 is supported Silverlight 2.0
- for (int i = res.Length; --i >= (res.Length - padding);)
- res [i] = padding;
- Buffer.BlockCopy (inputBuffer, inputOffset, res, full, rem);
- InternalTransformBlock (res, full, BlockSizeByte, res, full);
-#else
switch (padmode) {
case PaddingMode.ANSIX923:
// XX 00 00 00 00 00 00 07 (zero + padding length)
@@ -441,7 +406,6 @@ namespace Mono.Security.Cryptography {
InternalTransformBlock (inputBuffer, inputOffset, BlockSizeByte, res, outputOffset);
break;
}
-#endif // NET_2_1
return res;
}
@@ -471,16 +435,6 @@ namespace Mono.Security.Cryptography {
// total may be 0 (e.g. PaddingMode.None)
byte padding = ((total > 0) ? res [total - 1] : (byte) 0);
-#if MOONLIGHT
- // only PKCS7 is supported Silverlight 2.0
- if ((padding == 0) || (padding > BlockSizeByte))
- throw new CryptographicException (Locale.GetText ("Bad padding length."));
- for (int i = padding - 1; i > 0; i--) {
- if (res [total - 1 - i] != padding)
- throw new CryptographicException (Locale.GetText ("Bad padding at position {0}.", i));
- }
- total -= padding;
-#else
switch (padmode) {
case PaddingMode.ANSIX923:
if ((padding == 0) || (padding > BlockSizeByte))
@@ -509,7 +463,6 @@ namespace Mono.Security.Cryptography {
case PaddingMode.Zeros: // nothing to do - user must unpad himself
break;
}
-#endif // NET_2_1
// return output without padding
if (total > 0) {
diff --git a/mcs/class/corlib/Mono.Security.X509/X509Certificate.cs b/mcs/class/corlib/Mono.Security.X509/X509Certificate.cs
index af0c0a1f819..5131e99d525 100644
--- a/mcs/class/corlib/Mono.Security.X509/X509Certificate.cs
+++ b/mcs/class/corlib/Mono.Security.X509/X509Certificate.cs
@@ -44,7 +44,7 @@ namespace Mono.Security.X509 {
// b. ITU ASN.1 standards (free download)
// http://www.itu.int/ITU-T/studygroups/com17/languages/
-#if INSIDE_CORLIB && !MOONLIGHT
+#if INSIDE_CORLIB
internal class X509Certificate : ISerializable {
#else
public class X509Certificate : ISerializable {
@@ -265,12 +265,8 @@ namespace Mono.Security.X509 {
// BUG: MS BCL 1.0 can't import a key which
// isn't the same size as the one present in
// the container.
-#if MOONLIGHT
- _dsa = new DSAManaged (dsaParams.Y.Length << 3);
-#else
_dsa = (DSA) new DSACryptoServiceProvider (dsaParams.Y.Length << 3);
_dsa.ImportParameters (dsaParams);
-#endif
}
return _dsa;
}
@@ -365,12 +361,8 @@ namespace Mono.Security.X509 {
// isn't the same size as the one present in
// the container.
int keySize = (rsaParams.Modulus.Length << 3);
-#if MOONLIGHT
- _rsa = new RSAManaged (keySize);
-#else
_rsa = (RSA) new RSACryptoServiceProvider (keySize);
_rsa.ImportParameters (rsaParams);
-#endif
}
return _rsa;
}
@@ -542,14 +534,8 @@ namespace Mono.Security.X509 {
public bool CheckSignature (byte[] hash, string hashAlgorithm, byte[] signature)
{
-#if MOONLIGHT
- string hashName = GetHashNameFromOID (hashAlgorithm);
- HashAlgorithm algo = HashAlgorithm.Create (hashName);
- return PKCS1.Verify_v15 (RSA, algo, hash, signature);
-#else
RSACryptoServiceProvider r = (RSACryptoServiceProvider) RSA;
return r.VerifyHash (hash, hashAlgorithm, signature);
-#endif
}
public bool IsSelfSigned {
diff --git a/mcs/class/corlib/Mono.Security.X509/X509CertificateCollection.cs b/mcs/class/corlib/Mono.Security.X509/X509CertificateCollection.cs
index 0527a0771ae..1b7b8405dcc 100644
--- a/mcs/class/corlib/Mono.Security.X509/X509CertificateCollection.cs
+++ b/mcs/class/corlib/Mono.Security.X509/X509CertificateCollection.cs
@@ -36,7 +36,7 @@ using System.Collections;
namespace Mono.Security.X509 {
[Serializable]
-#if INSIDE_CORLIB && !MOONLIGHT
+#if INSIDE_CORLIB
internal
#else
public
diff --git a/mcs/class/corlib/Mono.Security.X509/X509Extension.cs b/mcs/class/corlib/Mono.Security.X509/X509Extension.cs
index ebccb11b5d3..637e74b48cd 100644
--- a/mcs/class/corlib/Mono.Security.X509/X509Extension.cs
+++ b/mcs/class/corlib/Mono.Security.X509/X509Extension.cs
@@ -41,7 +41,7 @@ namespace Mono.Security.X509 {
* extnValue OCTET STRING
* }
*/
-#if INSIDE_CORLIB && !MOONLIGHT
+#if INSIDE_CORLIB
internal
#else
public
diff --git a/mcs/class/corlib/Mono.Security.X509/X509Extensions.cs b/mcs/class/corlib/Mono.Security.X509/X509Extensions.cs
index d02d461486a..da2de3c0d09 100644
--- a/mcs/class/corlib/Mono.Security.X509/X509Extensions.cs
+++ b/mcs/class/corlib/Mono.Security.X509/X509Extensions.cs
@@ -42,7 +42,7 @@ namespace Mono.Security.X509 {
*
* Note: 1..MAX -> There shouldn't be 0 Extensions in the ASN1 structure
*/
-#if INSIDE_CORLIB && !MOONLIGHT
+#if INSIDE_CORLIB
internal
#else
public
diff --git a/mcs/class/corlib/Mono.Security/ASN1.cs b/mcs/class/corlib/Mono.Security/ASN1.cs
index 31352985355..2d656706764 100644
--- a/mcs/class/corlib/Mono.Security/ASN1.cs
+++ b/mcs/class/corlib/Mono.Security/ASN1.cs
@@ -39,8 +39,7 @@ namespace Mono.Security {
// References:
// a. ITU ASN.1 standards (free download)
// http://www.itu.int/ITU-T/studygroups/com17/languages/
-
-#if INSIDE_CORLIB && !MOONLIGHT
+#if INSIDE_CORLIB
internal
#else
public
diff --git a/mcs/class/corlib/Mono.Security/StrongName.cs b/mcs/class/corlib/Mono.Security/StrongName.cs
index 6fb7d88eedf..4c6aaeeb3f9 100644
--- a/mcs/class/corlib/Mono.Security/StrongName.cs
+++ b/mcs/class/corlib/Mono.Security/StrongName.cs
@@ -160,7 +160,7 @@ namespace Mono.Security {
get {
if (rsa == null)
return false;
-#if INSIDE_CORLIB && !MOONLIGHT
+#if INSIDE_CORLIB
// the easy way
if (RSA is RSACryptoServiceProvider) {
// available as internal for corlib
diff --git a/mcs/class/corlib/System.Collections/IStructuralComparable.cs b/mcs/class/corlib/System.Collections/IStructuralComparable.cs
index d78267b6682..363d443c0c1 100644
--- a/mcs/class/corlib/System.Collections/IStructuralComparable.cs
+++ b/mcs/class/corlib/System.Collections/IStructuralComparable.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if MOONLIGHT || NET_4_0 || MOBILE
+#if NET_4_0 || MOBILE
using System;
diff --git a/mcs/class/corlib/System.Collections/IStructuralEquatable.cs b/mcs/class/corlib/System.Collections/IStructuralEquatable.cs
index a824da3104a..cfed4861dc7 100644
--- a/mcs/class/corlib/System.Collections/IStructuralEquatable.cs
+++ b/mcs/class/corlib/System.Collections/IStructuralEquatable.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if MOONLIGHT || NET_4_0 || MOBILE
+#if NET_4_0 || MOBILE
using System;
diff --git a/mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs b/mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs
index 76134fe56d6..0e8ef2ae3cf 100644
--- a/mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs
+++ b/mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs
@@ -40,23 +40,6 @@ namespace System.Diagnostics.Contracts.Internal
#endif
public static class ContractHelper
{
-#if MOONLIGHT
- const string SystemWindowsBrowser = ", System.Windows.Browser, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e";
- const string HtmlPage = "System.Windows.Browser.HtmlPage" + SystemWindowsBrowser;
- const string HtmlWindow = "System.Windows.Browser.HtmlWindow" + SystemWindowsBrowser;
- static MethodInfo alert;
- static object window;
-
- static ContractHelper ()
- {
- Type htmlpage = Type.GetType (HtmlPage);
- MethodInfo get_window = htmlpage.GetMethod ("get_Window", BindingFlags.Static | BindingFlags.Public);
- window = get_window.Invoke (null, null);
- Type htmlwindow = Type.GetType (HtmlWindow);
- alert = htmlwindow.GetMethod ("Alert", BindingFlags.Instance | BindingFlags.Public);
- }
-#endif
-
[ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
[DebuggerNonUserCode]
public static string RaiseContractFailedEvent (ContractFailureKind failureKind, string userMessage, string conditionText, Exception innerException)
@@ -141,12 +124,6 @@ namespace System.Diagnostics.Contracts.Internal
if (displayMessage != null) {
msg.Append (displayMessage);
}
-#if MOONLIGHT
- // Silverlight shows a dialog that let you Abort (kill process/browser), Retry or Ignore
- // Moonlight will simply warn and ignore (at least until FailFast is implemented)
- // using reflection into System.Windows.Browser to popup an browser alert
- alert.Invoke (window, new object [] { msg.ToString () });
-#else
if (Environment.UserInteractive) {
// FIXME: This should trigger an assertion.
// But code will never get here at the moment, as Environment.UserInteractive currently
@@ -156,7 +133,6 @@ namespace System.Diagnostics.Contracts.Internal
// Note that FailFast() currently throws a NotImplementedException()
Environment.FailFast(msg.ToString()/*, new ExecutionEngineException()*/);
}
-#endif
}
}
diff --git a/mcs/class/corlib/System.Diagnostics/StackFrame.cs b/mcs/class/corlib/System.Diagnostics/StackFrame.cs
index 76186d42d93..37a6c559fb3 100644
--- a/mcs/class/corlib/System.Diagnostics/StackFrame.cs
+++ b/mcs/class/corlib/System.Diagnostics/StackFrame.cs
@@ -141,26 +141,12 @@ namespace System.Diagnostics {
string filename = "<filename unknown>";
if (fileName == null)
return filename;
-#if !MOONLIGHT
try {
filename = GetFileName ();
}
catch (SecurityException) {
// CAS check failure
}
-#else
- // Silverlight always return <filename unknown> but that's not very useful for debugging
- // OTOH we do not want to share any details about the original file system (even if they
- // are likely available in the debugging symbols files) from the browser's plugin (but
- // compiling stuff from smcs is fine since it's outside the sandbox)
- try {
- if (SecurityManager.SecurityEnabled)
- filename = Path.GetFileName (fileName);
- }
- catch (ArgumentException) {
- // e.g. invalid chars in filename
- }
-#endif
return filename;
}
diff --git a/mcs/class/corlib/System.Globalization/Calendar.cs b/mcs/class/corlib/System.Globalization/Calendar.cs
index 9cbb0225b05..ac9300d3701 100644
--- a/mcs/class/corlib/System.Globalization/Calendar.cs
+++ b/mcs/class/corlib/System.Globalization/Calendar.cs
@@ -128,14 +128,12 @@ public abstract class Calendar : ICloneable
[NonSerialized]
bool m_isReadOnly;
-#if !MOONLIGHT
[System.Runtime.InteropServices.ComVisible(false)]
public virtual CalendarAlgorithmType AlgorithmType {
get {
return CalendarAlgorithmType.Unknown;
}
}
-#endif
[System.Runtime.InteropServices.ComVisible(false)]
public virtual DateTime MaxSupportedDateTime {
diff --git a/mcs/class/corlib/System.Globalization/CompareInfo.cs b/mcs/class/corlib/System.Globalization/CompareInfo.cs
index cb894d969f1..54f4eed37f7 100644
--- a/mcs/class/corlib/System.Globalization/CompareInfo.cs
+++ b/mcs/class/corlib/System.Globalization/CompareInfo.cs
@@ -42,7 +42,7 @@ namespace System.Globalization
{
[Serializable]
[StructLayout (LayoutKind.Sequential)]
-#if !MOONLIGHT
+
[ComVisible (true)]
public class CompareInfo : IDeserializationCallback {
@@ -100,12 +100,6 @@ namespace System.Globalization
CompareOptions options,
bool first);
-#else
- public class CompareInfo {
- internal static bool UseManagedCollation {
- get { return true; }
- }
-#endif
const CompareOptions ValidCompareOptions_NoStringSort =
CompareOptions.None | CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace |
CompareOptions.IgnoreSymbols | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth |
@@ -152,22 +146,17 @@ namespace System.Globalization
}
} else {
/*
-#if !MOONLIGHT
this.icu_name = ci.IcuName;
this.construct_compareinfo (icu_name);
-#endif
*/
}
}
/*
~CompareInfo ()
{
-#if !MOONLIGHT
free_internal_collator ();
-#endif
}
*/
-#if !MOONLIGHT
private int internal_compare_managed (string str1, int offset1,
int length1, string str2,
int offset2, int length2,
@@ -188,16 +177,7 @@ namespace System.Globalization
internal_compare (str1, offset1, length1,
str2, offset2, length2, options);
}
-#else
- private int internal_compare_switch (string str1, int offset1,
- int length1, string str2,
- int offset2, int length2,
- CompareOptions options)
- {
- return collator.Compare (str1, offset1, length1,
- str2, offset2, length2, options);
- }
-#endif
+
public virtual int Compare (string string1, string string2)
{
return Compare (string1, string2, CompareOptions.None);
@@ -413,7 +393,6 @@ namespace System.Globalization
case CompareOptions.OrdinalIgnoreCase:
throw new ArgumentException ("Now allowed CompareOptions.", "options");
}
-#if !MOONLIGHT
if (UseManagedCollation)
return collator.GetSortKey (source, options);
SortKey key=new SortKey (culture, source, options);
@@ -425,9 +404,6 @@ namespace System.Globalization
assign_sortkey (key, source, options);
return(key);
-#else
- return collator.GetSortKey (source, options);
-#endif
}
public virtual int IndexOf (string source, char value)
@@ -502,7 +478,6 @@ namespace System.Globalization
CompareOptions.None));
}
-#if !MOONLIGHT
private int internal_index_managed (string s, int sindex,
int count, char c, CompareOptions opt,
bool first)
@@ -524,16 +499,6 @@ namespace System.Globalization
internal_index_managed (s, sindex, count, c, opt, first) :
internal_index (s, sindex, count, c, opt, first);
}
-#else
- private int internal_index_switch (string s, int sindex,
- int count, char c, CompareOptions opt,
- bool first)
- {
- return first ?
- collator.IndexOf (s, c, sindex, count, opt) :
- collator.LastIndexOf (s, c, sindex, count, opt);
- }
-#endif
public virtual int IndexOf (string source, char value,
int startIndex, int count,
@@ -571,7 +536,6 @@ namespace System.Globalization
}
}
-#if !MOONLIGHT
private int internal_index_managed (string s1, int sindex,
int count, string s2, CompareOptions opt,
bool first)
@@ -593,16 +557,6 @@ namespace System.Globalization
internal_index_managed (s1, sindex, count, s2, opt, first) :
internal_index (s1, sindex, count, s2, opt, first);
}
-#else
- private int internal_index_switch (string s1, int sindex,
- int count, string s2, CompareOptions opt,
- bool first)
- {
- return first ?
- collator.IndexOf (s1, s2, sindex, count, opt) :
- collator.LastIndexOf (s1, s2, sindex, count, opt);
- }
-#endif
public virtual int IndexOf (string source, string value,
int startIndex, int count,
diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs
index 12ab18df50b..5ab1233cee0 100644
--- a/mcs/class/corlib/System.Globalization/CultureInfo.cs
+++ b/mcs/class/corlib/System.Globalization/CultureInfo.cs
@@ -237,12 +237,6 @@ namespace System.Globalization
public virtual string Name {
get {
-#if MOONLIGHT
- if (m_name == "zh-CHS")
- return "zh-Hans";
- if (m_name == "zh-CHT")
- return "zh-Hant";
-#endif
return(m_name);
}
}
@@ -372,7 +366,6 @@ namespace System.Globalization
return false;
}
-#if !MOONLIGHT
public static CultureInfo[] GetCultures(CultureTypes types)
{
bool neutral=((types & CultureTypes.NeutralCultures)!=0);
@@ -389,7 +382,6 @@ namespace System.Globalization
return infos;
}
-#endif
public override int GetHashCode ()
{
@@ -452,7 +444,7 @@ namespace System.Globalization
internal void CheckNeutral ()
{
-#if !MOONLIGHT && !NET_4_0
+#if !NET_4_0
if (IsNeutralCulture) {
throw new NotSupportedException ("Culture \"" + m_name + "\" is " +
"a neutral culture. It can not be used in formatting " +
diff --git a/mcs/class/corlib/System.Globalization/CultureNotFoundException.cs b/mcs/class/corlib/System.Globalization/CultureNotFoundException.cs
index bd1ed1448b4..0202203327c 100644
--- a/mcs/class/corlib/System.Globalization/CultureNotFoundException.cs
+++ b/mcs/class/corlib/System.Globalization/CultureNotFoundException.cs
@@ -26,7 +26,7 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System;
using System.Runtime.InteropServices;
diff --git a/mcs/class/corlib/System.Globalization/TimeSpanStyles.cs b/mcs/class/corlib/System.Globalization/TimeSpanStyles.cs
index 18b3c927106..07062f3b740 100644
--- a/mcs/class/corlib/System.Globalization/TimeSpanStyles.cs
+++ b/mcs/class/corlib/System.Globalization/TimeSpanStyles.cs
@@ -26,7 +26,7 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System;
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs
index deb570d6b5d..f1604f7ce2d 100644
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs
+++ b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs
@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
using System.Globalization;
using System.Reflection;
using System.Runtime.InteropServices;
@@ -192,5 +191,3 @@ namespace System.IO.IsolatedStorage {
#endif
}
}
-/* MOONLIGHT */
-#endif
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs
index 5d5e2332225..d2ec334b6cc 100644
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs
+++ b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs
@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
using System.Collections;
using System.Reflection;
using System.Runtime.InteropServices;
@@ -1098,4 +1097,3 @@ namespace System.IO.IsolatedStorage {
#endif
}
}
-#endif
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileEnumerator.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileEnumerator.cs
index 08457bff978..5d4c62f5583 100644
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileEnumerator.cs
+++ b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileEnumerator.cs
@@ -28,8 +28,6 @@
using System.Collections;
-#if !MOONLIGHT
-
namespace System.IO.IsolatedStorage {
internal class IsolatedStorageFileEnumerator : IEnumerator {
@@ -69,4 +67,3 @@ namespace System.IO.IsolatedStorage {
}
}
}
-#endif
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
index 0d35d6c2f95..5df57df1105 100644
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
+++ b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
@@ -257,4 +256,3 @@ namespace System.IO.IsolatedStorage {
}
}
}
-#endif
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs
index bde8468ccc8..455a22997d6 100644
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs
+++ b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs
@@ -41,10 +41,6 @@ namespace System.IO.IsolatedStorage {
None = 0,
User = 1,
-#if MOONLIGHT
- // Available in Silverlight
- Application = 32,
-#else
Domain = 2,
Assembly = 4,
@@ -53,6 +49,5 @@ namespace System.IO.IsolatedStorage {
Machine = 16,
Application = 32
-#endif
}
}
diff --git a/mcs/class/corlib/System.IO/Directory.cs b/mcs/class/corlib/System.IO/Directory.cs
index 6921a255e25..e0648f08ca4 100644
--- a/mcs/class/corlib/System.IO/Directory.cs
+++ b/mcs/class/corlib/System.IO/Directory.cs
@@ -44,10 +44,7 @@ using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Runtime.InteropServices;
-
-#if !MOONLIGHT
using System.Security.AccessControl;
-#endif
namespace System.IO
{
@@ -83,13 +80,11 @@ namespace System.IO
return CreateDirectoriesInternal (path);
}
-#if !MOONLIGHT
[MonoLimitation ("DirectorySecurity not implemented")]
public static DirectoryInfo CreateDirectory (string path, DirectorySecurity directorySecurity)
{
return(CreateDirectory (path));
}
-#endif
static DirectoryInfo CreateDirectoriesInternal (string path)
{
@@ -268,7 +263,6 @@ namespace System.IO
return GetFileSystemEntries (path, searchPattern, FileAttributes.Directory, FileAttributes.Directory);
}
-#if !MOONLIGHT
public static string [] GetDirectories (string path, string searchPattern, SearchOption searchOption)
{
if (searchOption == SearchOption.TopDirectoryOnly)
@@ -284,7 +278,6 @@ namespace System.IO
foreach (string dir in GetDirectories (path))
GetDirectoriesRecurse (dir, searchPattern, all);
}
-#endif
public static string GetDirectoryRoot (string path)
{
@@ -305,7 +298,6 @@ namespace System.IO
return GetFileSystemEntries (path, searchPattern, FileAttributes.Directory, 0);
}
-#if !MOONLIGHT
public static string[] GetFiles (string path, string searchPattern, SearchOption searchOption)
{
if (searchOption == SearchOption.TopDirectoryOnly)
@@ -321,7 +313,6 @@ namespace System.IO
foreach (string dir in GetDirectories (path))
GetFilesRecurse (dir, searchPattern, all);
}
-#endif
public static string [] GetFileSystemEntries (string path)
{
@@ -397,7 +388,6 @@ namespace System.IO
throw MonoIO.GetException (error);
}
-#if !MOONLIGHT
public static void SetAccessControl (string path, DirectorySecurity directorySecurity)
{
if (null == directorySecurity)
@@ -405,7 +395,6 @@ namespace System.IO
directorySecurity.PersistModifications (path);
}
-#endif
public static void SetCreationTime (string path, DateTime creationTime)
{
@@ -511,7 +500,7 @@ namespace System.IO
return result;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public static string[] GetFileSystemEntries (string path, string searchPattern, SearchOption searchOption)
{
// Take the simple way home:
@@ -648,7 +637,6 @@ namespace System.IO
#endif
-#if !MOONLIGHT
public static DirectorySecurity GetAccessControl (string path, AccessControlSections includeSections)
{
return new DirectorySecurity (path, includeSections);
@@ -662,6 +650,5 @@ namespace System.IO
AccessControlSections.Group |
AccessControlSections.Access);
}
-#endif
}
}
diff --git a/mcs/class/corlib/System.IO/DirectoryInfo.cs b/mcs/class/corlib/System.IO/DirectoryInfo.cs
index 84dab22851a..acfffac7c5a 100644
--- a/mcs/class/corlib/System.IO/DirectoryInfo.cs
+++ b/mcs/class/corlib/System.IO/DirectoryInfo.cs
@@ -37,9 +37,7 @@ using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security;
using System.Text;
-#if !MOONLIGHT
using System.Security.AccessControl;
-#endif
namespace System.IO {
@@ -50,11 +48,6 @@ namespace System.IO {
private string current;
private string parent;
-#if MOONLIGHT
- internal DirectoryInfo ()
- {
- }
-#endif
public DirectoryInfo (string path) : this (path, false)
{
}
@@ -272,7 +265,6 @@ namespace System.IO {
return OriginalPath;
}
-#if !MOONLIGHT
public DirectoryInfo[] GetDirectories (string searchPattern, SearchOption searchOption)
{
//NULL-check of searchPattern is done in Directory.GetDirectories
@@ -361,9 +353,8 @@ namespace System.IO {
{
Directory.SetAccessControl (FullPath, directorySecurity);
}
-#endif
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public IEnumerable<DirectoryInfo> EnumerateDirectories ()
{
diff --git a/mcs/class/corlib/System.IO/File.cs b/mcs/class/corlib/System.IO/File.cs
index 6781c451194..73c6b027961 100644
--- a/mcs/class/corlib/System.IO/File.cs
+++ b/mcs/class/corlib/System.IO/File.cs
@@ -616,7 +616,7 @@ namespace System.IO
throw new NotSupportedException (Locale.GetText ("File encryption isn't supported on any file system."));
}
-#if MOONLIGHT || NET_4_0 || MOBILE
+#if NET_4_0 || MOBILE
public static IEnumerable<string> ReadLines (string path)
{
return ReadLines (File.OpenText (path));
diff --git a/mcs/class/corlib/System.IO/FileInfo.cs b/mcs/class/corlib/System.IO/FileInfo.cs
index 9ace59e1688..0911f8152c4 100644
--- a/mcs/class/corlib/System.IO/FileInfo.cs
+++ b/mcs/class/corlib/System.IO/FileInfo.cs
@@ -49,11 +49,6 @@ namespace System.IO {
{
private bool exists;
-#if MOONLIGHT
- internal FileInfo ()
- {
- }
-#endif
public FileInfo (string fileName)
{
if (fileName == null)
diff --git a/mcs/class/corlib/System.IO/FileStream.cs b/mcs/class/corlib/System.IO/FileStream.cs
index 6bfe5e2ae02..808a93df9b3 100644
--- a/mcs/class/corlib/System.IO/FileStream.cs
+++ b/mcs/class/corlib/System.IO/FileStream.cs
@@ -104,13 +104,7 @@ namespace System.IO
this.access = access;
this.owner = ownsHandle;
this.async = isAsync;
-#if MOONLIGHT
- // default the browser to 'all' anonymous files and let other usage (like smcs) with 'normal'
- // (i.e. non-anonymous except for isolated storage) files and paths
- this.anonymous = SecurityManager.SecurityEnabled;
-#else
this.anonymous = false;
-#endif
if (canseek) {
buf_start = MonoIO.Seek (handle, 0, SeekOrigin.Current, out error);
if (error != MonoIOError.ERROR_SUCCESS) {
@@ -224,20 +218,10 @@ namespace System.IO
}
if (access < FileAccess.Read || access > FileAccess.ReadWrite) {
-#if MOONLIGHT
- if (anonymous)
- throw new IsolatedStorageException ("Enum value for FileAccess was out of legal range.");
- else
-#endif
throw new ArgumentOutOfRangeException ("access", "Enum value was out of legal range.");
}
if (share < FileShare.None || share > (FileShare.ReadWrite | FileShare.Delete)) {
-#if MOONLIGHT
- if (anonymous)
- throw new IsolatedStorageException ("Enum value for FileShare was out of legal range.");
- else
-#endif
throw new ArgumentOutOfRangeException ("share", "Enum value was out of legal range.");
}
@@ -279,12 +263,7 @@ namespace System.IO
// don't leak the path information for isolated storage
string msg = Locale.GetText ("Could not find a part of the path \"{0}\".");
string fname = (anonymous) ? dname : Path.GetFullPath (path);
-#if MOONLIGHT
- // don't use GetSecureFileName for the directory name
- throw new IsolatedStorageException (String.Format (msg, fname));
-#else
throw new DirectoryNotFoundException (String.Format (msg, fname));
-#endif
}
}
@@ -293,11 +272,7 @@ namespace System.IO
// don't leak the path information for isolated storage
string msg = Locale.GetText ("Could not find file \"{0}\".");
string fname = GetSecureFileName (path);
-#if MOONLIGHT
- throw new IsolatedStorageException (String.Format (msg, fname));
-#else
throw new FileNotFoundException (String.Format (msg, fname), fname);
-#endif
}
// IsolatedStorage needs to keep the Name property to the default "[Unknown]"
@@ -376,11 +351,7 @@ namespace System.IO
public string Name {
get {
-#if MOONLIGHT
- return SecurityManager.CheckElevatedPermissions () ? name : "[Unknown]";
-#else
return name;
-#endif
}
}
@@ -859,7 +830,7 @@ namespace System.IO
FlushBuffer ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public virtual void Flush (bool flushToDisk)
{
FlushBuffer ();
diff --git a/mcs/class/corlib/System.IO/MonoIO.cs b/mcs/class/corlib/System.IO/MonoIO.cs
index b62e1453665..24968f13de1 100644
--- a/mcs/class/corlib/System.IO/MonoIO.cs
+++ b/mcs/class/corlib/System.IO/MonoIO.cs
@@ -85,22 +85,14 @@ namespace System.IO
// FIXME: add more exception mappings here
case MonoIOError.ERROR_FILE_NOT_FOUND:
message = String.Format ("Could not find file \"{0}\"", path);
-#if MOONLIGHT
- return new IsolatedStorageException (message);
-#else
return new FileNotFoundException (message, path);
-#endif
case MonoIOError.ERROR_TOO_MANY_OPEN_FILES:
return new IOException ("Too many open files", unchecked((int)0x80070000) | (int)error);
case MonoIOError.ERROR_PATH_NOT_FOUND:
message = String.Format ("Could not find a part of the path \"{0}\"", path);
-#if MOONLIGHT
- return new IsolatedStorageException (message);
-#else
return new DirectoryNotFoundException (message);
-#endif
case MonoIOError.ERROR_ACCESS_DENIED:
message = String.Format ("Access to the path \"{0}\" is denied.", path);
diff --git a/mcs/class/corlib/System.IO/Path.cs b/mcs/class/corlib/System.IO/Path.cs
index 64d450a44d5..22cd8f688fc 100644
--- a/mcs/class/corlib/System.IO/Path.cs
+++ b/mcs/class/corlib/System.IO/Path.cs
@@ -741,7 +741,7 @@ namespace System.IO {
return String.Compare (subset, slast, path, slast, subset.Length - slast) == 0;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public
#else
internal
@@ -781,7 +781,7 @@ namespace System.IO {
return ret.ToString ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public
#else
internal
@@ -800,7 +800,7 @@ namespace System.IO {
return Combine (new string [] { path1, path2, path3 });
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public
#else
internal
@@ -840,11 +840,6 @@ namespace System.IO {
if (idx >= 0 && idx != 1)
throw new ArgumentException (parameterName);
}
-#if MOONLIGHT
- // On Moonlight (SL4+) there are some limitations in "Elevated Trust"
- if (SecurityManager.HasElevatedPermissions) {
- }
-#endif
}
}
}
diff --git a/mcs/class/corlib/System.IO/Stream.cs b/mcs/class/corlib/System.IO/Stream.cs
index 803220306ed..c886724454f 100644
--- a/mcs/class/corlib/System.IO/Stream.cs
+++ b/mcs/class/corlib/System.IO/Stream.cs
@@ -240,7 +240,7 @@ namespace System.IO
}
}
-#if MOONLIGHT || NET_4_0 || MOBILE
+#if NET_4_0 || MOBILE
public void CopyTo (Stream destination)
{
CopyTo (destination, 16*1024);
diff --git a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
index 0b0da05f27e..1e8d7130dbf 100644
--- a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
@@ -266,13 +266,6 @@ namespace System.Reflection.Emit
if ((access & COMPILER_ACCESS) != 0)
throw new NotImplementedException ("COMPILER_ACCESS is no longer supperted, use a newer mcs.");
-#if MOONLIGHT
- // only "Run" is supported by Silverlight
- // however SMCS requires more than this but runs outside the CoreCLR sandbox
- if (SecurityManager.SecurityEnabled && (access != AssemblyBuilderAccess.Run))
- throw new ArgumentException ("access");
-#endif
-
if (!Enum.IsDefined (typeof (AssemblyBuilderAccess), access))
throw new ArgumentException (string.Format (CultureInfo.InvariantCulture,
"Argument value {0} is not valid.", (int) access),
@@ -1075,7 +1068,7 @@ namespace System.Reflection.Emit
throw new NotImplementedException ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override Type GetType (string name, bool throwOnError, bool ignoreCase)
{
if (name == null)
diff --git a/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
index ef727b615de..1beb945a8d2 100644
--- a/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
@@ -673,7 +673,7 @@ namespace System.Reflection.Emit
throw new NotImplementedException ();
}
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
public override ParameterInfo ReturnParameter {
get { return base.ReturnParameter; }
}
diff --git a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
index 76524c6ab1d..316baa63d56 100644
--- a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
@@ -105,16 +105,12 @@ namespace System.Reflection.Emit {
}
if (emitSymbolInfo) {
-#if MOONLIGHT
- symbolWriter = new Mono.CompilerServices.SymbolWriter.SymbolWriterImpl (this);
-#else
Assembly asm = Assembly.LoadWithPartialName ("Mono.CompilerServices.SymbolWriter");
if (asm == null)
throw new TypeLoadException ("The assembly for default symbol writer cannot be loaded");
Type t = asm.GetType ("Mono.CompilerServices.SymbolWriter.SymbolWriterImpl", true);
symbolWriter = (ISymbolWriter) Activator.CreateInstance (t, new object[] { this });
-#endif
string fileName = fqname;
if (assemblyb.AssemblyDir != null)
fileName = Path.Combine (assemblyb.AssemblyDir, fileName);
@@ -826,7 +822,7 @@ namespace System.Reflection.Emit {
throw new NotImplementedException ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override Assembly Assembly {
get { return assemblyb; }
}
diff --git a/mcs/class/corlib/System.Reflection/Assembly.cs b/mcs/class/corlib/System.Reflection/Assembly.cs
index 9880aa7d330..1fc3baf285a 100644
--- a/mcs/class/corlib/System.Reflection/Assembly.cs
+++ b/mcs/class/corlib/System.Reflection/Assembly.cs
@@ -51,8 +51,6 @@ namespace System.Reflection {
[StructLayout (LayoutKind.Sequential)]
#if MOBILE
public partial class Assembly : ICustomAttributeProvider, _Assembly {
-#elif MOONLIGHT
- public abstract class Assembly : ICustomAttributeProvider, _Assembly {
#elif NET_4_0
public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
#else
@@ -77,7 +75,7 @@ namespace System.Reflection {
private bool fromByteArray;
private string assemblyName;
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
protected
#else
internal
@@ -152,7 +150,7 @@ namespace System.Reflection {
[MethodImplAttribute (MethodImplOptions.InternalCall)]
get;
}
-#if !MOONLIGHT
+
public virtual Evidence Evidence {
[SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
get { return UnprotectedGetEvidence (); }
@@ -178,7 +176,6 @@ namespace System.Reflection {
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern bool get_global_assembly_cache ();
-#endif
internal bool FromByteArray {
set { fromByteArray = value; }
}
@@ -302,12 +299,6 @@ namespace System.Reflection {
string location = Path.GetDirectoryName (Location);
string filename = Path.Combine (location, info.FileName);
-#if MOONLIGHT
- // we don't control the content of 'info.FileName' so we want to make sure we keep to ourselves
- filename = Path.GetFullPath (filename);
- if (!filename.StartsWith (location))
- throw new SecurityException ("non-rooted access to manifest resource");
-#endif
return new FileStream (filename, FileMode.Open, FileAccess.Read);
}
@@ -459,15 +450,6 @@ namespace System.Reflection {
// Try the assembly directory
string location = Path.GetDirectoryName (Location);
string fullName = Path.Combine (location, Path.Combine (culture.Name, aname.Name + ".dll"));
-#if MOONLIGHT
- // it's unlikely that culture.Name or aname.Name could contain stuff like ".." but...
- fullName = Path.GetFullPath (fullName);
- if (!fullName.StartsWith (location)) {
- if (throwOnError)
- throw new SecurityException ("non-rooted access to satellite assembly");
- return null;
- }
-#endif
if (!throwOnError && !File.Exists (fullName))
return null;
@@ -631,7 +613,7 @@ namespace System.Reflection {
[MonoTODO ("Not implemented")]
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
virtual
#endif
Module LoadModule (string moduleName, byte [] rawModule, byte [] rawSymbolStore)
@@ -686,7 +668,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
virtual
#endif
Object CreateInstance (String typeName, Boolean ignoreCase,
@@ -776,7 +758,7 @@ namespace System.Reflection {
[MonoTODO ("Currently it always returns zero")]
[ComVisible (false)]
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
virtual
#endif
long HostContext {
@@ -908,7 +890,7 @@ namespace System.Reflection {
#endif
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
static Exception CreateNIE ()
{
return new NotImplementedException ("Derived classes must implement it");
diff --git a/mcs/class/corlib/System.Reflection/EventInfo.cs b/mcs/class/corlib/System.Reflection/EventInfo.cs
index 17f6b85dddf..7eeba725530 100644
--- a/mcs/class/corlib/System.Reflection/EventInfo.cs
+++ b/mcs/class/corlib/System.Reflection/EventInfo.cs
@@ -43,7 +43,7 @@ namespace System.Reflection {
public abstract EventAttributes Attributes {get;}
public
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
virtual
#endif
Type EventHandlerType {
@@ -63,7 +63,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
virtual
#endif
bool IsMulticast {get {return true;}}
@@ -79,7 +79,7 @@ namespace System.Reflection {
[DebuggerHidden]
[DebuggerStepThrough]
public
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
virtual
#endif
void AddEventHandler (object target, Delegate handler)
@@ -137,7 +137,7 @@ namespace System.Reflection {
[DebuggerHidden]
[DebuggerStepThrough]
public
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
virtual
#endif
void RemoveEventHandler (object target, Delegate handler)
diff --git a/mcs/class/corlib/System.Reflection/MethodInfo.cs b/mcs/class/corlib/System.Reflection/MethodInfo.cs
index 06d5a2f8720..3829cf5e0e8 100644
--- a/mcs/class/corlib/System.Reflection/MethodInfo.cs
+++ b/mcs/class/corlib/System.Reflection/MethodInfo.cs
@@ -102,7 +102,7 @@ namespace System.Reflection {
return Type.EmptyTypes;
}
-#if !NET_4_0 && !MOONLIGHT
+#if !NET_4_0
public override bool IsGenericMethod {
get {
return false;
diff --git a/mcs/class/corlib/System.Reflection/Module.cs b/mcs/class/corlib/System.Reflection/Module.cs
index 8cb5b609fc0..4f2bbce8684 100644
--- a/mcs/class/corlib/System.Reflection/Module.cs
+++ b/mcs/class/corlib/System.Reflection/Module.cs
@@ -48,7 +48,7 @@ namespace System.Reflection {
[Serializable]
[ClassInterfaceAttribute (ClassInterfaceType.None)]
[StructLayout (LayoutKind.Sequential)]
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public abstract class Module : ISerializable, ICustomAttributeProvider, _Module {
#else
public partial class Module : ISerializable, ICustomAttributeProvider, _Module {
@@ -69,7 +69,7 @@ namespace System.Reflection {
const BindingFlags defaultBindingFlags =
BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
protected
#else
internal
@@ -315,7 +315,7 @@ namespace System.Reflection {
#endif
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public virtual Assembly Assembly {
get { throw CreateNIE (); }
diff --git a/mcs/class/corlib/System.Reflection/MonoAssembly.cs b/mcs/class/corlib/System.Reflection/MonoAssembly.cs
index b861da70e00..35848c67299 100644
--- a/mcs/class/corlib/System.Reflection/MonoAssembly.cs
+++ b/mcs/class/corlib/System.Reflection/MonoAssembly.cs
@@ -37,7 +37,7 @@ using System.Collections.Generic;
namespace System.Reflection {
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_Assembly))]
[Serializable]
@@ -47,7 +47,7 @@ namespace System.Reflection {
public partial class Assembly {
#endif
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Type GetType (string name, bool throwOnError, bool ignoreCase)
@@ -59,7 +59,7 @@ namespace System.Reflection {
throw new ArgumentException ("name", "Name cannot be empty");
res = InternalGetType (null, name, throwOnError, ignoreCase);
-#if !(NET_4_0 || MOONLIGHT || MOBILE) && !FULL_AOT_RUNTIME
+#if !(NET_4_0 || MOBILE) && !FULL_AOT_RUNTIME
if (res is TypeBuilder) {
if (throwOnError)
throw new TypeLoadException (string.Format ("Could not load type '{0}' from assembly '{1}'", name, this));
@@ -70,7 +70,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Module GetModule (String name)
@@ -90,7 +90,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
AssemblyName[] GetReferencedAssemblies () {
@@ -98,7 +98,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Module[] GetModules (bool getResourceModules) {
@@ -117,7 +117,7 @@ namespace System.Reflection {
[MonoTODO ("Always returns the same as GetModules")]
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Module[] GetLoadedModules (bool getResourceModules)
@@ -126,7 +126,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Assembly GetSatelliteAssembly (CultureInfo culture)
@@ -135,7 +135,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Assembly GetSatelliteAssembly (CultureInfo culture, Version version)
@@ -146,7 +146,7 @@ namespace System.Reflection {
//FIXME remove GetManifestModule under v4, it's a v2 artifact
[ComVisible (false)]
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Module ManifestModule {
@@ -155,7 +155,6 @@ namespace System.Reflection {
}
}
-#if !MOONLIGHT
public
#if NET_4_0
override
@@ -165,8 +164,6 @@ namespace System.Reflection {
return get_global_assembly_cache ();
}
}
-#endif
-
}
}
diff --git a/mcs/class/corlib/System.Reflection/MonoModule.cs b/mcs/class/corlib/System.Reflection/MonoModule.cs
index 97e3481c9c7..c963488027e 100644
--- a/mcs/class/corlib/System.Reflection/MonoModule.cs
+++ b/mcs/class/corlib/System.Reflection/MonoModule.cs
@@ -38,7 +38,7 @@ using System.Security.Permissions;
namespace System.Reflection {
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_Module))]
[Serializable]
@@ -49,7 +49,7 @@ namespace System.Reflection {
#endif
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Assembly Assembly {
@@ -57,7 +57,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
// Note: we do not ask for PathDiscovery because no path is returned here.
@@ -67,7 +67,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
string ScopeName {
@@ -75,7 +75,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
int MDStreamVersion {
@@ -87,7 +87,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Guid ModuleVersionId {
@@ -96,7 +96,7 @@ namespace System.Reflection {
}
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -113,7 +113,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
bool IsResource()
@@ -121,7 +121,7 @@ namespace System.Reflection {
return is_resource;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -136,7 +136,7 @@ namespace System.Reflection {
return filtered.ToArray ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -146,7 +146,7 @@ namespace System.Reflection {
return MonoCustomAttrs.GetCustomAttributes (this, inherit);
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -156,7 +156,7 @@ namespace System.Reflection {
return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -170,7 +170,7 @@ namespace System.Reflection {
return (globalType != null) ? globalType.GetField (name, bindingAttr) : null;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -184,7 +184,7 @@ namespace System.Reflection {
return (globalType != null) ? globalType.GetFields (bindingFlags) : new FieldInfo [0];
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -193,7 +193,7 @@ namespace System.Reflection {
get { return get_MetadataToken (this); }
}
protected
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#else
virtual
@@ -212,7 +212,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
MethodInfo[] GetMethods (BindingFlags bindingFlags) {
@@ -223,7 +223,7 @@ namespace System.Reflection {
return (globalType != null) ? globalType.GetMethods (bindingFlags) : new MethodInfo [0];
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -232,7 +232,7 @@ namespace System.Reflection {
ModuleHandle.GetPEKind (out peKind, out machine);
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -246,7 +246,7 @@ namespace System.Reflection {
return assembly.InternalGetType (this, className, throwOnError, ignoreCase);
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -257,7 +257,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
FieldInfo ResolveField (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
@@ -271,7 +271,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
MemberInfo ResolveMember (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
@@ -286,7 +286,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
MethodBase ResolveMethod (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
@@ -300,7 +300,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
string ResolveString (int metadataToken) {
@@ -314,7 +314,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
Type ResolveType (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
@@ -328,7 +328,7 @@ namespace System.Reflection {
}
public
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
override
#endif
byte[] ResolveSignature (int metadataToken) {
@@ -358,7 +358,7 @@ namespace System.Reflection {
}
#endif
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override
#else
public virtual
@@ -368,7 +368,7 @@ namespace System.Reflection {
return InternalGetTypes ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
diff --git a/mcs/class/corlib/System.Reflection/ParameterInfo.cs b/mcs/class/corlib/System.Reflection/ParameterInfo.cs
index e072223b36e..eabb285ac3c 100644
--- a/mcs/class/corlib/System.Reflection/ParameterInfo.cs
+++ b/mcs/class/corlib/System.Reflection/ParameterInfo.cs
@@ -189,7 +189,7 @@ namespace System.Reflection
extern int GetMetadataToken ();
public
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
virtual
#endif
int MetadataToken {
diff --git a/mcs/class/corlib/System.Resources/ResourceManager.cs b/mcs/class/corlib/System.Resources/ResourceManager.cs
index 0f9fce9cf0f..cd321d2dd91 100644
--- a/mcs/class/corlib/System.Resources/ResourceManager.cs
+++ b/mcs/class/corlib/System.Resources/ResourceManager.cs
@@ -285,11 +285,9 @@ namespace System.Resources
private string GetResourceFilePath (CultureInfo culture)
{
-#if !MOONLIGHT
if (resourceDir != null)
return Path.Combine (resourceDir, GetResourceFileName (culture));
else
-#endif
return GetResourceFileName (culture);
}
diff --git a/mcs/class/corlib/System.Resources/ResourceSet.cs b/mcs/class/corlib/System.Resources/ResourceSet.cs
index 9729e6e733d..5c27fc51a8f 100644
--- a/mcs/class/corlib/System.Resources/ResourceSet.cs
+++ b/mcs/class/corlib/System.Resources/ResourceSet.cs
@@ -41,9 +41,7 @@ namespace System.Resources
[ComVisible (true)]
public class ResourceSet : IDisposable, IEnumerable
{
-#if !MOONLIGHT
[NonSerialized]
-#endif
protected IResourceReader Reader;
protected Hashtable Table;
bool resources_read;
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/ConditionalWeakTable.cs b/mcs/class/corlib/System.Runtime.CompilerServices/ConditionalWeakTable.cs
index 4abb40fb3a4..4c1fe8a383d 100644
--- a/mcs/class/corlib/System.Runtime.CompilerServices/ConditionalWeakTable.cs
+++ b/mcs/class/corlib/System.Runtime.CompilerServices/ConditionalWeakTable.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System;
using System.Collections;
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/ContractHelper.cs b/mcs/class/corlib/System.Runtime.CompilerServices/ContractHelper.cs
index 9ae600ca588..25ff7fdee7d 100644
--- a/mcs/class/corlib/System.Runtime.CompilerServices/ContractHelper.cs
+++ b/mcs/class/corlib/System.Runtime.CompilerServices/ContractHelper.cs
@@ -39,23 +39,6 @@ namespace System.Runtime.CompilerServices
{
public static class ContractHelper
{
-#if MOONLIGHT
- const string SystemWindowsBrowser = ", System.Windows.Browser, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e";
- const string HtmlPage = "System.Windows.Browser.HtmlPage" + SystemWindowsBrowser;
- const string HtmlWindow = "System.Windows.Browser.HtmlWindow" + SystemWindowsBrowser;
- static MethodInfo alert;
- static object window;
-
- static ContractHelper ()
- {
- Type htmlpage = Type.GetType (HtmlPage);
- MethodInfo get_window = htmlpage.GetMethod ("get_Window", BindingFlags.Static | BindingFlags.Public);
- window = get_window.Invoke (null, null);
- Type htmlwindow = Type.GetType (HtmlWindow);
- alert = htmlwindow.GetMethod ("Alert", BindingFlags.Instance | BindingFlags.Public);
- }
-#endif
-
[ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
[DebuggerNonUserCode]
public static string RaiseContractFailedEvent (ContractFailureKind failureKind, string userMessage, string conditionText, Exception innerException)
@@ -140,12 +123,6 @@ namespace System.Runtime.CompilerServices
if (displayMessage != null) {
msg.Append (displayMessage);
}
-#if MOONLIGHT
- // Silverlight shows a dialog that let you Abort (kill process/browser), Retry or Ignore
- // Moonlight will simply warn and ignore (at least until FailFast is implemented)
- // using reflection into System.Windows.Browser to popup an browser alert
- alert.Invoke (window, new object [] { msg.ToString () });
-#else
if (Environment.UserInteractive) {
// FIXME: This should trigger an assertion.
// But code will never get here at the moment, as Environment.UserInteractive currently
@@ -155,7 +132,6 @@ namespace System.Runtime.CompilerServices
// Note that FailFast() currently throws a NotImplementedException()
Environment.FailFast(msg.ToString()/*, new ExecutionEngineException()*/);
}
-#endif
}
}
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/ReferenceAssemblyAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/ReferenceAssemblyAttribute.cs
index 20ed7a89d19..d86b08be90e 100644
--- a/mcs/class/corlib/System.Runtime.CompilerServices/ReferenceAssemblyAttribute.cs
+++ b/mcs/class/corlib/System.Runtime.CompilerServices/ReferenceAssemblyAttribute.cs
@@ -25,7 +25,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System;
using System.Runtime.InteropServices;
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/TypeForwardedFromAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/TypeForwardedFromAttribute.cs
index 06121f74cf8..3e94a7fc680 100644
--- a/mcs/class/corlib/System.Runtime.CompilerServices/TypeForwardedFromAttribute.cs
+++ b/mcs/class/corlib/System.Runtime.CompilerServices/TypeForwardedFromAttribute.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
namespace System.Runtime.CompilerServices
{
diff --git a/mcs/class/corlib/System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs b/mcs/class/corlib/System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs
index 0132dcd2f37..e57d58f58bd 100644
--- a/mcs/class/corlib/System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs
+++ b/mcs/class/corlib/System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
namespace System.Runtime.ExceptionServices
{
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
index 4cfb7c2b5eb..241dbdab441 100644
--- a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
+++ b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
@@ -39,12 +39,10 @@ using System.Reflection;
using System.Threading;
using System.Runtime.ConstrainedExecution;
-#if !MOONLIGHT
#if !FULL_AOT_RUNTIME
using System.Runtime.InteropServices.ComTypes;
using Mono.Interop;
#endif
-#endif
namespace System.Runtime.InteropServices
{
@@ -189,7 +187,7 @@ namespace System.Runtime.InteropServices
throw new NotImplementedException ();
}
-#if !FULL_AOT_RUNTIME && !MOONLIGHT
+#if !FULL_AOT_RUNTIME
public static object CreateWrapperOfType (object o, Type t)
{
__ComObject co = o as __ComObject;
@@ -272,7 +270,7 @@ namespace System.Runtime.InteropServices
FreeHGlobal (s);
}
-#if !FULL_AOT_RUNTIME && !MOONLIGHT
+#if !FULL_AOT_RUNTIME
public static Guid GenerateGuidForType (Type type)
{
return type.GUID;
@@ -389,7 +387,7 @@ namespace System.Runtime.InteropServices
return m.GetHINSTANCE ();
}
-#endif // !MOONLIGHT
+#endif // !FULL_AOT_RUNTIME
#if !FULL_AOT_RUNTIME
[MonoTODO ("SetErrorInfo")]
@@ -404,7 +402,7 @@ namespace System.Runtime.InteropServices
{
throw new NotImplementedException ();
}
-#if !MOONLIGHT
+
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern static IntPtr GetIDispatchForObjectInternal (object o);
@@ -632,7 +630,6 @@ namespace System.Runtime.InteropServices
{
throw new NotImplementedException ();
}
-#endif // !NET_2_1
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -814,7 +811,6 @@ namespace System.Runtime.InteropServices
}
#if !FULL_AOT_RUNTIME
-#if !MOONLIGHT
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern static int ReleaseComObjectInternal (object co);
@@ -839,7 +835,6 @@ namespace System.Runtime.InteropServices
{
throw new NotSupportedException ("MSDN states user code should never need to call this method.");
}
-#endif // !NET_2_1
#endif
[ComVisible (true)]
@@ -904,7 +899,6 @@ namespace System.Runtime.InteropServices
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern static IntPtr StringToHGlobalUni (string s);
-#if !MOONLIGHT
public static IntPtr SecureStringToBSTR (SecureString s)
{
if (s == null)
@@ -992,7 +986,6 @@ namespace System.Runtime.InteropServices
throw new ArgumentNullException ("s");
return SecureStringToCoTaskMemUnicode (s);
}
-#endif
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
[ComVisible (true)]
@@ -1125,14 +1118,12 @@ namespace System.Runtime.InteropServices
}
#if !FULL_AOT_RUNTIME
-#if !MOONLIGHT
public static int FinalReleaseComObject (object o)
{
while (ReleaseComObject (o) != 0);
return 0;
}
#endif
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern Delegate GetDelegateForFunctionPointerInternal (IntPtr ptr, Type t);
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs
index ac0dc4145bf..2940358a587 100644
--- a/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs
+++ b/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs
@@ -49,11 +49,7 @@ namespace System.Runtime.InteropServices {
private UnmanagedType utype;
public UnmanagedType ArraySubType;
-#if !MOONLIGHT
public VarEnum SafeArraySubType;
-#else
- private int SafeArraySubType;
-#endif
public int SizeConst;
public int IidParameterIndex;
public short SizeParamIndex;
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs
index 89263113954..3756f1df9b0 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs
@@ -54,7 +54,7 @@ namespace System.Runtime.Remoting.Activation
return _constructionActivator;
}
}
-#if !MOONLIGHT
+
public static IMessage Activate (RemotingProxy proxy, ConstructionCall ctorCall)
{
IMessage response;
@@ -73,7 +73,7 @@ namespace System.Runtime.Remoting.Activation
return response;
}
-#endif
+
public static IMessage RemoteActivate (IConstructionCallMessage ctorCall)
{
try
@@ -182,7 +182,7 @@ namespace System.Runtime.Remoting.Activation
identity.AttachServerObject ((MarshalByRefObject) obj, Threading.Thread.CurrentContext);
ConstructionCall call = ctorCall as ConstructionCall;
-#if !MOONLIGHT
+
if (ctorCall.ActivationType.IsContextful && call != null && call.SourceProxy != null)
{
call.SourceProxy.AttachIdentity (identity);
@@ -190,7 +190,6 @@ namespace System.Runtime.Remoting.Activation
RemotingServices.InternalExecuteMessage (target, ctorCall);
}
else
-#endif
ctorCall.MethodBase.Invoke (obj, ctorCall.Args);
return new ConstructionResponse (obj, null, ctorCall);
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
index 2a8b2708d89..6fc10f6879e 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
@@ -353,7 +353,6 @@ namespace System.Runtime.Remoting.Contexts {
callback_object.DoCallBack (deleg);
}
-#if !MOONLIGHT
public static LocalDataStoreSlot AllocateDataSlot ()
{
return new LocalDataStoreSlot (false);
@@ -414,7 +413,6 @@ namespace System.Runtime.Remoting.Contexts {
ctx.datastore [slot.slot] = data;
}
}
-#endif
}
class DynamicPropertyCollection
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ConstructionCall.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ConstructionCall.cs
index 6bb0fd425aa..3e89772cd68 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ConstructionCall.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ConstructionCall.cs
@@ -49,9 +49,7 @@ namespace System.Runtime.Remoting.Messaging
Type _activationType;
string _activationTypeName;
bool _isContextOk;
-#if !MOONLIGHT
[NonSerialized] RemotingProxy _sourceProxy;
-#endif
public ConstructionCall (IMessage m): base (m)
{
@@ -157,12 +155,11 @@ namespace System.Runtime.Remoting.Messaging
{
get { return base.Properties; }
}
-#if !MOONLIGHT
+
internal RemotingProxy SourceProxy
{
get { return _sourceProxy; }
set {_sourceProxy = value; }
}
-#endif
}
}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/ProxyAttribute.cs b/mcs/class/corlib/System.Runtime.Remoting.Proxies/ProxyAttribute.cs
index 4bc4d567d20..c0a459e986a 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/ProxyAttribute.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/ProxyAttribute.cs
@@ -49,12 +49,8 @@ namespace System.Runtime.Remoting.Proxies {
public virtual MarshalByRefObject CreateInstance (Type serverType)
{
-#if MOONLIGHT
- throw new NotImplementedException ();
-#else
RemotingProxy proxy = new RemotingProxy (serverType, ChannelServices.CrossContextUrl, null);
return (MarshalByRefObject) proxy.GetTransparentProxy();
-#endif
}
public virtual RealProxy CreateProxy (ObjRef objRef, Type serverType, object serverObject, Context serverContext)
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
index fb0b4acb130..745c1613445 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
@@ -164,11 +164,7 @@ namespace System.Runtime.Remoting.Proxies
MonoMethodMessage mMsg = (MonoMethodMessage) msg;
mMsg.LogicalCallContext = CallContext.CreateLogicalCallContext (true);
CallType call_type = mMsg.CallType;
-#if MOONLIGHT
- bool is_remproxy = false;
-#else
bool is_remproxy = (rp is RemotingProxy);
-#endif
out_args = null;
IMethodReturnMessage res_msg = null;
@@ -183,11 +179,9 @@ namespace System.Runtime.Remoting.Proxies
// Check for constructor msg
if (mMsg.MethodBase.IsConstructor)
{
-#if !MOONLIGHT
if (is_remproxy)
res_msg = (IMethodReturnMessage) (rp as RemotingProxy).ActivateRemoteObject ((IMethodMessage) msg);
else
-#endif
msg = new ConstructionCall (rp.GetProxiedType ());
}
diff --git a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
index ba7e5f4e1e2..1d206f66b1d 100644
--- a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
@@ -545,9 +545,6 @@ namespace System.Runtime.Remoting
internal static object CreateClientProxy (Type objectType, string url, object[] activationAttributes)
{
-#if MOONLIGHT
- throw new NotSupportedException ();
-#else
string activationUrl = url;
if (!activationUrl.EndsWith ("/"))
activationUrl += "/";
@@ -558,7 +555,6 @@ namespace System.Runtime.Remoting
RemotingProxy proxy = new RemotingProxy (objectType, activationUrl, activationAttributes);
return proxy.GetTransparentProxy();
-#endif
}
internal static object CreateClientProxy (WellKnownClientTypeEntry entry)
@@ -575,12 +571,8 @@ namespace System.Runtime.Remoting
if (att != null)
return att.CreateInstance (type);
}
-#if MOONLIGHT
- throw new NotSupportedException ();
-#else
RemotingProxy proxy = new RemotingProxy (type, ChannelServices.CrossContextUrl, activationAttributes);
return proxy.GetTransparentProxy();
-#endif
}
#if !NET_2_1
internal static object CreateClientProxyForComInterop (Type type)
@@ -672,7 +664,6 @@ namespace System.Runtime.Remoting
// Registers the identity
uri_hash [uri] = identity;
-#if !MOONLIGHT
if (proxyType != null)
{
RemotingProxy proxy = new RemotingProxy (proxyType, identity);
@@ -683,7 +674,6 @@ namespace System.Runtime.Remoting
clientProxy = proxy.GetTransparentProxy();
identity.ClientProxy = (MarshalByRefObject) clientProxy;
}
-#endif
return identity;
}
}
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryCommon.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryCommon.cs
index ffe5b4320df..f6df7a26574 100644
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryCommon.cs
+++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryCommon.cs
@@ -81,13 +81,11 @@ namespace System.Runtime.Serialization.Formatters.Binary
// TimeStamp does not have a TypeCode, so it is managed as a special
// case in GetTypeCode()
-#if !MOONLIGHT
// This environment variable is only for test and benchmarking purposes.
// By default, mono will always use IL generated class serializers.
string s = Environment.GetEnvironmentVariable("MONO_REFLECTION_SERIALIZER");
if (s == null) s = "no";
UseReflectionSerialization = (s != "no");
-#endif
}
public static bool IsPrimitive (Type type)
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs b/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs
index 79b259f6678..6e4f00ccfb3 100644
--- a/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs
+++ b/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs
@@ -61,11 +61,7 @@ namespace System.Runtime.Serialization
int IHashCodeProvider.GetHashCode (object o)
{
-#if !INSIDE_CORLIB && MOONLIGHT
- return o == null ? 0 : o .GetHashCode ();
-#else
return object.InternalGetHashCode (o);
-#endif
}
}
diff --git a/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesAttribute.cs b/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesAttribute.cs
index 969a1305458..557c6f4bdfd 100644
--- a/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesAttribute.cs
+++ b/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesAttribute.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
namespace System.Runtime.Versioning
{
diff --git a/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesOptions.cs b/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesOptions.cs
index d068e653b4c..df843aeff87 100644
--- a/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesOptions.cs
+++ b/mcs/class/corlib/System.Runtime.Versioning/ComponentGuaranteesOptions.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
namespace System.Runtime.Versioning
{
diff --git a/mcs/class/corlib/System.Runtime.Versioning/TargetFrameworkAttribute.cs b/mcs/class/corlib/System.Runtime.Versioning/TargetFrameworkAttribute.cs
index bf951cc1b75..ebe0dc21e89 100644
--- a/mcs/class/corlib/System.Runtime.Versioning/TargetFrameworkAttribute.cs
+++ b/mcs/class/corlib/System.Runtime.Versioning/TargetFrameworkAttribute.cs
@@ -27,7 +27,7 @@
//
using System;
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
namespace System.Runtime.Versioning
{
[AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
index 97712f90c57..e2e5f793f3c 100644
--- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
+++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
@@ -36,9 +36,7 @@ using Mono.Security;
using Mono.Security.X509;
using System.Runtime.Serialization;
-#if !MOONLIGHT
using Mono.Security.Authenticode;
-#endif
namespace System.Security.Cryptography.X509Certificates {
@@ -100,7 +98,6 @@ namespace System.Security.Cryptography.X509Certificates {
return new X509Certificate (data);
}
-#if !MOONLIGHT
[MonoTODO ("Incomplete - minimal validation in this version")]
public static X509Certificate CreateFromSignedFile (string filename)
{
@@ -121,8 +118,6 @@ namespace System.Security.Cryptography.X509Certificates {
throw new CryptographicException (Locale.GetText ("{0} isn't signed.", filename));
}
-#endif // NET_2_1
-
// constructors
// special constructor for Publisher (and related classes).
@@ -152,7 +147,6 @@ namespace System.Security.Cryptography.X509Certificates {
#endif
}
-#if !MOONLIGHT
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
private void InitFromHandle (IntPtr handle)
{
@@ -165,7 +159,6 @@ namespace System.Security.Cryptography.X509Certificates {
}
// for 1.x IntPtr.Zero results in an "empty" certificate instance
}
-#endif
public X509Certificate (System.Security.Cryptography.X509Certificates.X509Certificate cert)
{
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs
index 21ff22e3dc4..f3c4a8b277d 100644
--- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs
+++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs
@@ -41,11 +41,7 @@ namespace System.Security.Cryptography.X509Certificates {
[ComVisible (true)]
[MonoTODO ("X509ContentType.SerializedCert isn't supported (anywhere in the class)")]
-#if MOONLIGHT
- public partial class X509Certificate {
-#else
public partial class X509Certificate : IDeserializationCallback, ISerializable {
-#endif
private string issuer_name;
private string subject_name;
@@ -60,26 +56,22 @@ namespace System.Security.Cryptography.X509Certificates {
Import (rawData, password, X509KeyStorageFlags.DefaultKeySet);
}
-#if !MOONLIGHT
[MonoTODO ("SecureString support is incomplete")]
public X509Certificate (byte[] rawData, SecureString password)
{
Import (rawData, password, X509KeyStorageFlags.DefaultKeySet);
}
-#endif
public X509Certificate (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
{
Import (rawData, password, keyStorageFlags);
}
-#if !MOONLIGHT
[MonoTODO ("SecureString support is incomplete")]
public X509Certificate (byte[] rawData, SecureString password, X509KeyStorageFlags keyStorageFlags)
{
Import (rawData, password, keyStorageFlags);
}
-#endif
public X509Certificate (string fileName)
{
@@ -91,26 +83,22 @@ namespace System.Security.Cryptography.X509Certificates {
Import (fileName, password, X509KeyStorageFlags.DefaultKeySet);
}
-#if !MOONLIGHT
[MonoTODO ("SecureString support is incomplete")]
public X509Certificate (string fileName, SecureString password)
{
Import (fileName, password, X509KeyStorageFlags.DefaultKeySet);
}
-#endif
public X509Certificate (string fileName, string password, X509KeyStorageFlags keyStorageFlags)
{
Import (fileName, password, keyStorageFlags);
}
-#if !MOONLIGHT
[MonoTODO ("SecureString support is incomplete")]
public X509Certificate (string fileName, SecureString password, X509KeyStorageFlags keyStorageFlags)
{
Import (fileName, password, keyStorageFlags);
}
-#endif
public X509Certificate (SerializationInfo info, StreamingContext context)
{
@@ -171,14 +159,12 @@ namespace System.Security.Cryptography.X509Certificates {
return Export (contentType, pwd);
}
-#if !MOONLIGHT
[MonoTODO ("X509ContentType.Pfx/Pkcs12 and SerializedCert are not supported. SecureString support is incomplete.")]
public virtual byte[] Export (X509ContentType contentType, SecureString password)
{
byte[] pwd = (password == null) ? null : password.GetBuffer ();
return Export (contentType, pwd);
}
-#endif
internal byte[] Export (X509ContentType contentType, byte[] password)
{
@@ -189,14 +175,12 @@ namespace System.Security.Cryptography.X509Certificates {
switch (contentType) {
case X509ContentType.Cert:
return x509.RawData;
-#if !MOONLIGHT
case X509ContentType.Pfx: // this includes Pkcs12
// TODO
throw new NotSupportedException ();
case X509ContentType.SerializedCert:
// TODO
throw new NotSupportedException ();
-#endif
default:
string msg = Locale.GetText ("This certificate format '{0}' cannot be exported.", contentType);
throw new CryptographicException (msg);
@@ -256,13 +240,11 @@ namespace System.Security.Cryptography.X509Certificates {
}
}
-#if !MOONLIGHT
[MonoTODO ("SecureString support is incomplete")]
public virtual void Import (byte[] rawData, SecureString password, X509KeyStorageFlags keyStorageFlags)
{
Import (rawData, (string)null, keyStorageFlags);
}
-#endif
[ComVisible (false)]
public virtual void Import (string fileName)
@@ -279,16 +261,13 @@ namespace System.Security.Cryptography.X509Certificates {
Import (rawData, password, keyStorageFlags);
}
-#if !MOONLIGHT
[MonoTODO ("SecureString support is incomplete, missing KeyStorageFlags support")]
public virtual void Import (string fileName, SecureString password, X509KeyStorageFlags keyStorageFlags)
{
byte[] rawData = Load (fileName);
Import (rawData, (string)null, keyStorageFlags);
}
-#endif
-#if !MOONLIGHT
void IDeserializationCallback.OnDeserialization (object sender)
{
}
@@ -298,7 +277,7 @@ namespace System.Security.Cryptography.X509Certificates {
// will throw a NRE if info is null (just like MS implementation)
info.AddValue ("RawData", x509.RawData);
}
-#endif
+
[ComVisible (false)]
public virtual void Reset ()
{
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs
index e7b0f14a554..42fca5acade 100644
--- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs
+++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs
@@ -37,7 +37,6 @@ namespace System.Security.Cryptography.X509Certificates {
enum X509ContentType {
Unknown,
Cert,
-#if !MOONLIGHT
// not supported by Silverlight 2.0 (NET_2_1)
SerializedCert,
Pfx,
@@ -45,6 +44,5 @@ namespace System.Security.Cryptography.X509Certificates {
Pkcs7,
Authenticode,
Pkcs12 = Pfx
-#endif
}
}
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs
index b7b2d9e62d7..ce375c2aeac 100644
--- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs
+++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs
@@ -35,14 +35,12 @@ namespace System.Security.Cryptography.X509Certificates {
[ComVisible (true)]
public enum X509KeyStorageFlags {
DefaultKeySet = 0,
-#if !MOONLIGHT
// not supported by Silverlight 2.0 (NET_2_1)
UserKeySet = 1,
MachineKeySet = 2,
Exportable = 4,
UserProtected = 8,
PersistKeySet = 16
-#endif
}
}
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs
index 7720549e95b..fb04371d255 100644
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs
@@ -30,7 +30,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT && !FULL_AOT_RUNTIME
+#if !FULL_AOT_RUNTIME
using System.Collections;
using System.Collections.Generic;
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoConfig_2_1.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoConfig_2_1.cs
index 97c280b563b..d3fda3b349b 100644
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoConfig_2_1.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/CryptoConfig_2_1.cs
@@ -124,42 +124,6 @@ namespace System.Security.Cryptography {
}
return num;
}
-#if MOONLIGHT
- // we need SHA1 support to verify the codecs binary integrity
- public static string MapNameToOID (string name)
- {
- if ((name != null) && name.Contains ("SHA1"))
- return "1.3.14.3.2.26";
- return String.Empty;
- }
-
- private const string AES = "System.Security.Cryptography.AesManaged, System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
-
- // non-configurable (versus machine.config) mappings for Moonlight (to avoid loading custom code)
- public static object CreateFromName (string name)
- {
- switch (name) {
- case "System.Security.Cryptography.HashAlgorithm":
- case "System.Security.Cryptography.SHA1":
- case "SHA1":
- return new SHA1Managed ();
- case "SHA256":
- return new SHA256Managed ();
- case "System.Security.Cryptography.MD5":
- case "MD5":
- return new MD5CryptoServiceProvider ();
- case "System.Security.Cryptography.RandomNumberGenerator":
- return new RNGCryptoServiceProvider ();
- case "System.Security.Cryptography.RSA":
- return new Mono.Security.Cryptography.RSAManaged ();
- case "AES":
- case AES:
- return (Aes) Activator.CreateInstance (Type.GetType (AES), null);
- default:
- throw new NotImplementedException (name);
- }
- }
-#endif
}
}
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs
index 6c4f84ea3b7..7f561f62c45 100644
--- a/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs
@@ -31,8 +31,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.IO;
using System.Globalization;
using System.Runtime.InteropServices;
@@ -293,6 +291,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs b/mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs
index a84aee8a3d6..f7414bf379b 100644
--- a/mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
@@ -58,5 +56,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
diff --git a/mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs b/mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs
index 0a039c5801b..2ccc52ef35b 100644
--- a/mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
@@ -51,5 +49,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
diff --git a/mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs b/mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs
index 007caf51299..a88377c0459 100644
--- a/mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
@@ -71,5 +69,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
diff --git a/mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs b/mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs
index 562d40d6f59..eb40da4a94f 100644
--- a/mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
@@ -71,5 +69,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
diff --git a/mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs b/mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs
index 393b872bc7d..270735f28b6 100644
--- a/mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
@@ -146,6 +144,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs b/mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs
index 4d67a691ec3..e34a1541d01 100644
--- a/mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
@@ -69,5 +67,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
diff --git a/mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs b/mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs
index 2383b261213..1052ee0ff30 100644
--- a/mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs
@@ -30,8 +30,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
@@ -439,5 +437,3 @@ namespace System.Security.Cryptography {
private const int BLOCK_SIZE_BYTES = 64;
}
}
-
-#endif
diff --git a/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs
index e0ffb2e8e8b..f70ac329846 100644
--- a/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs
@@ -146,7 +146,7 @@ namespace System.Security.Cryptography {
}
}
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
protected override void Dispose (bool disposing)
{
base.Dispose (disposing);
diff --git a/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs
index af8e8fb64e8..4c14453e4ed 100644
--- a/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs
@@ -29,8 +29,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.IO;
using System.Runtime.InteropServices;
@@ -408,6 +406,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs b/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs
index 0988ca54809..d367997770d 100644
--- a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs
@@ -71,7 +71,7 @@ namespace System.Security.Cryptography {
#endif
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
public void Dispose ()
{
Dispose (true);
diff --git a/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs b/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
index bf4a7e95ae9..877f4ffda21 100644
--- a/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
@@ -1,10 +1,10 @@
-//
-// System.Security.Cryptography.Rijndael.cs
-//
-// Authors: Dan Lewis (dihlewis@yahoo.co.uk)
-// Andrew Birkett (andy@nobugs.org)
-//
-// (C) 2002
+//
+// System.Security.Cryptography.Rijndael.cs
+//
+// Authors: Dan Lewis (dihlewis@yahoo.co.uk)
+// Andrew Birkett (andy@nobugs.org)
+//
+// (C) 2002
// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -27,46 +27,42 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
-
-namespace System.Security.Cryptography {
+
+namespace System.Security.Cryptography {
// References:
// a. FIPS PUB 197: Advanced Encryption Standard
// http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
-
+
[ComVisible (true)]
- public abstract class Rijndael : SymmetricAlgorithm {
-
- public static new Rijndael Create ()
- {
+ public abstract class Rijndael : SymmetricAlgorithm {
+
+ public static new Rijndael Create ()
+ {
#if FULL_AOT_RUNTIME
return new System.Security.Cryptography.RijndaelManaged ();
#else
- return Create ("System.Security.Cryptography.Rijndael");
+ return Create ("System.Security.Cryptography.Rijndael");
#endif
- }
-
- public static new Rijndael Create (string algName)
- {
- return (Rijndael) CryptoConfig.CreateFromName (algName);
- }
+ }
+
+ public static new Rijndael Create (string algName)
+ {
+ return (Rijndael) CryptoConfig.CreateFromName (algName);
+ }
protected Rijndael ()
- {
- KeySizeValue = 256;
- BlockSizeValue = 128;
- FeedbackSizeValue = 128;
-
- LegalKeySizesValue = new KeySizes [1];
- LegalKeySizesValue [0] = new KeySizes (128, 256, 64);
-
- LegalBlockSizesValue = new KeySizes [1];
- LegalBlockSizesValue [0] = new KeySizes (128, 256, 64);
- }
- }
-}
-#endif
+ {
+ KeySizeValue = 256;
+ BlockSizeValue = 128;
+ FeedbackSizeValue = 128;
+
+ LegalKeySizesValue = new KeySizes [1];
+ LegalKeySizesValue [0] = new KeySizes (128, 256, 64);
+ LegalBlockSizesValue = new KeySizes [1];
+ LegalBlockSizesValue [0] = new KeySizes (128, 256, 64);
+ }
+ }
+}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs b/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs
index 511e35d146d..7db3cfd5af8 100644
--- a/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs
@@ -31,8 +31,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
@@ -72,6 +70,3 @@ namespace System.Security.Cryptography {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs b/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs
index e0ce34a4e8b..6910f112aae 100644
--- a/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs
@@ -26,8 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using Mono.Security.Cryptography;
using System.Runtime.InteropServices;
@@ -1569,5 +1567,3 @@ namespace System.Security.Cryptography {
#endregion
}
}
-
-#endif
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs
index 465adc8f35b..161d5b964a6 100644
--- a/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs
@@ -316,8 +316,6 @@ namespace System.Security.Cryptography {
}
}
-#if !MOONLIGHT
-
[ComVisible (true)]
public sealed class SHA1CryptoServiceProvider : SHA1 {
@@ -356,5 +354,4 @@ namespace System.Security.Cryptography {
sha.Initialize ();
}
}
-#endif // NET_2_1
}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA384.cs b/mcs/class/corlib/System.Security.Cryptography/SHA384.cs
index 93b6f7f64de..4a6fc51a60a 100644
--- a/mcs/class/corlib/System.Security.Cryptography/SHA384.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/SHA384.cs
@@ -1,12 +1,12 @@
-//
-// System.Security.Cryptography SHA384 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
+//
+// System.Security.Cryptography SHA384 Class implementation
+//
+// Authors:
+// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
// Sebastien Pouliot <sebastien@ximian.com>
-//
-// Copyright 2001 by Matthew S. Ford.
-// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
+//
+// Copyright 2001 by Matthew S. Ford.
+// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -29,34 +29,30 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
-
-namespace System.Security.Cryptography {
+
+namespace System.Security.Cryptography {
[ComVisible (true)]
- public abstract class SHA384 : HashAlgorithm {
+ public abstract class SHA384 : HashAlgorithm {
protected SHA384 ()
- {
- HashSizeValue = 384;
- }
-
- public static new SHA384 Create ()
- {
+ {
+ HashSizeValue = 384;
+ }
+
+ public static new SHA384 Create ()
+ {
#if FULL_AOT_RUNTIME
return new System.Security.Cryptography.SHA384Managed ();
#else
- return Create ("System.Security.Cryptography.SHA384");
+ return Create ("System.Security.Cryptography.SHA384");
#endif
- }
-
- public static new SHA384 Create (string hashName)
- {
- return (SHA384) CryptoConfig.CreateFromName (hashName);
- }
- }
-}
-#endif
-
+ }
+
+ public static new SHA384 Create (string hashName)
+ {
+ return (SHA384) CryptoConfig.CreateFromName (hashName);
+ }
+ }
+}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs
index 43495bef6b1..dd4aee047fc 100644
--- a/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs
@@ -30,8 +30,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
@@ -259,6 +257,3 @@ public class SHA384Managed : SHA384 {
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA512.cs b/mcs/class/corlib/System.Security.Cryptography/SHA512.cs
index ccded95bfd3..46dfb04e970 100644
--- a/mcs/class/corlib/System.Security.Cryptography/SHA512.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/SHA512.cs
@@ -1,12 +1,12 @@
-//
-// System.Security.Cryptography SHA512 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
+//
+// System.Security.Cryptography SHA512 Class implementation
+//
+// Authors:
+// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
// Sebastien Pouliot <sebastien@ximian.com>
-//
-// Copyright 2001 by Matthew S. Ford.
-// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
+//
+// Copyright 2001 by Matthew S. Ford.
+// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -29,34 +29,30 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
-
-namespace System.Security.Cryptography {
+
+namespace System.Security.Cryptography {
[ComVisible (true)]
- public abstract class SHA512 : HashAlgorithm {
+ public abstract class SHA512 : HashAlgorithm {
protected SHA512 ()
- {
- HashSizeValue = 512;
- }
-
- public static new SHA512 Create ()
- {
+ {
+ HashSizeValue = 512;
+ }
+
+ public static new SHA512 Create ()
+ {
#if FULL_AOT_RUNTIME
return new System.Security.Cryptography.SHA512Managed ();
#else
- return Create ("System.Security.Cryptography.SHA512");
+ return Create ("System.Security.Cryptography.SHA512");
#endif
- }
-
- public static new SHA512 Create (string hashName)
- {
- return (SHA512) CryptoConfig.CreateFromName (hashName);
- }
- }
-}
-#endif
-
+ }
+
+ public static new SHA512 Create (string hashName)
+ {
+ return (SHA512) CryptoConfig.CreateFromName (hashName);
+ }
+ }
+}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs
index 190adeb327e..5a4865879c3 100644
--- a/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs
@@ -30,8 +30,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
@@ -282,6 +280,3 @@ public class SHA512Managed : SHA512 {
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs b/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
index 99b41562aef..ba713e8c6e5 100644
--- a/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
@@ -42,16 +42,9 @@ namespace System.Security.Cryptography {
protected byte[] KeyValue;
protected KeySizes[] LegalBlockSizesValue;
protected KeySizes[] LegalKeySizesValue;
-#if MOONLIGHT
- // Silverlight 2.0 only supports CBC
- internal int FeedbackSizeValue;
- internal CipherMode ModeValue;
- internal PaddingMode PaddingValue;
-#else
protected int FeedbackSizeValue;
protected CipherMode ModeValue;
protected PaddingMode PaddingValue;
-#endif
private bool m_disposed;
protected SymmetricAlgorithm ()
diff --git a/mcs/class/corlib/System.Security.Permissions/PublisherIdentityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/PublisherIdentityPermissionAttribute.cs
index d5ae1319b1a..f3adcec97d9 100644
--- a/mcs/class/corlib/System.Security.Permissions/PublisherIdentityPermissionAttribute.cs
+++ b/mcs/class/corlib/System.Security.Permissions/PublisherIdentityPermissionAttribute.cs
@@ -27,8 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Runtime.InteropServices;
using SSCX = System.Security.Cryptography.X509Certificates;
@@ -92,6 +90,3 @@ namespace System.Security.Permissions {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs b/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs
index 9a20872424b..f45abac05ea 100644
--- a/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs
+++ b/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs
@@ -43,22 +43,22 @@ namespace System.Security.Permissions {
public enum SecurityAction {
Demand = 2,
Assert = 3,
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
[Obsolete ("This requests should not be used")]
#endif
Deny = 4,
PermitOnly = 5,
LinkDemand = 6,
InheritanceDemand = 7,
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
[Obsolete ("This requests should not be used")]
#endif
RequestMinimum = 8,
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
[Obsolete ("This requests should not be used")]
#endif
RequestOptional = 9,
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
[Obsolete ("This requests should not be used")]
#endif
RequestRefuse = 10,
diff --git a/mcs/class/corlib/System.Security.Policy/Evidence.cs b/mcs/class/corlib/System.Security.Policy/Evidence.cs
index e4f71881c3e..366593159ca 100644
--- a/mcs/class/corlib/System.Security.Policy/Evidence.cs
+++ b/mcs/class/corlib/System.Security.Policy/Evidence.cs
@@ -38,10 +38,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Security.Cryptography.X509Certificates;
-
-#if !MOONLIGHT
using Mono.Security.Authenticode;
-#endif
namespace System.Security.Policy {
diff --git a/mcs/class/corlib/System.Security.Policy/Hash.cs b/mcs/class/corlib/System.Security.Policy/Hash.cs
index b135cca778d..c0923df1472 100644
--- a/mcs/class/corlib/System.Security.Policy/Hash.cs
+++ b/mcs/class/corlib/System.Security.Policy/Hash.cs
@@ -29,8 +29,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
@@ -211,6 +209,3 @@ public sealed class Hash :
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Policy/HashMembershipCondition.cs b/mcs/class/corlib/System.Security.Policy/HashMembershipCondition.cs
index 6918f250f85..c645519bed3 100644
--- a/mcs/class/corlib/System.Security.Policy/HashMembershipCondition.cs
+++ b/mcs/class/corlib/System.Security.Policy/HashMembershipCondition.cs
@@ -28,8 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Collections;
using System.Globalization;
using System.Reflection;
@@ -206,6 +204,3 @@ namespace System.Security.Policy {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs b/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs
index a124af3d320..d78fe55eb07 100644
--- a/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs
+++ b/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs
@@ -31,8 +31,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Collections; // for IList
using System.Globalization;
using System.IO;
@@ -596,6 +594,3 @@ namespace System.Security.Policy {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Policy/Zone.cs b/mcs/class/corlib/System.Security.Policy/Zone.cs
index 1ea46bef327..33d406c0178 100644
--- a/mcs/class/corlib/System.Security.Policy/Zone.cs
+++ b/mcs/class/corlib/System.Security.Policy/Zone.cs
@@ -28,8 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.IO;
using System.Globalization;
using System.Security.Permissions;
@@ -158,6 +156,3 @@ namespace System.Security.Policy {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security.Policy/ZoneMembershipCondition.cs b/mcs/class/corlib/System.Security.Policy/ZoneMembershipCondition.cs
index d3a831b2814..abaebc27472 100644
--- a/mcs/class/corlib/System.Security.Policy/ZoneMembershipCondition.cs
+++ b/mcs/class/corlib/System.Security.Policy/ZoneMembershipCondition.cs
@@ -28,8 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MOONLIGHT
-
using System.Collections;
using System.Globalization;
using System.Runtime.InteropServices;
@@ -139,6 +137,3 @@ namespace System.Security.Policy {
}
}
}
-
-#endif
-
diff --git a/mcs/class/corlib/System.Security/IPermission.cs b/mcs/class/corlib/System.Security/IPermission.cs
index d045a2a9498..09c99b0f811 100644
--- a/mcs/class/corlib/System.Security/IPermission.cs
+++ b/mcs/class/corlib/System.Security/IPermission.cs
@@ -32,11 +32,7 @@ using System.Runtime.InteropServices;
namespace System.Security {
[ComVisible (true)]
-#if MOONLIGHT
- public interface IPermission {
-#else
public interface IPermission : ISecurityEncodable {
-#endif
IPermission Copy ();
void Demand ();
diff --git a/mcs/class/corlib/System.Security/SecurityFrame.cs b/mcs/class/corlib/System.Security/SecurityFrame.cs
index 340c8764386..13980f5d767 100644
--- a/mcs/class/corlib/System.Security/SecurityFrame.cs
+++ b/mcs/class/corlib/System.Security/SecurityFrame.cs
@@ -53,7 +53,6 @@ namespace System.Security {
}
#pragma warning restore 649
-#if !MOONLIGHT
internal struct SecurityFrame {
private AppDomain _domain;
@@ -185,5 +184,4 @@ namespace System.Security {
return al;
}
}
-#endif
}
diff --git a/mcs/class/corlib/System.Security/SecurityManager.cs b/mcs/class/corlib/System.Security/SecurityManager.cs
index 68642461eb6..39320b1c4d7 100644
--- a/mcs/class/corlib/System.Security/SecurityManager.cs
+++ b/mcs/class/corlib/System.Security/SecurityManager.cs
@@ -97,7 +97,7 @@ namespace System.Security {
return true; // always true outside Moonlight
}
- [Conditional ("MOONLIGHT")]
+ [Conditional ("ENABLE_SANDBOX")] //??
internal static void EnsureElevatedPermissions ()
{
// do nothing outside of Moonlight
diff --git a/mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs b/mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs
index 2963cbfd2cd..06d0807c7fa 100644
--- a/mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs
+++ b/mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs
@@ -28,9 +28,7 @@
namespace System.Security {
-#if !MOONLIGHT
[MonoTODO ("Only supported by the runtime when CoreCLR is enabled")]
-#endif
[AttributeUsage (AttributeTargets.Delegate | AttributeTargets.Interface | AttributeTargets.Field | AttributeTargets.Method |
AttributeTargets.Constructor | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
public sealed class SecuritySafeCriticalAttribute : Attribute {
diff --git a/mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs b/mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs
index ef89603dbf6..92e94ca3dda 100644
--- a/mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs
+++ b/mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs
@@ -28,9 +28,7 @@
namespace System.Security {
-#if MOONLIGHT
[MonoTODO ("Only supported by the runtime when CoreCLR is enabled")]
-#endif
[AttributeUsage (AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed class SecurityTransparentAttribute : Attribute {
diff --git a/mcs/class/corlib/System.Text/Encoding.cs b/mcs/class/corlib/System.Text/Encoding.cs
index 76ea02fcbd9..6bdfa546112 100644
--- a/mcs/class/corlib/System.Text/Encoding.cs
+++ b/mcs/class/corlib/System.Text/Encoding.cs
@@ -444,13 +444,10 @@ public abstract class Encoding : ICloneable
case UnicodeEncoding.BIG_UNICODE_CODE_PAGE:
return BigEndianUnicode;
-#if !MOONLIGHT
case Latin1Encoding.ISOLATIN_CODE_PAGE:
return ISOLatin1;
-#endif
default: break;
}
-#if !MOONLIGHT
// Try to obtain a code page handler from the I18N handler.
Encoding enc = (Encoding)(InvokeI18N ("GetEncoding", codepage));
if (enc != null) {
@@ -478,7 +475,6 @@ public abstract class Encoding : ICloneable
enc.is_readonly = true;
return enc;
}
-#endif // !NET_2_1
// We have no idea how to handle this code page.
throw new NotSupportedException
(String.Format ("CodePage {0} not supported", codepage.ToString ()));
@@ -494,8 +490,6 @@ public abstract class Encoding : ICloneable
return e;
}
-#if !MOONLIGHT
-
public static Encoding GetEncoding (int codepage,
EncoderFallback encoderFallback, DecoderFallback decoderFallback)
{
@@ -526,8 +520,6 @@ public abstract class Encoding : ICloneable
return e;
}
-#endif // !NET_2_1
-
static EncodingInfo [] encoding_infos;
// FIXME: As everyone would agree, this implementation is so *hacky*
@@ -565,7 +557,6 @@ public abstract class Encoding : ICloneable
return encoding_infos;
}
-#if !MOONLIGHT
[ComVisible (false)]
public bool IsAlwaysNormalized ()
{
@@ -578,7 +569,6 @@ public abstract class Encoding : ICloneable
// umm, ASCIIEncoding should have overriden this method, no?
return form == NormalizationForm.FormC && this is ASCIIEncoding;
}
-#endif // NET_2_1
// Get an encoding object for a specific web encoding name.
public static Encoding GetEncoding (string name)
@@ -639,14 +629,11 @@ public abstract class Encoding : ICloneable
case "utf_32be":
return GetEncoding (UTF32Encoding.BIG_UTF32_CODE_PAGE);
-#if !MOONLIGHT
case "iso_8859_1":
case "latin1":
return GetEncoding (Latin1Encoding.ISOLATIN_CODE_PAGE);
-#endif
}
-#if !MOONLIGHT
// Try to obtain a web encoding handler from the I18N handler.
Encoding enc = (Encoding)(InvokeI18N ("GetEncoding", name));
if (enc != null) {
@@ -670,7 +657,6 @@ public abstract class Encoding : ICloneable
if (type != null) {
return (Encoding)(Activator.CreateInstance (type));
}
-#endif
// We have no idea how to handle this encoding name.
throw new ArgumentException (String.Format ("Encoding name '{0}' not "
+ "supported", name), "name");
@@ -885,27 +871,17 @@ public abstract class Encoding : ICloneable
case 3: code_page = UTF8Encoding.UTF8_CODE_PAGE; break;
case 4: code_page = UnicodeEncoding.UNICODE_CODE_PAGE; break;
case 5: code_page = UnicodeEncoding.BIG_UNICODE_CODE_PAGE; break;
-#if !MOONLIGHT
case 6: code_page = Latin1Encoding.ISOLATIN_CODE_PAGE; break;
-#endif
}
defaultEncoding = GetEncoding (code_page);
}
} catch (NotSupportedException) {
-#if MOONLIGHT
- defaultEncoding = UTF8;
-#else
// code_page is not supported on underlying platform
defaultEncoding = UTF8Unmarked;
-#endif
} catch (ArgumentException) {
// code_page_name is not a valid code page, or is
// not supported by underlying OS
-#if MOONLIGHT
- defaultEncoding = UTF8;
-#else
defaultEncoding = UTF8Unmarked;
-#endif
}
defaultEncoding.is_readonly = true;
#endif
@@ -917,7 +893,6 @@ public abstract class Encoding : ICloneable
}
}
-#if !MOONLIGHT
// Get the ISO Latin1 encoding object.
private static Encoding ISOLatin1
@@ -936,8 +911,6 @@ public abstract class Encoding : ICloneable
}
}
-#endif
-
// Get the standard UTF-7 encoding object.
#if ECMA_COMPAT
private
diff --git a/mcs/class/corlib/System.Text/StringBuilder.cs b/mcs/class/corlib/System.Text/StringBuilder.cs
index bfc8a8925e5..4fd1612ba96 100644
--- a/mcs/class/corlib/System.Text/StringBuilder.cs
+++ b/mcs/class/corlib/System.Text/StringBuilder.cs
@@ -505,7 +505,7 @@ namespace System.Text {
return this;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public StringBuilder Clear ()
{
Length = 0;
@@ -538,31 +538,19 @@ namespace System.Text {
return this;
}
-#if MOONLIGHT
- internal
-#else
public
-#endif
StringBuilder AppendFormat (string format, object arg0)
{
return AppendFormat (null, format, new object [] { arg0 });
}
-#if MOONLIGHT
- internal
-#else
public
-#endif
StringBuilder AppendFormat (string format, object arg0, object arg1)
{
return AppendFormat (null, format, new object [] { arg0, arg1 });
}
-#if MOONLIGHT
- internal
-#else
public
-#endif
StringBuilder AppendFormat (string format, object arg0, object arg1, object arg2)
{
return AppendFormat (null, format, new object [] { arg0, arg1, arg2 });
diff --git a/mcs/class/corlib/System.Threading/ExecutionContext.cs b/mcs/class/corlib/System.Threading/ExecutionContext.cs
index 742c30644ad..b9bf96762df 100644
--- a/mcs/class/corlib/System.Threading/ExecutionContext.cs
+++ b/mcs/class/corlib/System.Threading/ExecutionContext.cs
@@ -40,9 +40,7 @@ namespace System.Threading {
, IDisposable
#endif
{
-#if !MOONLIGHT
private SecurityContext _sc;
-#endif
private LogicalCallContext _lcc;
private bool _suppressFlow;
private bool _capture;
@@ -53,10 +51,8 @@ namespace System.Threading {
internal ExecutionContext (ExecutionContext ec)
{
-#if !MOONLIGHT
if (ec._sc != null)
_sc = new SecurityContext (ec._sc);
-#endif
_suppressFlow = ec._suppressFlow;
_capture = true;
}
@@ -79,10 +75,8 @@ namespace System.Threading {
return null;
ExecutionContext capture = new ExecutionContext (ec);
-#if !MOONLIGHT
if (SecurityManager.SecurityEnabled)
capture.SecurityContext = SecurityContext.Capture ();
-#endif
#if !MONOTOUCH
capture.LogicalCallContext = CallContext.CreateLogicalCallContext (false);
#endif
@@ -127,7 +121,6 @@ namespace System.Threading {
}
}
-#if !MOONLIGHT
internal SecurityContext SecurityContext {
get {
if (_sc == null)
@@ -136,7 +129,6 @@ namespace System.Threading {
}
set { _sc = value; }
}
-#endif
internal bool FlowSuppressed {
get { return _suppressFlow; }
set { _suppressFlow = value; }
@@ -160,7 +152,6 @@ namespace System.Threading {
ec.FlowSuppressed = false;
}
-#if !MOONLIGHT
[MonoTODO ("only the SecurityContext is considered")]
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
public static void Run (ExecutionContext executionContext, ContextCallback callback, object state)
@@ -190,6 +181,5 @@ namespace System.Threading {
t.ExecutionContext.FlowSuppressed = true;
return new AsyncFlowControl (t, AsyncFlowControlType.Execution);
}
-#endif
}
} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Threading/LazyThreadSafetyMode.cs b/mcs/class/corlib/System.Threading/LazyThreadSafetyMode.cs
index 6ed0f6115a5..f9341d9bb5e 100644
--- a/mcs/class/corlib/System.Threading/LazyThreadSafetyMode.cs
+++ b/mcs/class/corlib/System.Threading/LazyThreadSafetyMode.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System;
diff --git a/mcs/class/corlib/System.Threading/Monitor.cs b/mcs/class/corlib/System.Threading/Monitor.cs
index e8d47328afe..bdd72c6c03d 100644
--- a/mcs/class/corlib/System.Threading/Monitor.cs
+++ b/mcs/class/corlib/System.Threading/Monitor.cs
@@ -189,7 +189,7 @@ namespace System.Threading
}
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static void try_enter_with_atomic_var (object obj, int millisecondsTimeout, ref bool lockTaken);
diff --git a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs b/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
index d64983d34e5..3efe05e2dec 100644
--- a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
+++ b/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
@@ -37,9 +37,7 @@ namespace System.Threading
{
[ComVisible (true)]
public sealed class RegisteredWaitHandle
-#if !MOONLIGHT
: MarshalByRefObject
-#endif
{
WaitHandle _waitObject;
WaitOrTimerCallback _callback;
diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs
index 0576cb14d75..bed9aa3acf9 100644
--- a/mcs/class/corlib/System.Threading/Thread.cs
+++ b/mcs/class/corlib/System.Threading/Thread.cs
@@ -184,7 +184,6 @@ namespace System.Threading {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static byte[] ByteArrayToCurrentDomain (byte[] arr);
-#if !MOONLIGHT
static void DeserializePrincipal (Thread th)
{
MemoryStream ms = new MemoryStream (ByteArrayToCurrentDomain (th.Internal._serialized_principal));
@@ -296,7 +295,6 @@ namespace System.Threading {
th.principal = value;
}
}
-#endif
// Looks up the object associated with the current thread
// this is called by the JIT directly, too
@@ -324,7 +322,6 @@ namespace System.Threading {
}
}
-#if !MOONLIGHT
// Stores a hash keyed by strings of LocalDataStoreSlot objects
static Hashtable datastorehash;
private static object datastore_lock = new object ();
@@ -413,7 +410,6 @@ namespace System.Threading {
return(slot);
}
}
-#endif
public static AppDomain GetDomain() {
return AppDomain.CurrentDomain;
@@ -480,7 +476,6 @@ namespace System.Threading {
{
}
-#if !MOONLIGHT
[Obsolete ("Deprecated in favor of GetApartmentState, SetApartmentState and TrySetApartmentState.")]
public ApartmentState ApartmentState {
get {
@@ -494,7 +489,6 @@ namespace System.Threading {
TrySetApartmentState (value);
}
}
-#endif // !NET_2_1
//[MethodImplAttribute (MethodImplOptions.InternalCall)]
//private static extern int current_lcid ();
@@ -606,7 +600,6 @@ namespace System.Threading {
}
}
-#if !MOONLIGHT
public ThreadPriority Priority {
get {
return(ThreadPriority.Lowest);
@@ -616,7 +609,6 @@ namespace System.Threading {
// FIXME: Implement setter.
}
}
-#endif
public ThreadState ThreadState {
get {
@@ -633,7 +625,6 @@ namespace System.Threading {
Abort_internal (Internal, null);
}
-#if !MOONLIGHT
[SecurityPermission (SecurityAction.Demand, ControlThread=true)]
public void Abort (object stateInfo)
{
@@ -651,7 +642,6 @@ namespace System.Threading {
{
Interrupt_internal (Internal);
}
-#endif
// The current thread joins with 'this'. Set ms to 0 to block
// until this actually exits.
@@ -671,7 +661,6 @@ namespace System.Threading {
return Join_internal (Internal, millisecondsTimeout, Internal.system_thread_handle);
}
-#if !MOONLIGHT
public bool Join(TimeSpan timeout)
{
long ms = (long) timeout.TotalMilliseconds;
@@ -680,12 +669,10 @@ namespace System.Threading {
return Join_internal (Internal, (int) ms, Internal.system_thread_handle);
}
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern static void MemoryBarrier ();
-#if !MOONLIGHT
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern void Resume_internal();
@@ -695,7 +682,6 @@ namespace System.Threading {
{
Resume_internal ();
}
-#endif // !NET_2_1
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern static void SpinWait_nop ();
@@ -712,45 +698,7 @@ namespace System.Threading {
}
}
-#if MOONLIGHT
- private void StartInternal ()
- {
- current_thread = this;
-
- try {
- if (threadstart is ThreadStart) {
- ((ThreadStart) threadstart) ();
- } else {
- ((ParameterizedThreadStart) threadstart) (start_obj);
- }
- } catch (ThreadAbortException) {
- // do nothing
- } catch (Exception ex) {
- MoonlightUnhandledException (ex);
- }
- }
-
- static MethodInfo moonlight_unhandled_exception = null;
-
- static internal void MoonlightUnhandledException (Exception e)
- {
- try {
- if (moonlight_unhandled_exception == null) {
- var assembly = System.Reflection.Assembly.Load ("System.Windows, Version=2.0.5.0, Culture=Neutral, PublicKeyToken=7cec85d7bea7798e");
- var application = assembly.GetType ("System.Windows.Application");
- moonlight_unhandled_exception = application.GetMethod ("OnUnhandledException",
- System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
- }
- moonlight_unhandled_exception.Invoke (null, new object [] { null, e });
- }
- catch {
- try {
- Console.WriteLine ("Unexpected exception while trying to report unhandled application exception: {0}", e);
- } catch {
- }
- }
- }
-#elif MONOTOUCH
+#if MONOTOUCH
static ConstructorInfo nsautoreleasepool_ctor;
IDisposable GetNSAutoreleasePool ()
@@ -797,7 +745,6 @@ namespace System.Threading {
throw new SystemException ("Thread creation failed.");
}
-#if !MOONLIGHT
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void Suspend_internal(InternalThread thread);
@@ -807,7 +754,6 @@ namespace System.Threading {
{
Suspend_internal (Internal);
}
-#endif // !NET_2_1
[MethodImplAttribute (MethodImplOptions.InternalCall)]
extern private static void SetState (InternalThread thread, ThreadState set);
@@ -995,7 +941,6 @@ namespace System.Threading {
// Managed and native threads are currently bound together.
}
-#if !MOONLIGHT
public ApartmentState GetApartmentState ()
{
return (ApartmentState)Internal.apartment_state;
@@ -1023,7 +968,6 @@ namespace System.Threading {
return true;
}
-#endif // !NET_2_1
[ComVisible (false)]
public override int GetHashCode ()
@@ -1037,7 +981,6 @@ namespace System.Threading {
Start ();
}
-#if !MOONLIGHT
// NOTE: This method doesn't show in the class library status page because
// it cannot be "found" with the StrongNameIdentityPermission for ECMA key.
// But it's there!
@@ -1066,8 +1009,6 @@ namespace System.Threading {
ExecutionContext.SecurityContext.CompressedStack = stack;
}
-#endif
-
void _Thread.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException ();
diff --git a/mcs/class/corlib/System.Threading/ThreadPool.cs b/mcs/class/corlib/System.Threading/ThreadPool.cs
index 97064daaba9..1e76495c740 100644
--- a/mcs/class/corlib/System.Threading/ThreadPool.cs
+++ b/mcs/class/corlib/System.Threading/ThreadPool.cs
@@ -82,9 +82,6 @@ namespace System.Threading {
if (callBack == null)
throw new ArgumentNullException ("callBack");
-#if MOONLIGHT
- callBack = MoonlightHandler (callBack);
-#endif
if (callBack.IsTransparentProxy ()) {
IAsyncResult ar = callBack.BeginInvoke (state, null, null);
if (ar == null)
@@ -225,19 +222,5 @@ namespace System.Threading {
}
#endif
-
-#if MOONLIGHT
- static WaitCallback MoonlightHandler (WaitCallback callback)
- {
- return delegate (object o) {
- try {
- callback (o);
- }
- catch (Exception ex) {
- Thread.MoonlightUnhandledException (ex);
- }
- };
- }
-#endif
}
}
diff --git a/mcs/class/corlib/System.Threading/Timer.cs b/mcs/class/corlib/System.Threading/Timer.cs
index 0f084b5fe39..5d41f2388b9 100644
--- a/mcs/class/corlib/System.Threading/Timer.cs
+++ b/mcs/class/corlib/System.Threading/Timer.cs
@@ -35,11 +35,7 @@ namespace System.Threading
{
[ComVisible (true)]
public sealed class Timer
-#if MOONLIGHT
- : IDisposable
-#else
: MarshalByRefObject, IDisposable
-#endif
{
static readonly Scheduler scheduler = Scheduler.Instance;
#region Timer instance fields
@@ -343,11 +339,7 @@ namespace System.Threading
list.RemoveAt (i);
count--;
i--;
-#if MOONLIGHT
- ThreadPool.QueueUserWorkItem (TimerCaller, timer);
-#else
ThreadPool.UnsafeQueueUserWorkItem (TimerCaller, timer);
-#endif
long period = timer.period_ms;
long due_time = timer.due_time_ms;
bool no_more = (period == -1 || ((period == 0 || period == Timeout.Infinite) && due_time != Timeout.Infinite));
diff --git a/mcs/class/corlib/System.Threading/WaitHandle.cs b/mcs/class/corlib/System.Threading/WaitHandle.cs
index 81ee13c76d2..e633aa2fe98 100644
--- a/mcs/class/corlib/System.Threading/WaitHandle.cs
+++ b/mcs/class/corlib/System.Threading/WaitHandle.cs
@@ -42,11 +42,7 @@ namespace System.Threading
[ComVisible (true)]
[StructLayout (LayoutKind.Sequential)]
public abstract class WaitHandle
-#if MOONLIGHT
- : IDisposable
-#else
: MarshalByRefObject, IDisposable
-#endif
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern bool WaitAll_internal(WaitHandle[] handles, int ms, bool exitContext);
@@ -243,7 +239,7 @@ namespace System.Threading
Dispose(true);
}
-#if NET_4_0 || MOBILE || MOONLIGHT
+#if NET_4_0 || MOBILE
public void Dispose ()
#else
void IDisposable.Dispose ()
diff --git a/mcs/class/corlib/System/Action.cs b/mcs/class/corlib/System/Action.cs
index de7dab66512..e06c6de6d1a 100644
--- a/mcs/class/corlib/System/Action.cs
+++ b/mcs/class/corlib/System/Action.cs
@@ -66,15 +66,6 @@ namespace System
public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6, in T7> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-#elif MOONLIGHT
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
- public delegate void Action ();
-
- public delegate void Action <T> (T obj);
- public delegate void Action <T1, T2, T3, T4, T5> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
- public delegate void Action <T1, T2, T3, T4, T5, T6> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
- public delegate void Action <T1, T2, T3, T4, T5, T6, T7> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
- public delegate void Action <T1, T2, T3, T4, T5, T6, T7, T8> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
#else
public delegate void Action <T> (T obj);
diff --git a/mcs/class/corlib/System/Activator.cs b/mcs/class/corlib/System/Activator.cs
index db61c741a89..714163ab23b 100644
--- a/mcs/class/corlib/System/Activator.cs
+++ b/mcs/class/corlib/System/Activator.cs
@@ -37,10 +37,8 @@ using System.Security.Permissions;
using System.Security.Policy;
using System.Configuration.Assemblies;
using System.Text;
-#if !MOONLIGHT
using System.Runtime.Remoting;
using System.Runtime.Remoting.Activation;
-#endif
namespace System
{
@@ -58,7 +56,6 @@ namespace System
{
}
-#if !MOONLIGHT
[MonoTODO ("No COM support")]
public static ObjectHandle CreateComInstanceFrom (string assemblyName, string typeName)
{
@@ -212,7 +209,6 @@ namespace System
throw new ArgumentNullException ("domain");
return domain.CreateInstance (assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
}
-#endif // !NET_2_1
public static T CreateInstance <T> ()
{
@@ -282,7 +278,6 @@ namespace System
}
CheckAbstractType (type);
-#if !MOONLIGHT
if (activationAttributes != null && activationAttributes.Length > 0) {
if (!type.IsMarshalByRef) {
string msg = Locale.GetText ("Type '{0}' doesn't derive from MarshalByRefObject.", type.FullName);
@@ -295,7 +290,6 @@ namespace System
return newOb;
}
}
-#endif
return ctor.Invoke (bindingAttr, binder, args, culture);
}
@@ -353,7 +347,6 @@ namespace System
}
}
-#if !MOONLIGHT
[SecurityPermission (SecurityAction.LinkDemand, RemotingConfiguration = true)]
public static object GetObject (Type type, string url)
{
@@ -371,7 +364,7 @@ namespace System
return RemotingServices.Connect (type, url, state);
}
-#endif
+
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal static extern object CreateInstanceInternal (Type type);
diff --git a/mcs/class/corlib/System/AppDomain.cs b/mcs/class/corlib/System/AppDomain.cs
index 7032f7054f5..75f751a1e74 100644
--- a/mcs/class/corlib/System/AppDomain.cs
+++ b/mcs/class/corlib/System/AppDomain.cs
@@ -60,14 +60,12 @@ using System.Text;
namespace System {
[ComVisible (true)]
-#if !NET_2_1 || MOONLIGHT
+#if !NET_2_1
[ComDefaultInterface (typeof (_AppDomain))]
#endif
[ClassInterface(ClassInterfaceType.None)]
[StructLayout (LayoutKind.Sequential)]
-#if MOONLIGHT
- public sealed class AppDomain : _AppDomain {
-#elif NET_2_1
+#if NET_2_1
public sealed class AppDomain : MarshalByRefObject, _AppDomain {
#else
public sealed class AppDomain : MarshalByRefObject, _AppDomain, IEvidenceFactory {
@@ -87,7 +85,6 @@ namespace System {
[ThreadStatic]
static Hashtable assembly_resolve_in_progress_refonly;
-#if !MOONLIGHT
// CAS
private Evidence _evidence;
private PermissionSet _granted;
@@ -97,7 +94,7 @@ namespace System {
[ThreadStatic]
private static IPrincipal _principal;
-#endif
+
static AppDomain default_domain;
private AppDomain ()
@@ -127,7 +124,6 @@ namespace System {
get { throw new NotImplementedException (); }
}
#endif
-#if !MOONLIGHT
public string BaseDirectory {
get {
string path = SetupInformationNoCopy.ApplicationBase;
@@ -176,7 +172,6 @@ namespace System {
return (SetupInformationNoCopy.ShadowCopyFiles == "true");
}
}
-#endif
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern string getFriendlyName ();
@@ -186,7 +181,7 @@ namespace System {
return getFriendlyName ();
}
}
-#if !MOONLIGHT
+
public Evidence Evidence {
get {
// if the host (runtime) hasn't provided it's own evidence...
@@ -234,7 +229,6 @@ namespace System {
internal PermissionSet GrantedPermissionSet {
get { return _granted; }
}
-#endif
#if NET_4_0
public PermissionSet PermissionSet {
@@ -267,8 +261,6 @@ namespace System {
}
}
-#if !MOONLIGHT
-
[Obsolete ("AppDomain.AppendPrivatePath has been deprecated. Please investigate the use of AppDomainSetup.PrivateBinPath instead.")]
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
public void AppendPrivatePath (string path)
@@ -317,7 +309,6 @@ namespace System {
return Activator.CreateComInstanceFrom (assemblyFile, typeName, hashValue ,hashAlgorithm);
}
#endif
-#endif
public ObjectHandle CreateInstance (string assemblyName, string typeName)
{
@@ -692,12 +683,10 @@ namespace System {
return base.GetType ();
}
-#if !MOONLIGHT
public override object InitializeLifetimeService ()
{
return null;
}
-#endif
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern Assembly LoadAssembly (string assemblyRef, Evidence securityEvidence, bool refOnly);
@@ -829,7 +818,6 @@ namespace System {
assembly.FromByteArray = true;
return assembly;
}
-#if !MOONLIGHT
#if NET_4_0
[Obsolete ("AppDomain policy levels are obsolete")]
#endif
@@ -892,7 +880,7 @@ namespace System {
_principal = principal;
}
-#endif
+
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern AppDomain InternalSetDomainByID (int domain_id);
@@ -981,8 +969,6 @@ namespace System {
return _process_guid;
}
-#if !MOONLIGHT
-
public static AppDomain CreateDomain (string friendlyName)
{
return CreateDomain (friendlyName, null, null);
@@ -1130,8 +1116,7 @@ namespace System {
return info;
}
-#endif // !NET_2_1
-
+
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern bool InternalIsFinalizingForUnload (int domain_id);
@@ -1191,14 +1176,7 @@ namespace System {
public override string ToString ()
{
-#if !MOONLIGHT
return getFriendlyName ();
-#else
- StringBuilder sb = new StringBuilder ("Name:");
- sb.AppendLine (FriendlyName);
- sb.AppendLine ("There are no context policies.");
- return sb.ToString ();
-#endif
}
private static void ValidateAssemblyName (string name)
@@ -1430,8 +1408,6 @@ namespace System {
get { return _domain_manager; }
}
-#if (!MOONLIGHT)
-
public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
#pragma warning disable 649
@@ -1539,15 +1515,6 @@ namespace System {
return GetAssemblies (true);
}
-#else // MOONLIGHT
-
- public int ExecuteAssemblyByName (string assemblyName)
- {
- // critical code in SL that we're not calling in ML
- throw new NotImplementedException ();
- }
-#endif
-
#if !NET_2_1
void _AppDomain.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
@@ -1571,7 +1538,7 @@ namespace System {
}
#endif
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
List<string> compatibility_switch;
public bool? IsCompatibilitySwitchSet (string value)
diff --git a/mcs/class/corlib/System/AppDomainSetup.cs b/mcs/class/corlib/System/AppDomainSetup.cs
index 12cb693004d..cd1decd0b2a 100644
--- a/mcs/class/corlib/System/AppDomainSetup.cs
+++ b/mcs/class/corlib/System/AppDomainSetup.cs
@@ -38,10 +38,8 @@ using System.Runtime.InteropServices;
using System.Security;
using System.Runtime.Serialization.Formatters.Binary;
-#if(!MOONLIGHT)
using System.Runtime.Hosting;
using System.Security.Policy;
-#endif
namespace System
{
@@ -71,19 +69,12 @@ namespace System
bool disallow_binding_redirects;
bool disallow_code_downloads;
-#if (!MOONLIGHT)
private ActivationArguments _activationArguments;
AppDomainInitializer domain_initializer;
[NonSerialized]
ApplicationTrust application_trust;
string [] domain_initializer_args;
-#else
- object _activationArguments;
- object domain_initializer; // always null
- [NonSerialized]
- object application_trust; // dummy, always null
- object domain_initializer_args;
-#endif
+
bool disallow_appbase_probe;
byte [] configuration_bytes;
@@ -118,7 +109,6 @@ namespace System
configuration_bytes = setup.configuration_bytes;
}
-#if (!MOONLIGHT)
public AppDomainSetup (ActivationArguments activationArguments)
{
_activationArguments = activationArguments;
@@ -128,7 +118,6 @@ namespace System
{
_activationArguments = new ActivationArguments (activationContext);
}
-#endif
static string GetAppBase (string appBase)
{
@@ -164,7 +153,7 @@ namespace System
application_name = value;
}
}
-#if !MOONLIGHT
+
public string CachePath {
get {
return cache_path;
@@ -227,7 +216,7 @@ namespace System
license_file = value;
}
}
-#endif
+
[MonoLimitation ("In Mono this is controlled by the --share-code flag")]
public LoaderOptimization LoaderOptimization {
get {
@@ -237,7 +226,7 @@ namespace System
loader_optimization = value;
}
}
-#if !MOONLIGHT
+
public string PrivateBinPath {
get {
return private_bin_path;
@@ -386,8 +375,8 @@ namespace System
serialized_non_primitives = ms.ToArray ();
}
-#endif // !NET_2_1
-#if NET_4_0 || MOONLIGHT || MOBILE
+
+#if NET_4_0 || MOBILE
[MonoTODO ("not implemented, does not throw because it's used in testing moonlight")]
public void SetCompatibilitySwitches (IEnumerable<string> switches)
{
diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs
index 8ee31d20693..2092ad42100 100644
--- a/mcs/class/corlib/System/Array.cs
+++ b/mcs/class/corlib/System/Array.cs
@@ -50,7 +50,7 @@ namespace System
[ComVisible (true)]
// FIXME: We are doing way to many double/triple exception checks for the overloaded functions"
public abstract class Array : ICloneable, ICollection, IList, IEnumerable
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
, IStructuralComparable, IStructuralEquatable
#endif
{
@@ -453,7 +453,7 @@ namespace System
return new SimpleEnumerator (this);
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
int IStructuralComparable.CompareTo (object other, IComparer comparer)
{
if (other == null)
diff --git a/mcs/class/corlib/System/Console.cs b/mcs/class/corlib/System/Console.cs
index 71963cdc8c3..7f6679a9918 100644
--- a/mcs/class/corlib/System/Console.cs
+++ b/mcs/class/corlib/System/Console.cs
@@ -219,10 +219,6 @@ namespace System
private static Stream Open (IntPtr handle, FileAccess access, int bufferSize)
{
-#if MOONLIGHT
- if (SecurityManager.SecurityEnabled && !Debugger.IsAttached && Environment.GetEnvironmentVariable ("MOONLIGHT_ENABLE_CONSOLE") == null)
- return new NullStream ();
-#endif
try {
return new FileStream (handle, access, false, bufferSize, false, bufferSize == 0);
} catch (IOException) {
diff --git a/mcs/class/corlib/System/ContextStaticAttribute.cs b/mcs/class/corlib/System/ContextStaticAttribute.cs
index b4906122acd..9593d24a2df 100644
--- a/mcs/class/corlib/System/ContextStaticAttribute.cs
+++ b/mcs/class/corlib/System/ContextStaticAttribute.cs
@@ -36,9 +36,6 @@ namespace System
/// <summary>
/// The ContextStatic attribute is used to flag fields as being unique
/// </summary>
-#if MOONLIGHT
- [Obsolete ("Not supported by the Silverlight runtime", true)]
-#endif
[AttributeUsage (AttributeTargets.Field, Inherited=false)]
[Serializable]
[ComVisible (true)]
diff --git a/mcs/class/corlib/System/Enum.cs b/mcs/class/corlib/System/Enum.cs
index 789ad5de6d8..6d1c209a6c9 100644
--- a/mcs/class/corlib/System/Enum.cs
+++ b/mcs/class/corlib/System/Enum.cs
@@ -621,7 +621,7 @@ namespace System
return true;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public static bool TryParse<TEnum> (string value, out TEnum result) where TEnum : struct
{
return TryParse (value, false, out result);
@@ -1014,7 +1014,7 @@ namespace System
}
return retVal;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public bool HasFlag (Enum flag)
{
var val = get_value ();
diff --git a/mcs/class/corlib/System/Environment.cs b/mcs/class/corlib/System/Environment.cs
index fe079897a97..01b37e9848e 100644
--- a/mcs/class/corlib/System/Environment.cs
+++ b/mcs/class/corlib/System/Environment.cs
@@ -85,7 +85,7 @@ namespace System {
ProgramFiles = 0x26,
MyPictures = 0x27,
CommonProgramFiles = 0x2b,
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
MyVideos = 0x0e,
#endif
#if NET_4_0
@@ -628,7 +628,7 @@ namespace System {
case SpecialFolder.Templates:
return ReadXdgUserDir (config, home, "XDG_TEMPLATES_DIR", "Templates");
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
case SpecialFolder.MyVideos:
return ReadXdgUserDir (config, home, "XDG_VIDEOS_DIR", "Videos");
#endif
@@ -836,7 +836,7 @@ namespace System {
throw new NotImplementedException ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
[SecurityCritical]
public static void FailFast (string message, Exception exception)
{
diff --git a/mcs/class/corlib/System/Exception.cs b/mcs/class/corlib/System/Exception.cs
index ec1529e082e..3fe55050099 100644
--- a/mcs/class/corlib/System/Exception.cs
+++ b/mcs/class/corlib/System/Exception.cs
@@ -304,11 +304,7 @@ namespace System
info.AddValue ("RemoteStackTraceString", _remoteStackTraceString);
info.AddValue ("RemoteStackIndex", remote_stack_index);
info.AddValue ("HResult", hresult);
-#if !MOONLIGHT
info.AddValue ("Source", Source);
-#else
- info.AddValue ("Source", null);
-#endif
info.AddValue ("ExceptionMethod", null);
info.AddValue ("Data", _data, typeof (IDictionary));
}
diff --git a/mcs/class/corlib/System/ExecutionEngineException.cs b/mcs/class/corlib/System/ExecutionEngineException.cs
index 980d85155a0..f23140d9594 100644
--- a/mcs/class/corlib/System/ExecutionEngineException.cs
+++ b/mcs/class/corlib/System/ExecutionEngineException.cs
@@ -35,7 +35,7 @@ using System.Runtime.InteropServices;
namespace System
{
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
[Obsolete]
#endif
[Serializable]
diff --git a/mcs/class/corlib/System/Funcs.cs b/mcs/class/corlib/System/Funcs.cs
index d384e8855fb..3ef4bb6134a 100644
--- a/mcs/class/corlib/System/Funcs.cs
+++ b/mcs/class/corlib/System/Funcs.cs
@@ -72,21 +72,5 @@ namespace System {
#else
// Used internally
delegate TResult Func<T1, T2, T3, TResult> (T1 arg1, T2 arg2, T3 arg3);
-#if MOONLIGHT
- public delegate TResult Func<T1, T2, T3, T4, TResult> (
- T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- public delegate TResult Func<T1, T2, T3, T4, T5, TResult> (
- T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
-
- public delegate TResult Func<T1, T2, T3, T4, T5, T6, TResult> (
- T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
-
- public delegate TResult Func<T1, T2, T3, T4, T5, T6, T7, TResult> (
- T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
-
- public delegate TResult Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> (
- T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-#endif
#endif
}
diff --git a/mcs/class/corlib/System/GC.cs b/mcs/class/corlib/System/GC.cs
index 4c56588a794..1d9122e1a62 100644
--- a/mcs/class/corlib/System/GC.cs
+++ b/mcs/class/corlib/System/GC.cs
@@ -145,7 +145,7 @@ namespace System
}
#endif
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern static void register_ephemeron_array (Ephemeron[] array);
diff --git a/mcs/class/corlib/System/Guid.cs b/mcs/class/corlib/System/Guid.cs
index 7a235f9da6f..5801ffc6c0f 100644
--- a/mcs/class/corlib/System/Guid.cs
+++ b/mcs/class/corlib/System/Guid.cs
@@ -699,7 +699,7 @@ namespace System {
return !( a.Equals (b) );
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public static Guid Parse (string input)
{
if (input == null)
@@ -767,7 +767,7 @@ namespace System {
case 'P':
case 'p':
return Format.P;
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
case 'X':
case 'x':
return Format.X;
@@ -775,7 +775,7 @@ namespace System {
}
throw new FormatException (
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
"Format String can be only one of \"D\", \"d\", \"N\", \"n\", \"P\", \"p\", \"B\", \"b\", \"X\" or \"x\""
#else
"Format String can be only one of \"D\", \"d\", \"N\", \"n\", \"P\", \"p\", \"B\" or \"b\""
diff --git a/mcs/class/corlib/System/InvalidTimeZoneException.cs b/mcs/class/corlib/System/InvalidTimeZoneException.cs
index f2f7e79a8e2..0f019b9916e 100644
--- a/mcs/class/corlib/System/InvalidTimeZoneException.cs
+++ b/mcs/class/corlib/System/InvalidTimeZoneException.cs
@@ -24,7 +24,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System.Runtime.CompilerServices;
diff --git a/mcs/class/corlib/System/Lazy.cs b/mcs/class/corlib/System/Lazy.cs
index a98b7d95a6c..5449d87ab09 100644
--- a/mcs/class/corlib/System/Lazy.cs
+++ b/mcs/class/corlib/System/Lazy.cs
@@ -27,7 +27,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System;
using System.Runtime.Serialization;
diff --git a/mcs/class/corlib/System/STAThreadAttribute.cs b/mcs/class/corlib/System/STAThreadAttribute.cs
index 55e6c9118d4..754ad34f834 100644
--- a/mcs/class/corlib/System/STAThreadAttribute.cs
+++ b/mcs/class/corlib/System/STAThreadAttribute.cs
@@ -33,9 +33,6 @@ using System.Runtime.InteropServices;
namespace System
{
-#if MOONLIGHT
- [Obsolete ("STAThreadAttribute is not supported in this release. It has been left in so that legacy tools can be used with this release, but it cannot be used in your code.", true)]
-#endif
[AttributeUsage (AttributeTargets.Method)]
[ComVisible (true)]
public sealed class STAThreadAttribute : Attribute
diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs
index fb595c643b2..1fe0743c0da 100644
--- a/mcs/class/corlib/System/String.cs
+++ b/mcs/class/corlib/System/String.cs
@@ -312,7 +312,7 @@ namespace System
}
// .NET 2.0 compatibility only
-#if !NET_4_0 && !MOONLIGHT && !MOBILE
+#if !NET_4_0 && !MOBILE
static readonly char[] WhiteChars = {
(char) 0x9, (char) 0xA, (char) 0xB, (char) 0xC, (char) 0xD,
(char) 0x85, (char) 0x1680, (char) 0x2028, (char) 0x2029,
@@ -324,7 +324,7 @@ namespace System
unsafe string[] SplitByCharacters (char[] sep, int count, bool removeEmpty)
{
-#if !NET_4_0 && !MOONLIGHT && !MOBILE
+#if !NET_4_0 && !MOBILE
if (sep == null || sep.Length == 0)
sep = WhiteChars;
#endif
@@ -1511,7 +1511,6 @@ namespace System
return (value == null) || (value.Length == 0);
}
-#if !MOONLIGHT
public string Normalize ()
{
return Normalization.Normalize (this, 0);
@@ -1549,7 +1548,6 @@ namespace System
return Normalization.IsNormalized (this, 3);
}
}
-#endif
public string Remove (int startIndex)
{
@@ -2335,7 +2333,7 @@ namespace System
return InternalIsInterned (str);
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public static string Join (string separator, params string [] value)
#else
public static string Join (string separator, string [] value)
@@ -2643,7 +2641,7 @@ namespace System
}
}
-#if MOONLIGHT || MOBILE || NET_4_0
+#if MOBILE || NET_4_0
[ComVisible(false)]
public static string Concat (IEnumerable<string> values)
{
diff --git a/mcs/class/corlib/System/TimeSpan.cs b/mcs/class/corlib/System/TimeSpan.cs
index 25918db80e5..6f322d0f868 100644
--- a/mcs/class/corlib/System/TimeSpan.cs
+++ b/mcs/class/corlib/System/TimeSpan.cs
@@ -39,7 +39,7 @@ namespace System
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable <TimeSpan>
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
, IFormattable
#endif
{
@@ -359,7 +359,7 @@ namespace System
return p.Execute (true, out result);
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public static TimeSpan Parse (string input, IFormatProvider formatProvider)
{
if (input == null)
@@ -526,7 +526,7 @@ namespace System
return sb.ToString ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public string ToString (string format)
{
return ToString (format, null);
@@ -719,7 +719,7 @@ namespace System
private int _cur = 0;
private int _length;
ParseError parse_error;
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
bool parsed_ticks;
NumberFormatInfo number_format;
int parsed_numbers_count;
@@ -735,12 +735,12 @@ namespace System
{
_src = src;
_length = _src.Length;
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
number_format = GetNumberFormatInfo (null);
#endif
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
// Reset state data, so we can execute another parse over the input.
void Reset ()
{
@@ -806,7 +806,7 @@ namespace System
return res;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
// Used for custom formats parsing, where we may need to declare how
// many digits we expect, as well as the maximum allowed.
private int ParseIntExact (int digit_count, int max_digit_count)
@@ -855,7 +855,7 @@ namespace System
if (!optional && (count == 0))
SetParseError (ParseError.Format);
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
if (count > 0)
parsed_numbers_count++;
#endif
@@ -863,7 +863,7 @@ namespace System
return (int)res;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
// This behaves pretty much like ParseOptDot, but we need to have it
// as a separated routine for both days and decimal separators.
private bool ParseOptDaysSeparator ()
@@ -962,7 +962,7 @@ namespace System
if (!digitseen)
SetParseError (ParseError.Format);
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
else if (!AtEnd && Char.IsDigit (_src, _cur))
SetParseError (ParseError.Overflow);
@@ -972,7 +972,7 @@ namespace System
return res;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
// Used by custom formats parsing
// digits_count = 0 for digits up to max_digits_count (optional), and other value to
// force a precise number of digits.
@@ -1006,7 +1006,7 @@ namespace System
parse_error = error;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
bool CheckParseSuccess (bool tryParse)
#else
bool CheckParseSuccess (int hours, int minutes, int seconds, bool tryParse)
@@ -1014,7 +1014,7 @@ namespace System
{
// We always report the first error, but for 2.0 we need to give a higher
// precence to per-element overflow (as opposed to int32 overflow).
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
if (parse_error == ParseError.Overflow) {
#else
if (parse_error == ParseError.Overflow || hours > 23 || minutes > 59 || seconds > 59) {
@@ -1035,7 +1035,7 @@ namespace System
return true;
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
// We are using a different parse approach in 4.0, due to some changes in the behaviour
// of the parse routines.
// The input string is documented as:
@@ -1219,7 +1219,7 @@ namespace System
}
#endif
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public bool ExecuteWithFormat (string format, TimeSpanStyles style, bool tryParse, out TimeSpan result)
{
int days, hours, minutes, seconds;
@@ -1326,7 +1326,7 @@ namespace System
}
#endif
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
enum FormatElementType
{
Days,
diff --git a/mcs/class/corlib/System/TimeZoneNotFoundException.cs b/mcs/class/corlib/System/TimeZoneNotFoundException.cs
index fe8660e27e2..e01f915faec 100644
--- a/mcs/class/corlib/System/TimeZoneNotFoundException.cs
+++ b/mcs/class/corlib/System/TimeZoneNotFoundException.cs
@@ -24,7 +24,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System.Runtime.CompilerServices;
diff --git a/mcs/class/corlib/System/Tuple.cs b/mcs/class/corlib/System/Tuple.cs
index ad07696f7ca..e89175f73d1 100644
--- a/mcs/class/corlib/System/Tuple.cs
+++ b/mcs/class/corlib/System/Tuple.cs
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if MOONLIGHT || NET_4_0 || MOBILE
+#if NET_4_0 || MOBILE
using System;
diff --git a/mcs/class/corlib/System/Tuples.cs b/mcs/class/corlib/System/Tuples.cs
index 6256a029ebb..93c9999f5e7 100644
--- a/mcs/class/corlib/System/Tuples.cs
+++ b/mcs/class/corlib/System/Tuples.cs
@@ -27,7 +27,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if MOONLIGHT || NET_4_0 || MOBILE
+#if NET_4_0 || MOBILE
using System;
using System.Collections;
diff --git a/mcs/class/corlib/System/TypeAccessException.cs b/mcs/class/corlib/System/TypeAccessException.cs
index 58df33a0538..2e2752e63e3 100644
--- a/mcs/class/corlib/System/TypeAccessException.cs
+++ b/mcs/class/corlib/System/TypeAccessException.cs
@@ -25,7 +25,7 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
diff --git a/mcs/class/corlib/System/Version.cs b/mcs/class/corlib/System/Version.cs
index 9138e8db291..036be2fe412 100644
--- a/mcs/class/corlib/System/Version.cs
+++ b/mcs/class/corlib/System/Version.cs
@@ -306,7 +306,7 @@ namespace System {
return v1.CompareTo (v2) <= 0;
}
-#if BOOSTRAP_NET_4_0 || NET_4_0 || MOONLIGHT || MOBILE
+#if BOOSTRAP_NET_4_0 || NET_4_0 || MOBILE
public static Version Parse (string input)
{
// Exactly the same as calling Version(string) .ctor
diff --git a/mcs/class/corlib/System/_AppDomain.cs b/mcs/class/corlib/System/_AppDomain.cs
index de5103a639a..7bf3ed2109d 100644
--- a/mcs/class/corlib/System/_AppDomain.cs
+++ b/mcs/class/corlib/System/_AppDomain.cs
@@ -46,13 +46,10 @@ namespace System
[Guid ("05F696DC-2B29-3663-AD8B-C4389CF2A713")]
public interface _AppDomain
{
-#if !MOONLIGHT
string BaseDirectory {get; }
string DynamicDirectory {get; }
Evidence Evidence {get; }
-#endif
string FriendlyName {get; }
-#if !MOONLIGHT
string RelativeSearchPath {get; }
bool ShadowCopyFiles {get; }
@@ -64,9 +61,7 @@ namespace System
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
void ClearShadowCopyPath ();
-#endif
-#if !MOONLIGHT
ObjectHandle CreateInstance (string assemblyName, string typeName);
ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes);
ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
@@ -78,7 +73,6 @@ namespace System
ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
object[] activationAttributes, Evidence securityAttributes);
-#endif
#if !FULL_AOT_RUNTIME
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access);
@@ -114,16 +108,12 @@ namespace System
#if !NET_4_0
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
#endif
-#if !MOONLIGHT
object GetLifetimeService ();
-#endif
Type GetType ();
-#if !MOONLIGHT
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
object InitializeLifetimeService ();
-#endif
Assembly Load (AssemblyName assemblyRef);
Assembly Load (byte[] rawAssembly);
@@ -133,25 +123,21 @@ namespace System
Assembly Load (string assemblyString, Evidence assemblySecurity);
Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence);
-#if !MOONLIGHT
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
void SetAppDomainPolicy (PolicyLevel domainPolicy);
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
void SetCachePath (string s);
-#endif
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
void SetData (string name, object data);
-#if !MOONLIGHT
void SetPrincipalPolicy (PrincipalPolicy policy);
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
void SetShadowCopyPath (string s);
void SetThreadPrincipal (IPrincipal principal);
-#endif
string ToString ();
diff --git a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs b/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
index e314786fa4c..1897640d7f5 100644
--- a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
+++ b/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
@@ -535,7 +535,7 @@ namespace MonoTests.System.Text {
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
[Test]
public void ClearMethod () {
StringBuilder sb = new StringBuilder ("Text");