diff --git a/configure.REMOVED.git-id b/configure.REMOVED.git-id
index 947b75d485..32e9dd930f 100644
--- a/configure.REMOVED.git-id
+++ b/configure.REMOVED.git-id
@@ -1 +1 @@
-2d6bcb46584f03dd01cd55dd2a04c15b4a6a5fec
\ No newline at end of file
+047d2af192055dda39f35c668102b5948e87c44b
\ No newline at end of file
diff --git a/configure.ac.REMOVED.git-id b/configure.ac.REMOVED.git-id
index bfca3277f3..a702a388ec 100644
--- a/configure.ac.REMOVED.git-id
+++ b/configure.ac.REMOVED.git-id
@@ -1 +1 @@
-b0b5573ff57c299411be9915864eaa21d4933c2d
\ No newline at end of file
+2517961607b5dcd9778743fe589d6ff7f167a776
\ No newline at end of file
diff --git a/external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs b/external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs
index 48a8467961..b0586886a1 100644
--- a/external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs
+++ b/external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs
@@ -59,7 +59,7 @@ namespace System.Security.Cryptography {
public const string Sha512 = "SHA512"; // BCRYPT_SHA512_ALGORITHM
internal const string Rsa = "RSA"; // BCRYPT_RSA_ALGORITHM
}
-
+#if !MONO
///
/// Well known key blob tyes
///
@@ -454,5 +454,6 @@ namespace System.Security.Cryptography {
}
return keyBlob;
}
+#endif
}
}
diff --git a/external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs b/external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs
index 13ea41c2fb..4687087801 100644
--- a/external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs
+++ b/external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs
@@ -31,6 +31,10 @@ namespace System.Security.Cryptography {
///
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class CngKey : IDisposable {
+#if MONO
+ public void Dispose() {
+ }
+#else
private SafeNCryptKeyHandle m_keyHandle;
private SafeNCryptProviderHandle m_kspHandle;
@@ -816,5 +820,6 @@ namespace System.Security.Cryptography {
Contract.Assert(m_keyHandle != null);
NCryptNative.SetProperty(m_keyHandle, property.Name, property.Value, property.Options);
}
+#endif
}
}
diff --git a/external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs b/external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
index 40505e30dd..c1f169ead6 100644
--- a/external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
+++ b/external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
@@ -18,6 +18,15 @@ namespace System.Security.Cryptography {
///
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class ECDsaCng : ECDsa {
+#if MONO
+ public override byte[] SignHash(byte[] hash) {
+ throw new NotImplementedException();
+ }
+
+ public override bool VerifyHash(byte[] hash, byte[] signature) {
+ throw new NotImplementedException();
+ }
+#else
private static KeySizes[] s_legalKeySizes = new KeySizes[] { new KeySizes(256, 384, 128), new KeySizes(521, 521, 0) };
private CngKey m_key;
@@ -407,5 +416,6 @@ namespace System.Security.Cryptography {
return hasher.HashFinal();
}
}
+ #endif
}
}
diff --git a/external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs b/external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
index cf56209111..8807a43424 100644
--- a/external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
+++ b/external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
@@ -8,7 +8,9 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
+#if !MONO
using System.Numerics;
+#endif
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
@@ -100,7 +102,7 @@ namespace System.Security.Cryptography {
ProtectKey = 0x00000001, // NCRYPT_UI_PROTECT_KEY_FLAG
ForceHighProtection = 0x00000002 // NCRYPT_UI_FORCE_HIGH_PROTECTION_FLAG
}
-
+#if !MONO
///
/// Native interop with CNG's NCrypt layer. Native definitions are in ncrypt.h
///
@@ -1741,4 +1743,5 @@ namespace System.Security.Cryptography {
return error == ErrorCode.Success;
}
}
+#endif
}
diff --git a/external/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs b/external/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs
index 3085b90e24..842c40428e 100644
--- a/external/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs
+++ b/external/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs
@@ -10,6 +10,18 @@ namespace System.Security.Cryptography
{
public sealed class RSACng : RSA
{
+#if MONO
+ public override RSAParameters ExportParameters(bool includePrivateParameters)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void ImportParameters(RSAParameters parameters)
+ {
+ throw new NotImplementedException();
+ }
+#else
+
// See https://msdn.microsoft.com/en-us/library/windows/desktop/bb931354(v=vs.85).aspx
private static KeySizes[] s_legalKeySizes = new KeySizes[] { new KeySizes(512, 16384, 64) };
@@ -504,5 +516,6 @@ namespace System.Security.Cryptography
throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode));
}
}
+#endif
}
}
diff --git a/external/referencesource/System/compmod/microsoft/win32/safehandles/SafeProcessHandle.cs b/external/referencesource/System/compmod/microsoft/win32/safehandles/SafeProcessHandle.cs
index db23ebe146..05f3f5a7fa 100644
--- a/external/referencesource/System/compmod/microsoft/win32/safehandles/SafeProcessHandle.cs
+++ b/external/referencesource/System/compmod/microsoft/win32/safehandles/SafeProcessHandle.cs
@@ -42,10 +42,11 @@ namespace Microsoft.Win32.SafeHandles {
SetHandle(existingHandle);
}
+#if !MONO
[DllImport(ExternDll.Kernel32, CharSet=System.Runtime.InteropServices.CharSet.Auto, SetLastError=true)]
[ResourceExposure(ResourceScope.Machine)]
internal static extern SafeProcessHandle OpenProcess(int access, bool inherit, int processId);
-
+#endif
internal void InitialSetHandle(IntPtr h){
Debug.Assert(base.IsInvalid, "Safe handle should only be set once");
@@ -54,7 +55,11 @@ namespace Microsoft.Win32.SafeHandles {
override protected bool ReleaseHandle()
{
+#if !MONO
return SafeNativeMethods.CloseHandle(handle);
+#else
+ return NativeMethods.CloseProcess (handle);
+#endif
}
}
diff --git a/mcs/build/common/Consts.cs b/mcs/build/common/Consts.cs
index c92a3e168c..7233680038 100644
--- a/mcs/build/common/Consts.cs
+++ b/mcs/build/common/Consts.cs
@@ -34,7 +34,7 @@ static class Consts
// Use these assembly version constants to make code more maintainable.
//
- public const string MonoVersion = "4.4.1.0";
+ public const string MonoVersion = "4.4.2.0";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";
diff --git a/mcs/class/Facades/Makefile b/mcs/class/Facades/Makefile
index 2f8847d707..44f8521514 100644
--- a/mcs/class/Facades/Makefile
+++ b/mcs/class/Facades/Makefile
@@ -28,7 +28,7 @@ include $(MCS_BUILD_DIR)/rules.make
dist-local: dist-default
-DIST_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
+DIST_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS) $(net_4_x_SUBDIRS) $(mobile_only_SUBDIRS)
DISTFILES=subdirs.make
doc-update-local:
@@ -37,4 +37,7 @@ doc-update-local:
doc-update-recursive:
@echo "do not recurse the Facades folder"
-System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Runtime.Serialization System.XML System.ComponentModel.Composition System.ServiceModel System.Xml.Linq:
+System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Runtime.Serialization System.XML \
+System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.IO.Compression.FileSystem \
+System.ServiceProcess System.Security System.Net.Http.WebRequest System.Net.Http:
+
diff --git a/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Microsoft.Win32.Registry.AccessControl.dll.sources b/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Microsoft.Win32.Registry.AccessControl.dll.sources
index 8e33d4ddea..9cd503ee02 100644
--- a/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Microsoft.Win32.Registry.AccessControl.dll.sources
+++ b/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Microsoft.Win32.Registry.AccessControl.dll.sources
@@ -1,3 +1,5 @@
TypeForwarders.cs
AssemblyInfo.cs
+../../../build/common/MonoTODOAttribute.cs
+RegistryAclExtensions.cs
diff --git a/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/RegistryAclExtensions.cs b/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/RegistryAclExtensions.cs
new file mode 100644
index 0000000000..deb3458cc8
--- /dev/null
+++ b/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/RegistryAclExtensions.cs
@@ -0,0 +1,57 @@
+//
+// RegistryAclExtensions.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Security;
+using System.Security.AccessControl;
+
+namespace Microsoft.Win32
+{
+ public static class RegistryAclExtensions
+ {
+ [MonoTODO]
+ public static RegistrySecurity GetAccessControl (this RegistryKey key)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static RegistrySecurity GetAccessControl (this RegistryKey key, AccessControlSections includeSections)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void SetAccessControl (this RegistryKey key, RegistrySecurity registrySecurity)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/TypeForwarders.cs b/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/TypeForwarders.cs
index cb252be1af..bdef197230 100644
--- a/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/TypeForwarders.cs
+++ b/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/TypeForwarders.cs
@@ -23,4 +23,3 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AccessControl.RegistryAccessRule))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AccessControl.RegistryAuditRule))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AccessControl.RegistrySecurity))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.RegistryAclExtensions))]
diff --git a/mcs/class/Facades/Microsoft.Win32.Registry/TypeForwarders.cs b/mcs/class/Facades/Microsoft.Win32.Registry/TypeForwarders.cs
index ecf772dd7e..fae8514159 100644
--- a/mcs/class/Facades/Microsoft.Win32.Registry/TypeForwarders.cs
+++ b/mcs/class/Facades/Microsoft.Win32.Registry/TypeForwarders.cs
@@ -20,13 +20,11 @@
// THE SOFTWARE.
//
-#if !MOBILE
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.Registry))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.RegistryHive))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.RegistryKey))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.RegistryValueKind))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.RegistryValueOptions))]
-#endif
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.RegistryOptions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.RegistryView))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeRegistryHandle))]
diff --git a/mcs/class/Facades/System.ComponentModel.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.ComponentModel.Primitives/TypeForwarders.cs
index 81a899b5e0..710df4ecd2 100644
--- a/mcs/class/Facades/System.ComponentModel.Primitives/TypeForwarders.cs
+++ b/mcs/class/Facades/System.ComponentModel.Primitives/TypeForwarders.cs
@@ -20,9 +20,27 @@
// THE SOFTWARE.
//
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.BrowsableAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CategoryAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ComponentCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DescriptionAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DesignOnlyAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DesignerCategoryAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DesignerSerializationVisibility))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DesignerSerializationVisibilityAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DisplayNameAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.EventHandlerList))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.IComponent))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.IContainer))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ISite))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ImmutableObjectAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.InitializationEventAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.LocalizableAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.MergablePropertyAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.NotifyParentPropertyAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ParenthesizePropertyNameAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ReadOnlyAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.RefreshProperties))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.RefreshPropertiesAttribute))]
diff --git a/mcs/class/Facades/System.ComponentModel.TypeConverter/TypeForwarders.cs b/mcs/class/Facades/System.ComponentModel.TypeConverter/TypeForwarders.cs
index 4a50ae332d..12d2434bfc 100644
--- a/mcs/class/Facades/System.ComponentModel.TypeConverter/TypeForwarders.cs
+++ b/mcs/class/Facades/System.ComponentModel.TypeConverter/TypeForwarders.cs
@@ -21,34 +21,61 @@
//
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ArrayConverter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.AttributeCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.AttributeProviderAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.BaseNumberConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.BooleanConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ByteConverter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CancelEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CharConverter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CollectionChangeAction))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CollectionChangeEventArgs))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CollectionChangeEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CollectionConverter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CustomTypeDescriptor))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DateTimeConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DateTimeOffsetConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DecimalConverter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DefaultEventAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DefaultPropertyAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DoubleConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.EnumConverter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.EventDescriptor))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.EventDescriptorCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ExtenderProvidedPropertyAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.GuidConverter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.HandledEventArgs))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.HandledEventHandler))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ICustomTypeDescriptor))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.IExtenderProvider))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.IListSource))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ITypeDescriptorContext))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ITypedList))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.Int16Converter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.Int32Converter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.Int64Converter))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ITypeDescriptorContext))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.InvalidAsynchronousStateException))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.MemberDescriptor))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.MultilineStringConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.NullableConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.PropertyDescriptor))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.PropertyDescriptorCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.ProvidePropertyAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.RefreshEventArgs))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.RefreshEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.SByteConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.SingleConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.StringConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.TimeSpanConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.TypeConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.TypeConverterAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.TypeDescriptionProvider))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.TypeDescriptionProviderAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.TypeDescriptor))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.TypeListConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.UInt16Converter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.UInt32Converter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.UInt64Converter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriTypeConverter))]
diff --git a/mcs/class/Facades/System.Console/TypeForwarders.cs b/mcs/class/Facades/System.Console/TypeForwarders.cs
index 5987d7bb1f..c1695f51f4 100644
--- a/mcs/class/Facades/System.Console/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Console/TypeForwarders.cs
@@ -24,6 +24,7 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ConsoleCancelEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ConsoleCancelEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ConsoleColor))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ConsoleKey))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ConsoleKeyInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ConsoleModifiers))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ConsoleSpecialKey))]
-
-
diff --git a/mcs/class/Facades/System.Data.Common/DbColumn.cs b/mcs/class/Facades/System.Data.Common/DbColumn.cs
new file mode 100644
index 0000000000..f7bc5c713e
--- /dev/null
+++ b/mcs/class/Facades/System.Data.Common/DbColumn.cs
@@ -0,0 +1,64 @@
+//
+// DbColumn.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections.Generic;
+
+namespace System.Data.Common
+{
+ public abstract class DbColumn
+ {
+ public bool? AllowDBNull { get; protected set; }
+ public string BaseCatalogName { get; protected set; }
+ public string BaseColumnName { get; protected set; }
+ public string BaseSchemaName { get; protected set; }
+ public string BaseServerName { get; protected set; }
+ public string BaseTableName { get; protected set; }
+ public string ColumnName { get; protected set; }
+ public int? ColumnOrdinal { get; protected set; }
+ public int? ColumnSize { get; protected set; }
+ public bool? IsAliased { get; protected set; }
+ public bool? IsAutoIncrement { get; protected set; }
+ public bool? IsExpression { get; protected set; }
+ public bool? IsHidden { get; protected set; }
+ public bool? IsIdentity { get; protected set; }
+ public bool? IsKey { get; protected set; }
+ public bool? IsLong { get; protected set; }
+ public bool? IsReadOnly { get; protected set; }
+ public bool? IsUnique { get; protected set; }
+ public int? NumericPrecision { get; protected set; }
+ public int? NumericScale { get; protected set; }
+ public string UdtAssemblyQualifiedName { get; protected set; }
+ public Type DataType { get; protected set; }
+ public string DataTypeName { get; protected set; }
+ public virtual object this[string property] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Data.Common/DbDataReaderExtensions.Facade.cs b/mcs/class/Facades/System.Data.Common/DbDataReaderExtensions.Facade.cs
new file mode 100644
index 0000000000..ba1913ff9f
--- /dev/null
+++ b/mcs/class/Facades/System.Data.Common/DbDataReaderExtensions.Facade.cs
@@ -0,0 +1,85 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Collections.Generic;
+
+namespace System.Data.Common
+{
+
+ internal class DataRowDbColumn : DbColumn
+ {
+ private DataColumnCollection schemaColumns;
+ private DataRow schemaRow;
+
+ public DataRowDbColumn(DataRow readerSchemaRow, DataColumnCollection readerSchemaColumns)
+ {
+ this.schemaRow = readerSchemaRow;
+ this.schemaColumns = readerSchemaColumns;
+ populateFields();
+ }
+
+ private void populateFields()
+ {
+ AllowDBNull = GetDbColumnValue(SchemaTableColumn.AllowDBNull);
+ BaseCatalogName = GetDbColumnValue(SchemaTableOptionalColumn.BaseCatalogName);
+ BaseColumnName = GetDbColumnValue(SchemaTableColumn.BaseColumnName);
+ BaseSchemaName = GetDbColumnValue(SchemaTableColumn.BaseSchemaName);
+ BaseServerName = GetDbColumnValue(SchemaTableOptionalColumn.BaseServerName);
+ BaseTableName = GetDbColumnValue(SchemaTableColumn.BaseTableName);
+ ColumnName = GetDbColumnValue(SchemaTableColumn.ColumnName);
+ ColumnOrdinal = GetDbColumnValue(SchemaTableColumn.ColumnOrdinal);
+ ColumnSize = GetDbColumnValue(SchemaTableColumn.ColumnSize);
+ IsAliased = GetDbColumnValue(SchemaTableColumn.IsAliased);
+ IsAutoIncrement = GetDbColumnValue(SchemaTableOptionalColumn.IsAutoIncrement);
+ IsExpression = GetDbColumnValue(SchemaTableColumn.IsExpression);
+ IsHidden = GetDbColumnValue(SchemaTableOptionalColumn.IsHidden);
+ IsIdentity = GetDbColumnValue("IsIdentity");
+ IsKey = GetDbColumnValue(SchemaTableColumn.IsKey);
+ IsLong = GetDbColumnValue(SchemaTableColumn.IsLong);
+ IsReadOnly = GetDbColumnValue(SchemaTableOptionalColumn.IsReadOnly);
+ IsUnique = GetDbColumnValue(SchemaTableColumn.IsUnique);
+ NumericPrecision = GetDbColumnValue(SchemaTableColumn.NumericPrecision);
+ NumericScale = GetDbColumnValue(SchemaTableColumn.NumericScale);
+ UdtAssemblyQualifiedName = GetDbColumnValue("UdtAssemblyQualifiedName");
+ DataType = GetDbColumnValue(SchemaTableColumn.DataType);
+ DataTypeName = GetDbColumnValue("DataTypeName");
+ }
+
+ private T GetDbColumnValue(string columnName)
+ {
+ if (!schemaColumns.Contains(columnName))
+ {
+ return default(T);
+ }
+ object schemaObject = schemaRow[columnName];
+ if (schemaObject is T)
+ {
+ return (T)schemaObject;
+ }
+ return default(T);
+ }
+ }
+
+ public static class DbDataReaderExtensions
+ {
+ public static System.Collections.ObjectModel.ReadOnlyCollection GetColumnSchema(this DbDataReader reader)
+ {
+ IList columnSchema = new List();
+ DataTable schemaTable = reader.GetSchemaTable();
+ DataColumnCollection schemaTableColumns = schemaTable.Columns;
+ foreach (DataRow row in schemaTable.Rows)
+ {
+ DbColumn dbColumn = new DataRowDbColumn(row, schemaTableColumns);
+ columnSchema.Add(dbColumn);
+ }
+ System.Collections.ObjectModel.ReadOnlyCollection readOnlyColumnSchema = new System.Collections.ObjectModel.ReadOnlyCollection(columnSchema);
+ return readOnlyColumnSchema;
+ }
+
+ public static bool CanGetColumnSchema(this DbDataReader reader)
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Data.Common/IDbColumnSchemaGenerator.cs b/mcs/class/Facades/System.Data.Common/IDbColumnSchemaGenerator.cs
new file mode 100644
index 0000000000..ed6c519bf1
--- /dev/null
+++ b/mcs/class/Facades/System.Data.Common/IDbColumnSchemaGenerator.cs
@@ -0,0 +1,35 @@
+//
+// IDbColumnSchemaGenerator.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Data.Common
+{
+ public interface IDbColumnSchemaGenerator
+ {
+ System.Collections.ObjectModel.ReadOnlyCollection GetColumnSchema();
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Data.Common/Makefile b/mcs/class/Facades/System.Data.Common/Makefile
index 0b46feb66d..fb90e9b6d5 100644
--- a/mcs/class/Facades/System.Data.Common/Makefile
+++ b/mcs/class/Facades/System.Data.Common/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Data.Common.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
+LIB_REFS = System System.Xml
LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Data.dll
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Data.Common/System.Data.Common.dll.sources b/mcs/class/Facades/System.Data.Common/System.Data.Common.dll.sources
index 8e33d4ddea..6b72354973 100644
--- a/mcs/class/Facades/System.Data.Common/System.Data.Common.dll.sources
+++ b/mcs/class/Facades/System.Data.Common/System.Data.Common.dll.sources
@@ -1,3 +1,5 @@
TypeForwarders.cs
AssemblyInfo.cs
-
+IDbColumnSchemaGenerator.cs
+DbColumn.cs
+DbDataReaderExtensions.Facade.cs
diff --git a/mcs/class/Facades/System.Data.Common/TypeForwarders.cs b/mcs/class/Facades/System.Data.Common/TypeForwarders.cs
index 52b199a2e6..9470c9c78b 100644
--- a/mcs/class/Facades/System.Data.Common/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Data.Common/TypeForwarders.cs
@@ -20,24 +20,36 @@
// THE SOFTWARE.
//
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DBNull))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.CommandBehavior))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.CommandType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbCommand))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbConnection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbConnectionStringBuilder))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataReader))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataRecord))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbParameter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbParameterCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbProviderFactory))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbTransaction))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConnectionState))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowVersion))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTable))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DbType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataParameter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataParameterCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataReader))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataRecord))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbCommand))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbConnection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbDataParameter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbTransaction))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IsolationLevel))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ParameterDirection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StateChangeEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StateChangeEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.UpdateRowSource))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DBNull))]
diff --git a/mcs/class/Facades/System.Data.SqlClient/TypeForwarders.cs b/mcs/class/Facades/System.Data.SqlClient/TypeForwarders.cs
index d930326b45..3237d9eb98 100644
--- a/mcs/class/Facades/System.Data.SqlClient/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Data.SqlClient/TypeForwarders.cs
@@ -24,6 +24,10 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.SqlServer.Server.SqlMetaData))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.ApplicationIntent))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SortOrder))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlBulkCopy))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlBulkCopyColumnMapping))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlBulkCopyColumnMappingCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlBulkCopyOptions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlClientFactory))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlCommand))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlConnection))]
@@ -36,6 +40,8 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlInfoMessageEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlParameter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlParameterCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlRowsCopiedEventArgs))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlRowsCopiedEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlTransaction))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlDbType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.INullable))]
diff --git a/mcs/class/Facades/System.Diagnostics.Process/TypeForwarders.cs b/mcs/class/Facades/System.Diagnostics.Process/TypeForwarders.cs
index 7601feb313..e91a664406 100644
--- a/mcs/class/Facades/System.Diagnostics.Process/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Diagnostics.Process/TypeForwarders.cs
@@ -20,7 +20,7 @@
// THE SOFTWARE.
//
-// TODO: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeProcessHandle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeProcessHandle))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.DataReceivedEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.DataReceivedEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Process))]
diff --git a/mcs/class/Facades/System.Diagnostics.StackTrace/StackFrameExtensions.cs b/mcs/class/Facades/System.Diagnostics.StackTrace/StackFrameExtensions.cs
new file mode 100644
index 0000000000..1fb375f6fa
--- /dev/null
+++ b/mcs/class/Facades/System.Diagnostics.StackTrace/StackFrameExtensions.cs
@@ -0,0 +1,61 @@
+//
+// StackFrameExtensions.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace System.Diagnostics
+{
+ public static class StackFrameExtensions
+ {
+ [MonoTODO]
+ public static bool HasNativeImage (this StackFrame stackFrame)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static bool HasMethod (this StackFrame stackFrame)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static bool HasILOffset (this StackFrame stackFrame)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static bool HasSource (this StackFrame stackFrame)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Diagnostics.StackTrace/System.Diagnostics.StackTrace.dll.sources b/mcs/class/Facades/System.Diagnostics.StackTrace/System.Diagnostics.StackTrace.dll.sources
index 8e33d4ddea..9d113cec20 100644
--- a/mcs/class/Facades/System.Diagnostics.StackTrace/System.Diagnostics.StackTrace.dll.sources
+++ b/mcs/class/Facades/System.Diagnostics.StackTrace/System.Diagnostics.StackTrace.dll.sources
@@ -1,3 +1,5 @@
TypeForwarders.cs
AssemblyInfo.cs
+../../../build/common/MonoTODOAttribute.cs
+StackFrameExtensions.cs
diff --git a/mcs/class/Facades/System.Diagnostics.StackTrace/TypeForwarders.cs b/mcs/class/Facades/System.Diagnostics.StackTrace/TypeForwarders.cs
index b07464db3e..3643429a21 100644
--- a/mcs/class/Facades/System.Diagnostics.StackTrace/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Diagnostics.StackTrace/TypeForwarders.cs
@@ -22,5 +22,4 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackFrame))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackTrace))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackFrameExtensions))]
diff --git a/mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs b/mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs
new file mode 100644
index 0000000000..7fedc40688
--- /dev/null
+++ b/mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs
@@ -0,0 +1,41 @@
+//
+// EventCounter.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Diagnostics.Tracing
+{
+ public class EventCounter
+ {
+ public EventCounter (string name, EventSource eventSource)
+ {
+ }
+
+ public void WriteMetric (float value)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing.dll.sources b/mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing.dll.sources
index 8e33d4ddea..99a7bf6943 100644
--- a/mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing.dll.sources
+++ b/mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing.dll.sources
@@ -1,3 +1,3 @@
TypeForwarders.cs
AssemblyInfo.cs
-
+EventCounter.cs
diff --git a/mcs/class/Facades/System.Diagnostics.Tracing/TypeForwarders.cs b/mcs/class/Facades/System.Diagnostics.Tracing/TypeForwarders.cs
index 45d99c94ea..5c8ab29d77 100644
--- a/mcs/class/Facades/System.Diagnostics.Tracing/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Diagnostics.Tracing/TypeForwarders.cs
@@ -20,16 +20,27 @@
// THE SOFTWARE.
//
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventActivityOptions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventChannel))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventCommand))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventCommandEventArgs))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventDataAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventFieldAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventFieldFormat))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventFieldTags))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventIgnoreAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventKeywords))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventLevel))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventListener))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventOpcode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventListener))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventManifestOptions))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventOpcode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSource))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSourceAttribute))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSourceException))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventTask))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventWrittenEventArgs))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSourceException))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSourceOptions))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSourceSettings))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventTags))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventTask))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventWrittenEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.NonEventAttribute))]
diff --git a/mcs/class/Facades/System.Drawing.Primitives/AssemblyInfo.cs b/mcs/class/Facades/System.Drawing.Primitives/AssemblyInfo.cs
new file mode 100644
index 0000000000..fd9a20bfef
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/AssemblyInfo.cs
@@ -0,0 +1,39 @@
+//
+// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Drawing.Primitives.dll")]
+[assembly: AssemblyDescription ("System.Drawing.Primitives.dll")]
+[assembly: AssemblyDefaultAlias ("System.Drawing.Primitives.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
diff --git a/mcs/class/Facades/System.Drawing.Primitives/Makefile b/mcs/class/Facades/System.Drawing.Primitives/Makefile
new file mode 100644
index 0000000000..e788928d5b
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/Makefile
@@ -0,0 +1,27 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Drawing.Primitives
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Drawing.Primitives.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+ifneq (2.1, $(FRAMEWORK_VERSION))
+ifndef XAMMAC_4_5
+LIB_REFS += System.Drawing
+endif
+endif
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
diff --git a/mcs/class/Facades/System.Drawing.Primitives/System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..719628dc7c
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/System.Drawing.Primitives.dll.sources
@@ -0,0 +1,2 @@
+TypeForwarders.cs
+AssemblyInfo.cs
diff --git a/mcs/class/Facades/System.Drawing.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.Drawing.Primitives/TypeForwarders.cs
new file mode 100644
index 0000000000..af29167e6b
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/TypeForwarders.cs
@@ -0,0 +1,28 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.Point))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.PointF))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.Rectangle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.RectangleF))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.Size))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SizeF))]
diff --git a/mcs/class/Facades/System.Drawing.Primitives/mobile_System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/mobile_System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..dd5e421011
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/mobile_System.Drawing.Primitives.dll.sources
@@ -0,0 +1,8 @@
+AssemblyInfo.cs
+
+../../System.Drawing/System.Drawing/Point.cs
+../../System.Drawing/System.Drawing/PointF.cs
+../../System.Drawing/System.Drawing/Rectangle.cs
+../../System.Drawing/System.Drawing/RectangleF.cs
+../../System.Drawing/System.Drawing/Size.cs
+../../System.Drawing/System.Drawing/SizeF.cs
diff --git a/mcs/class/Facades/System.Drawing.Primitives/mobile_static_System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/mobile_static_System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..006657ab21
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/mobile_static_System.Drawing.Primitives.dll.sources
@@ -0,0 +1 @@
+#include mobile_System.Drawing.Primitives.dll.sources
diff --git a/mcs/class/Facades/System.Drawing.Primitives/monodroid_System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/monodroid_System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..006657ab21
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/monodroid_System.Drawing.Primitives.dll.sources
@@ -0,0 +1 @@
+#include mobile_System.Drawing.Primitives.dll.sources
diff --git a/mcs/class/Facades/System.Drawing.Primitives/monotouch_System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/monotouch_System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..006657ab21
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/monotouch_System.Drawing.Primitives.dll.sources
@@ -0,0 +1 @@
+#include mobile_System.Drawing.Primitives.dll.sources
diff --git a/mcs/class/Facades/System.Drawing.Primitives/monotouch_tv_System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/monotouch_tv_System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..006657ab21
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/monotouch_tv_System.Drawing.Primitives.dll.sources
@@ -0,0 +1 @@
+#include mobile_System.Drawing.Primitives.dll.sources
diff --git a/mcs/class/Facades/System.Drawing.Primitives/monotouch_watch_System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/monotouch_watch_System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..006657ab21
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/monotouch_watch_System.Drawing.Primitives.dll.sources
@@ -0,0 +1 @@
+#include mobile_System.Drawing.Primitives.dll.sources
diff --git a/mcs/class/Facades/System.Drawing.Primitives/xammac_System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/xammac_System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..006657ab21
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/xammac_System.Drawing.Primitives.dll.sources
@@ -0,0 +1 @@
+#include mobile_System.Drawing.Primitives.dll.sources
diff --git a/mcs/class/Facades/System.Drawing.Primitives/xammac_net_4_5_System.Drawing.Primitives.dll.sources b/mcs/class/Facades/System.Drawing.Primitives/xammac_net_4_5_System.Drawing.Primitives.dll.sources
new file mode 100644
index 0000000000..006657ab21
--- /dev/null
+++ b/mcs/class/Facades/System.Drawing.Primitives/xammac_net_4_5_System.Drawing.Primitives.dll.sources
@@ -0,0 +1 @@
+#include mobile_System.Drawing.Primitives.dll.sources
diff --git a/mcs/class/Facades/System.Globalization.Extensions/GlobalizationExtensions.cs b/mcs/class/Facades/System.Globalization.Extensions/GlobalizationExtensions.cs
new file mode 100644
index 0000000000..43c1494eca
--- /dev/null
+++ b/mcs/class/Facades/System.Globalization.Extensions/GlobalizationExtensions.cs
@@ -0,0 +1,98 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Diagnostics;
+using System.Diagnostics.Contracts;
+
+namespace System.Globalization
+{
+ public static class GlobalizationExtensions
+ {
+ public static StringComparer GetStringComparer(this CompareInfo compareInfo, CompareOptions options)
+ {
+ if (compareInfo == null)
+ {
+ throw new ArgumentNullException(nameof(compareInfo));
+ }
+
+ if (options == CompareOptions.Ordinal)
+ {
+ return StringComparer.Ordinal;
+ }
+
+ if (options == CompareOptions.OrdinalIgnoreCase)
+ {
+ return StringComparer.OrdinalIgnoreCase;
+ }
+
+ if ((options & CultureAwareComparer.ValidCompareMaskOffFlags) != 0)
+ {
+ throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options));
+ }
+
+ return new CultureAwareComparer(compareInfo, options);
+ }
+ }
+
+ internal sealed class CultureAwareComparer : StringComparer
+ {
+ internal const CompareOptions ValidCompareMaskOffFlags =
+ ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace |
+ CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType | CompareOptions.StringSort);
+
+ private readonly CompareInfo _compareInfo;
+ private readonly CompareOptions _options;
+
+ internal CultureAwareComparer(CompareInfo compareInfo, CompareOptions options)
+ {
+ Debug.Assert((options & ValidCompareMaskOffFlags) == 0);
+ _compareInfo = compareInfo;
+ _options = options;
+ }
+
+ public override int Compare(string x, string y)
+ {
+ if (Object.ReferenceEquals(x, y)) return 0;
+ if (x == null) return -1;
+ if (y == null) return 1;
+ return _compareInfo.Compare(x, y, _options);
+ }
+
+ public override bool Equals(string x, string y)
+ {
+ if (Object.ReferenceEquals(x, y)) return true;
+ if (x == null || y == null) return false;
+
+ return (_compareInfo.Compare(x, y, _options) == 0);
+ }
+
+ public override int GetHashCode(string obj)
+ {
+ if (obj == null)
+ {
+ throw new ArgumentNullException(nameof(obj));
+ }
+ Contract.EndContractBlock();
+
+ // StringSort used in compare operation and not with the hashing
+ return _compareInfo.GetHashCode(obj, _options & (~CompareOptions.StringSort));
+ }
+
+ // Equals method for the comparer itself.
+ public override bool Equals(object obj)
+ {
+ CultureAwareComparer comparer = obj as CultureAwareComparer;
+ return
+ comparer != null &&
+ _options == comparer._options &&
+ _compareInfo.Equals(comparer._compareInfo);
+ }
+
+ public override int GetHashCode()
+ {
+ return _compareInfo.GetHashCode() ^ ((int)_options & 0x7FFFFFFF);
+ }
+ }
+}
diff --git a/mcs/class/Facades/System.Globalization.Extensions/SR.cs b/mcs/class/Facades/System.Globalization.Extensions/SR.cs
new file mode 100644
index 0000000000..52a75a8e6d
--- /dev/null
+++ b/mcs/class/Facades/System.Globalization.Extensions/SR.cs
@@ -0,0 +1,4 @@
+partial class SR
+{
+ public const string Argument_InvalidFlag = "Value of flags is invalid.";
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Globalization.Extensions/StringNormalizationExtensions.cs b/mcs/class/Facades/System.Globalization.Extensions/StringNormalizationExtensions.cs
new file mode 100644
index 0000000000..7953b29b9a
--- /dev/null
+++ b/mcs/class/Facades/System.Globalization.Extensions/StringNormalizationExtensions.cs
@@ -0,0 +1,61 @@
+//
+// StringNormalizationExtensions.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System.Text;
+
+namespace System
+{
+ public static class StringNormalizationExtensions
+ {
+ [MonoTODO]
+ public static bool IsNormalized(this string value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static bool IsNormalized(this string value, NormalizationForm normalizationForm)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static String Normalize(this string value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static String Normalize(this string value, NormalizationForm normalizationForm)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
diff --git a/mcs/class/Facades/System.Globalization.Extensions/System.Globalization.Extensions.dll.sources b/mcs/class/Facades/System.Globalization.Extensions/System.Globalization.Extensions.dll.sources
index 8e33d4ddea..8cec8fa1ac 100644
--- a/mcs/class/Facades/System.Globalization.Extensions/System.Globalization.Extensions.dll.sources
+++ b/mcs/class/Facades/System.Globalization.Extensions/System.Globalization.Extensions.dll.sources
@@ -1,3 +1,7 @@
TypeForwarders.cs
AssemblyInfo.cs
+../../../build/common/MonoTODOAttribute.cs
+SR.cs
+GlobalizationExtensions.cs
+StringNormalizationExtensions.cs
diff --git a/mcs/class/Facades/System.Globalization.Extensions/TypeForwarders.cs b/mcs/class/Facades/System.Globalization.Extensions/TypeForwarders.cs
index 2f88c33719..ae5a0bbb41 100644
--- a/mcs/class/Facades/System.Globalization.Extensions/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Globalization.Extensions/TypeForwarders.cs
@@ -22,5 +22,3 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.IdnMapping))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.NormalizationForm))]
-// Missing: [assembly:System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.GlobalizationExtensions))]
-// Missing: [assembly:System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.StringNormalizationExtensions))]
diff --git a/mcs/class/Facades/System.IO.Compression/AssemblyInfo.cs b/mcs/class/Facades/System.IO.Compression/AssemblyInfo.cs
new file mode 100644
index 0000000000..08e157f660
--- /dev/null
+++ b/mcs/class/Facades/System.IO.Compression/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.IO.Compression.dll")]
+[assembly: AssemblyDescription ("System.IO.Compression.dll")]
+[assembly: AssemblyDefaultAlias ("System.IO.Compression.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.IO.Compression/Makefile b/mcs/class/Facades/System.IO.Compression/Makefile
new file mode 100644
index 0000000000..4fbfc5625b
--- /dev/null
+++ b/mcs/class/Facades/System.IO.Compression/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.IO.Compression
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.IO.Compression.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.IO.Compression/Missing.cs b/mcs/class/Facades/System.IO.Compression/Missing.cs
new file mode 100644
index 0000000000..cd06b1c684
--- /dev/null
+++ b/mcs/class/Facades/System.IO.Compression/Missing.cs
@@ -0,0 +1,40 @@
+// This is stub only. The implementation should come from https://github.com/dotnet/corefx/tree/master/src/System.IO.Compression/src/System/IO/Compression
+
+namespace System.IO.Compression
+{
+ public class ZipArchive : System.IDisposable
+ {
+ public ZipArchive(System.IO.Stream stream) { }
+ public ZipArchive(System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode) { }
+ public ZipArchive(System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode, bool leaveOpen) { }
+ public ZipArchive(System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode, bool leaveOpen, System.Text.Encoding entryNameEncoding) { }
+ public System.Collections.ObjectModel.ReadOnlyCollection Entries { get { return default(System.Collections.ObjectModel.ReadOnlyCollection); } }
+ public System.IO.Compression.ZipArchiveMode Mode { get { return default(System.IO.Compression.ZipArchiveMode); } }
+ public System.IO.Compression.ZipArchiveEntry CreateEntry(string entryName) { return default(System.IO.Compression.ZipArchiveEntry); }
+ public System.IO.Compression.ZipArchiveEntry CreateEntry(string entryName, System.IO.Compression.CompressionLevel compressionLevel) { return default(System.IO.Compression.ZipArchiveEntry); }
+ public void Dispose() { }
+ protected virtual void Dispose(bool disposing) { }
+ public System.IO.Compression.ZipArchiveEntry GetEntry(string entryName) { return default(System.IO.Compression.ZipArchiveEntry); }
+ }
+
+ public partial class ZipArchiveEntry
+ {
+ internal ZipArchiveEntry() { }
+ public System.IO.Compression.ZipArchive Archive { get { return default(System.IO.Compression.ZipArchive); } }
+ public long CompressedLength { get { return default(long); } }
+ public string FullName { get { return default(string); } }
+ public System.DateTimeOffset LastWriteTime { get { return default(System.DateTimeOffset); } set { } }
+ public long Length { get { return default(long); } }
+ public string Name { get { return default(string); } }
+ public void Delete() { }
+ public System.IO.Stream Open() { return default(System.IO.Stream); }
+ public override string ToString() { return default(string); }
+ }
+
+ public enum ZipArchiveMode
+ {
+ Create = 1,
+ Read = 0,
+ Update = 2,
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.IO.Compression/System.IO.Compression.dll.sources b/mcs/class/Facades/System.IO.Compression/System.IO.Compression.dll.sources
new file mode 100644
index 0000000000..402d066e4c
--- /dev/null
+++ b/mcs/class/Facades/System.IO.Compression/System.IO.Compression.dll.sources
@@ -0,0 +1,3 @@
+TypeForwarders.cs
+AssemblyInfo.cs
+Missing.cs
diff --git a/mcs/class/Facades/System.IO.Compression/TypeForwarders.cs b/mcs/class/Facades/System.IO.Compression/TypeForwarders.cs
new file mode 100644
index 0000000000..5eaf037320
--- /dev/null
+++ b/mcs/class/Facades/System.IO.Compression/TypeForwarders.cs
@@ -0,0 +1,28 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.CompressionLevel))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.CompressionMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.DeflateStream))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.GZipStream))]
+
+
diff --git a/mcs/class/Facades/System.IO.FileSystem.AccessControl/FileSystemAclExtensions.cs b/mcs/class/Facades/System.IO.FileSystem.AccessControl/FileSystemAclExtensions.cs
new file mode 100644
index 0000000000..1dd8d97ab5
--- /dev/null
+++ b/mcs/class/Facades/System.IO.FileSystem.AccessControl/FileSystemAclExtensions.cs
@@ -0,0 +1,83 @@
+//
+// FileSystemAclExtensions.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.IO
+{
+ public static partial class FileSystemAclExtensions
+ {
+ [MonoTODO]
+ public static System.Security.AccessControl.DirectorySecurity GetAccessControl(this System.IO.DirectoryInfo directoryInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static System.Security.AccessControl.DirectorySecurity GetAccessControl(this System.IO.DirectoryInfo directoryInfo, System.Security.AccessControl.AccessControlSections includeSections)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static System.Security.AccessControl.FileSecurity GetAccessControl(this System.IO.FileInfo fileInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static System.Security.AccessControl.FileSecurity GetAccessControl(this System.IO.FileInfo fileInfo, System.Security.AccessControl.AccessControlSections includeSections)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static System.Security.AccessControl.FileSecurity GetAccessControl(this System.IO.FileStream fileStream)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void SetAccessControl(this System.IO.DirectoryInfo directoryInfo, System.Security.AccessControl.DirectorySecurity directorySecurity)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void SetAccessControl(this System.IO.FileInfo fileInfo, System.Security.AccessControl.FileSecurity fileSecurity)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void SetAccessControl(this System.IO.FileStream fileStream, System.Security.AccessControl.FileSecurity fileSecurity)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.IO.FileSystem.AccessControl/System.IO.FileSystem.AccessControl.dll.sources b/mcs/class/Facades/System.IO.FileSystem.AccessControl/System.IO.FileSystem.AccessControl.dll.sources
index 8e33d4ddea..d226e0d4c8 100644
--- a/mcs/class/Facades/System.IO.FileSystem.AccessControl/System.IO.FileSystem.AccessControl.dll.sources
+++ b/mcs/class/Facades/System.IO.FileSystem.AccessControl/System.IO.FileSystem.AccessControl.dll.sources
@@ -1,3 +1,5 @@
TypeForwarders.cs
AssemblyInfo.cs
+../../../build/common/MonoTODOAttribute.cs
+FileSystemAclExtensions.cs
diff --git a/mcs/class/Facades/System.IO.FileSystem.AccessControl/TypeForwarders.cs b/mcs/class/Facades/System.IO.FileSystem.AccessControl/TypeForwarders.cs
index 12daecd038..18351db171 100644
--- a/mcs/class/Facades/System.IO.FileSystem.AccessControl/TypeForwarders.cs
+++ b/mcs/class/Facades/System.IO.FileSystem.AccessControl/TypeForwarders.cs
@@ -27,5 +27,3 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AccessControl.FileSystemAuditRule))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AccessControl.FileSystemRights))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AccessControl.FileSystemSecurity))]
-
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.FileSystemAclExtensions))]
diff --git a/mcs/class/Facades/System.IO.FileSystem.Watcher/TypeForwarders.cs b/mcs/class/Facades/System.IO.FileSystem.Watcher/TypeForwarders.cs
index 6237d34bfc..b25bcf3859 100644
--- a/mcs/class/Facades/System.IO.FileSystem.Watcher/TypeForwarders.cs
+++ b/mcs/class/Facades/System.IO.FileSystem.Watcher/TypeForwarders.cs
@@ -29,5 +29,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.RenamedEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.RenamedEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.WatcherChangeTypes))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.WaitForChangedResult))]
diff --git a/mcs/class/Facades/System.IO/TypeForwarders.cs b/mcs/class/Facades/System.IO/TypeForwarders.cs
index ea526e77de..2c84d4bac3 100644
--- a/mcs/class/Facades/System.IO/TypeForwarders.cs
+++ b/mcs/class/Facades/System.IO/TypeForwarders.cs
@@ -35,4 +35,5 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.StringWriter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.TextReader))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.TextWriter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.BufferedStream))]
diff --git a/mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs b/mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs
index 52af3f619e..6b82ffb42f 100644
--- a/mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs
@@ -64,6 +64,5 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryable))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryable<>))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryProvider))]
-
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.IArgumentProvider))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.IDynamicExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.IArgumentProvider))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.IDynamicExpression))]
diff --git a/mcs/class/Facades/System.Net.Ping/AssemblyInfo.cs b/mcs/class/Facades/System.Net.Ping/AssemblyInfo.cs
new file mode 100644
index 0000000000..507e590b98
--- /dev/null
+++ b/mcs/class/Facades/System.Net.Ping/AssemblyInfo.cs
@@ -0,0 +1,39 @@
+//
+// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Net.Ping.dll")]
+[assembly: AssemblyDescription ("System.Net.Ping.dll")]
+[assembly: AssemblyDefaultAlias ("System.Net.Ping.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
diff --git a/mcs/class/Facades/System.Net.Ping/Makefile b/mcs/class/Facades/System.Net.Ping/Makefile
new file mode 100644
index 0000000000..750ace6943
--- /dev/null
+++ b/mcs/class/Facades/System.Net.Ping/Makefile
@@ -0,0 +1,21 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Net.Ping
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Net.Ping.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
diff --git a/mcs/class/Facades/System.Net.Ping/System.Net.Ping.dll.sources b/mcs/class/Facades/System.Net.Ping/System.Net.Ping.dll.sources
new file mode 100644
index 0000000000..719628dc7c
--- /dev/null
+++ b/mcs/class/Facades/System.Net.Ping/System.Net.Ping.dll.sources
@@ -0,0 +1,2 @@
+TypeForwarders.cs
+AssemblyInfo.cs
diff --git a/mcs/class/Facades/System.Net.Ping/TypeForwarders.cs b/mcs/class/Facades/System.Net.Ping/TypeForwarders.cs
new file mode 100644
index 0000000000..2f79a42a82
--- /dev/null
+++ b/mcs/class/Facades/System.Net.Ping/TypeForwarders.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.IPStatus))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.Ping))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.PingException))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.PingOptions))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.PingReply))]
diff --git a/mcs/class/Facades/System.Net.Security/TypeForwarders.cs b/mcs/class/Facades/System.Net.Security/TypeForwarders.cs
index 884e50a3fd..3167d764e1 100644
--- a/mcs/class/Facades/System.Net.Security/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Net.Security/TypeForwarders.cs
@@ -20,8 +20,11 @@
// THE SOFTWARE.
//
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Security.AuthenticatedStream))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Security.EncryptionPolicy))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Security.LocalCertificateSelectionCallback))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Security.NegotiateStream))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Security.ProtectionLevel))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Security.RemoteCertificateValidationCallback))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Security.SslStream))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Authentication.AuthenticationException))]
@@ -29,5 +32,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Authentication.ExtendedProtection.PolicyEnforcement))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Authentication.ExtendedProtection.ProtectionScenario))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Authentication.ExtendedProtection.ServiceNameCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Authentication.InvalidCredentialException))]
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs b/mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs
new file mode 100644
index 0000000000..2add0e6daf
--- /dev/null
+++ b/mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs
@@ -0,0 +1,36 @@
+//
+// SocketReceiveFromResult.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Net.Sockets
+{
+ public struct SocketReceiveFromResult
+ {
+ public int ReceivedBytes;
+ public EndPoint RemoteEndPoint;
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs b/mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs
new file mode 100644
index 0000000000..ab5ed1022f
--- /dev/null
+++ b/mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs
@@ -0,0 +1,38 @@
+//
+// SocketReceiveMessageFromResult.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Net.Sockets
+{
+ public struct SocketReceiveMessageFromResult
+ {
+ public int ReceivedBytes;
+ public SocketFlags SocketFlags;
+ public EndPoint RemoteEndPoint;
+ public IPPacketInformation PacketInformation;
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs b/mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs
new file mode 100644
index 0000000000..a3e24ede01
--- /dev/null
+++ b/mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs
@@ -0,0 +1,250 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace System.Net.Sockets
+{
+ public static class SocketTaskExtensions
+ {
+ public static Task AcceptAsync(this Socket socket)
+ {
+ return Task.Factory.FromAsync(
+ (callback, state) => ((Socket)state).BeginAccept(callback, state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
+ state: socket);
+ }
+
+ public static Task AcceptAsync(this Socket socket, Socket acceptSocket)
+ {
+ const int ReceiveSize = 0;
+ return Task.Factory.FromAsync(
+ (socketForAccept, receiveSize, callback, state) => ((Socket)state).BeginAccept(socketForAccept, receiveSize, callback, state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
+ acceptSocket,
+ ReceiveSize,
+ state: socket);
+ }
+
+ public static Task ConnectAsync(this Socket socket, EndPoint remoteEndPoint)
+ {
+ return Task.Factory.FromAsync(
+ (targetEndPoint, callback, state) => ((Socket)state).BeginConnect(targetEndPoint, callback, state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+ remoteEndPoint,
+ state: socket);
+ }
+
+ public static Task ConnectAsync(this Socket socket, IPAddress address, int port)
+ {
+ return Task.Factory.FromAsync(
+ (targetAddress, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddress, targetPort, callback, state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+ address,
+ port,
+ state: socket);
+ }
+
+ public static Task ConnectAsync(this Socket socket, IPAddress[] addresses, int port)
+ {
+ return Task.Factory.FromAsync(
+ (targetAddresses, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddresses, targetPort, callback, state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+ addresses,
+ port,
+ state: socket);
+ }
+
+ public static Task ConnectAsync(this Socket socket, string host, int port)
+ {
+ return Task.Factory.FromAsync(
+ (targetHost, targetPort, callback, state) => ((Socket)state).BeginConnect(targetHost, targetPort, callback, state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+ host,
+ port,
+ state: socket);
+ }
+
+ public static Task ReceiveAsync(this Socket socket, ArraySegment buffer, SocketFlags socketFlags)
+ {
+ return Task.Factory.FromAsync(
+ (targetBuffer, flags, callback, state) => ((Socket)state).BeginReceive(
+ targetBuffer.Array,
+ targetBuffer.Offset,
+ targetBuffer.Count,
+ flags,
+ callback,
+ state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
+ buffer,
+ socketFlags,
+ state: socket);
+ }
+
+ public static Task ReceiveAsync(
+ this Socket socket,
+ IList> buffers,
+ SocketFlags socketFlags)
+ {
+ return Task.Factory.FromAsync(
+ (targetBuffers, flags, callback, state) => ((Socket)state).BeginReceive(targetBuffers, flags, callback, state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
+ buffers,
+ socketFlags,
+ state: socket);
+ }
+
+ public static Task ReceiveFromAsync(
+ this Socket socket,
+ ArraySegment buffer,
+ SocketFlags socketFlags,
+ EndPoint remoteEndPoint)
+ {
+ object[] packedArguments = new object[] { socket, remoteEndPoint };
+
+ return Task.Factory.FromAsync(
+ (targetBuffer, flags, callback, state) =>
+ {
+ var arguments = (object[])state;
+ var s = (Socket)arguments[0];
+ var e = (EndPoint)arguments[1];
+
+ IAsyncResult result = s.BeginReceiveFrom(
+ targetBuffer.Array,
+ targetBuffer.Offset,
+ targetBuffer.Count,
+ flags,
+ ref e,
+ callback,
+ state);
+
+ arguments[1] = e;
+ return result;
+ },
+ asyncResult =>
+ {
+ var arguments = (object[])asyncResult.AsyncState;
+ var s = (Socket)arguments[0];
+ var e = (EndPoint)arguments[1];
+
+ int bytesReceived = s.EndReceiveFrom(asyncResult, ref e);
+
+ return new SocketReceiveFromResult()
+ {
+ ReceivedBytes = bytesReceived,
+ RemoteEndPoint = e
+ };
+ },
+ buffer,
+ socketFlags,
+ state: packedArguments);
+ }
+
+ public static Task ReceiveMessageFromAsync(
+ this Socket socket,
+ ArraySegment buffer,
+ SocketFlags socketFlags,
+ EndPoint remoteEndPoint)
+ {
+ object[] packedArguments = new object[] { socket, socketFlags, remoteEndPoint };
+
+ return Task.Factory.FromAsync(
+ (targetBuffer, callback, state) =>
+ {
+ var arguments = (object[])state;
+ var s = (Socket)arguments[0];
+ var f = (SocketFlags)arguments[1];
+ var e = (EndPoint)arguments[2];
+
+ IAsyncResult result = s.BeginReceiveMessageFrom(
+ targetBuffer.Array,
+ targetBuffer.Offset,
+ targetBuffer.Count,
+ f,
+ ref e,
+ callback,
+ state);
+
+ arguments[2] = e;
+ return result;
+ },
+ asyncResult =>
+ {
+ var arguments = (object[])asyncResult.AsyncState;
+ var s = (Socket)arguments[0];
+ var f = (SocketFlags)arguments[1];
+ var e = (EndPoint)arguments[2];
+ IPPacketInformation ipPacket;
+
+ int bytesReceived = s.EndReceiveMessageFrom(
+ asyncResult,
+ ref f,
+ ref e,
+ out ipPacket);
+
+ return new SocketReceiveMessageFromResult()
+ {
+ PacketInformation = ipPacket,
+ ReceivedBytes = bytesReceived,
+ RemoteEndPoint = e,
+ SocketFlags = f
+ };
+ },
+ buffer,
+ state: packedArguments);
+ }
+
+ public static Task SendAsync(this Socket socket, ArraySegment buffer, SocketFlags socketFlags)
+ {
+ return Task.Factory.FromAsync(
+ (targetBuffer, flags, callback, state) => ((Socket)state).BeginSend(
+ targetBuffer.Array,
+ targetBuffer.Offset,
+ targetBuffer.Count,
+ flags,
+ callback,
+ state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
+ buffer,
+ socketFlags,
+ state: socket);
+ }
+
+ public static Task SendAsync(
+ this Socket socket,
+ IList> buffers,
+ SocketFlags socketFlags)
+ {
+ return Task.Factory.FromAsync(
+ (targetBuffers, flags, callback, state) => ((Socket)state).BeginSend(targetBuffers, flags, callback, state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
+ buffers,
+ socketFlags,
+ state: socket);
+ }
+
+ public static Task SendToAsync(
+ this Socket socket,
+ ArraySegment buffer,
+ SocketFlags socketFlags,
+ EndPoint remoteEndPoint)
+ {
+ return Task.Factory.FromAsync(
+ (targetBuffer, flags, endPoint, callback, state) => ((Socket)state).BeginSendTo(
+ targetBuffer.Array,
+ targetBuffer.Offset,
+ targetBuffer.Count,
+ flags,
+ endPoint,
+ callback,
+ state),
+ asyncResult => ((Socket)asyncResult.AsyncState).EndSendTo(asyncResult),
+ buffer,
+ socketFlags,
+ remoteEndPoint,
+ state: socket);
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Net.Sockets/System.Net.Sockets.dll.sources b/mcs/class/Facades/System.Net.Sockets/System.Net.Sockets.dll.sources
index 8e33d4ddea..a4cab35a66 100644
--- a/mcs/class/Facades/System.Net.Sockets/System.Net.Sockets.dll.sources
+++ b/mcs/class/Facades/System.Net.Sockets/System.Net.Sockets.dll.sources
@@ -1,3 +1,5 @@
TypeForwarders.cs
AssemblyInfo.cs
-
+SocketReceiveFromResult.cs
+SocketReceiveMessageFromResult.cs
+SocketTaskExtensions.cs
diff --git a/mcs/class/Facades/System.Reflection.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.Reflection.Primitives/TypeForwarders.cs
index cfa70ce24a..a3dd7e7c88 100644
--- a/mcs/class/Facades/System.Reflection.Primitives/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Reflection.Primitives/TypeForwarders.cs
@@ -20,7 +20,6 @@
// THE SOFTWARE.
//
-#if !FULL_AOT_RUNTIME
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.FlowControl))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.OpCode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.OpCodes))]
@@ -28,7 +27,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.OperandType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.PackingSize))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.StackBehaviour))]
-#endif
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CallingConventions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.EventAttributes))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.FieldAttributes))]
diff --git a/mcs/class/Facades/System.Reflection.TypeExtensions/Requires.cs b/mcs/class/Facades/System.Reflection.TypeExtensions/Requires.cs
new file mode 100644
index 0000000000..339981b9af
--- /dev/null
+++ b/mcs/class/Facades/System.Reflection.TypeExtensions/Requires.cs
@@ -0,0 +1,17 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Reflection
+{
+ internal static class Requires
+ {
+ internal static void NotNull(object obj, string name)
+ {
+ if (obj == null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Reflection.TypeExtensions/SR.cs b/mcs/class/Facades/System.Reflection.TypeExtensions/SR.cs
new file mode 100644
index 0000000000..0a1ae286b5
--- /dev/null
+++ b/mcs/class/Facades/System.Reflection.TypeExtensions/SR.cs
@@ -0,0 +1,4 @@
+partial class SR
+{
+ public const string NoMetadataTokenAvailable = "There is no metadata token available for the given member.";
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Reflection.TypeExtensions/System.Reflection.TypeExtensions.dll.sources b/mcs/class/Facades/System.Reflection.TypeExtensions/System.Reflection.TypeExtensions.dll.sources
index 8e33d4ddea..06522762fb 100644
--- a/mcs/class/Facades/System.Reflection.TypeExtensions/System.Reflection.TypeExtensions.dll.sources
+++ b/mcs/class/Facades/System.Reflection.TypeExtensions/System.Reflection.TypeExtensions.dll.sources
@@ -1,3 +1,6 @@
TypeForwarders.cs
AssemblyInfo.cs
+SR.cs
+Requires.cs
+TypeExtensions.CoreCLR.cs
diff --git a/mcs/class/Facades/System.Reflection.TypeExtensions/TypeExtensions.CoreCLR.cs b/mcs/class/Facades/System.Reflection.TypeExtensions/TypeExtensions.CoreCLR.cs
new file mode 100644
index 0000000000..661cd67a0e
--- /dev/null
+++ b/mcs/class/Facades/System.Reflection.TypeExtensions/TypeExtensions.CoreCLR.cs
@@ -0,0 +1,400 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+// NOTE: These are extension methods in the contract, but plain static methods
+// in this implementation. This is done to avoid confusion around what would
+// look like infinite recursion in the implementation. Callers compiled against
+// the contract will still be able to invoke them as extension methods and get
+// source compatibility with classic reflection code.
+//
+// However, this does not apply if there is no 1:1 correspondence with an instance
+// in mscorlib. New extension methods should be marked with 'this'.
+
+namespace System.Reflection
+{
+ public static class TypeExtensions
+ {
+ public static ConstructorInfo GetConstructor(Type type, Type[] types)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetConstructor(types);
+ }
+
+ public static ConstructorInfo[] GetConstructors(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetConstructors();
+ }
+
+ public static ConstructorInfo[] GetConstructors(Type type, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetConstructors(bindingAttr);
+ }
+
+ public static MemberInfo[] GetDefaultMembers(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetDefaultMembers();
+ }
+
+ public static EventInfo GetEvent(Type type, string name)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetEvent(name);
+ }
+
+ public static EventInfo GetEvent(Type type, string name, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetEvent(name, bindingAttr);
+ }
+
+ public static EventInfo[] GetEvents(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetEvents();
+ }
+
+ public static EventInfo[] GetEvents(Type type, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetEvents(bindingAttr);
+ }
+
+ public static FieldInfo GetField(Type type, string name)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetField(name);
+ }
+
+ public static FieldInfo GetField(Type type, string name, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetField(name, bindingAttr);
+ }
+
+ public static FieldInfo[] GetFields(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetFields();
+ }
+
+ public static FieldInfo[] GetFields(Type type, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetFields(bindingAttr);
+ }
+
+ public static Type[] GetGenericArguments(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetGenericArguments();
+ }
+
+ public static Type[] GetInterfaces(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetInterfaces();
+ }
+
+ public static MemberInfo[] GetMember(Type type, string name)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMember(name);
+ }
+
+ public static MemberInfo[] GetMember(Type type, string name, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMember(name, bindingAttr);
+ }
+
+ public static MemberInfo[] GetMembers(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMembers();
+ }
+
+ public static MemberInfo[] GetMembers(Type type, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMembers(bindingAttr);
+ }
+
+ public static MethodInfo GetMethod(Type type, string name)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMethod(name);
+ }
+
+ public static MethodInfo GetMethod(Type type, string name, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMethod(name, bindingAttr);
+ }
+
+ public static MethodInfo GetMethod(Type type, string name, Type[] types)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMethod(name, types);
+ }
+
+ public static MethodInfo[] GetMethods(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMethods();
+ }
+
+ public static MethodInfo[] GetMethods(Type type, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetMethods(bindingAttr);
+ }
+
+ public static Type GetNestedType(Type type, string name, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetNestedType(name, bindingAttr);
+ }
+
+ public static Type[] GetNestedTypes(Type type, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetNestedTypes(bindingAttr);
+ }
+
+ public static PropertyInfo[] GetProperties(Type type)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetProperties();
+ }
+
+ public static PropertyInfo[] GetProperties(Type type, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetProperties(bindingAttr);
+ }
+
+ public static PropertyInfo GetProperty(Type type, string name)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetProperty(name);
+ }
+
+ public static PropertyInfo GetProperty(Type type, string name, BindingFlags bindingAttr)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetProperty(name, bindingAttr);
+ }
+
+ public static PropertyInfo GetProperty(Type type, string name, Type returnType)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetProperty(name, returnType);
+ }
+
+ public static PropertyInfo GetProperty(Type type, string name, Type returnType, Type[] types)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.GetProperty(name, returnType, types);
+ }
+
+ public static bool IsAssignableFrom(Type type, Type c)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.IsAssignableFrom(c);
+ }
+
+ public static bool IsInstanceOfType(Type type, object o)
+ {
+ Requires.NotNull(type, nameof(type));
+ return type.IsInstanceOfType(o);
+ }
+ }
+
+ public static class AssemblyExtensions
+ {
+ public static Type[] GetExportedTypes(Assembly assembly)
+ {
+ Requires.NotNull(assembly, nameof(assembly));
+ return assembly.GetExportedTypes();
+ }
+
+ public static Module[] GetModules(Assembly assembly)
+ {
+ Requires.NotNull(assembly, nameof(assembly));
+ return assembly.GetModules();
+ }
+
+ public static Type[] GetTypes(Assembly assembly)
+ {
+ Requires.NotNull(assembly, nameof(assembly));
+ return assembly.GetTypes();
+ }
+ }
+
+ public static class EventInfoExtensions
+ {
+ public static MethodInfo GetAddMethod(EventInfo eventInfo)
+ {
+ Requires.NotNull(eventInfo, nameof(eventInfo));
+ return eventInfo.GetAddMethod();
+ }
+
+ public static MethodInfo GetAddMethod(EventInfo eventInfo, bool nonPublic)
+ {
+ Requires.NotNull(eventInfo, nameof(eventInfo));
+ return eventInfo.GetAddMethod(nonPublic);
+ }
+
+ public static MethodInfo GetRaiseMethod(EventInfo eventInfo)
+ {
+ Requires.NotNull(eventInfo, nameof(eventInfo));
+ return eventInfo.GetRaiseMethod();
+ }
+
+ public static MethodInfo GetRaiseMethod(EventInfo eventInfo, bool nonPublic)
+ {
+ Requires.NotNull(eventInfo, nameof(eventInfo));
+ return eventInfo.GetRaiseMethod(nonPublic);
+ }
+
+ public static MethodInfo GetRemoveMethod(EventInfo eventInfo)
+ {
+ Requires.NotNull(eventInfo, nameof(eventInfo));
+ return eventInfo.GetRemoveMethod();
+ }
+
+ public static MethodInfo GetRemoveMethod(EventInfo eventInfo, bool nonPublic)
+ {
+ Requires.NotNull(eventInfo, nameof(eventInfo));
+ return eventInfo.GetRemoveMethod(nonPublic);
+ }
+ }
+
+ public static class MemberInfoExtensions
+ {
+
+ ///
+ /// Determines if there is a metadata token available for the given member.
+ /// throws otherwise.
+ ///
+ /// This maybe
+ public static bool HasMetadataToken(this MemberInfo member)
+ {
+ Requires.NotNull(member, nameof(member));
+
+ try
+ {
+ return GetMetadataTokenOrZeroOrThrow(member) != 0;
+ }
+ catch (InvalidOperationException)
+ {
+ // Thrown for unbaked ref-emit members/types.
+ // Other cases such as typeof(byte[]).MetadataToken will be handled by comparison to zero above.
+ return false;
+ }
+ }
+
+ ///
+ /// Gets a metadata token for the given member if available. The returned token is never nil.
+ ///
+ ///
+ /// There is no metadata token available. returns false in this case.
+ ///
+ public static int GetMetadataToken(this MemberInfo member)
+ {
+ Requires.NotNull(member, nameof(member));
+
+ int token = GetMetadataTokenOrZeroOrThrow(member);
+
+ if (token == 0)
+ {
+ throw new InvalidOperationException(SR.NoMetadataTokenAvailable);
+ }
+
+ return token;
+ }
+
+ private static int GetMetadataTokenOrZeroOrThrow(MemberInfo member)
+ {
+ int token = member.MetadataToken;
+
+ // Tokens have MSB = table index, 3 LSBs = row index
+ // row index of 0 is a nil token
+ const int rowMask = 0x00FFFFFF;
+ if ((token & rowMask) == 0)
+ {
+ // Nil token is returned for edge cases like typeof(byte[]).MetadataToken.
+ return 0;
+ }
+
+ return token;
+ }
+ }
+
+ public static class MethodInfoExtensions
+ {
+ public static MethodInfo GetBaseDefinition(MethodInfo method)
+ {
+ Requires.NotNull(method, nameof(method));
+ return method.GetBaseDefinition();
+ }
+ }
+
+ public static class ModuleExtensions
+ {
+ public static bool HasModuleVersionId(this Module module)
+ {
+ Requires.NotNull(module, nameof(module));
+ return true; // not expected to fail on platforms with Module.ModuleVersionId built-in.
+ }
+
+ public static Guid GetModuleVersionId(this Module module)
+ {
+ Requires.NotNull(module, nameof(module));
+ return module.ModuleVersionId;
+ }
+ }
+
+ public static class PropertyInfoExtensions
+ {
+ public static MethodInfo[] GetAccessors(PropertyInfo property)
+ {
+ Requires.NotNull(property, nameof(property));
+ return property.GetAccessors();
+ }
+
+ public static MethodInfo[] GetAccessors(PropertyInfo property, bool nonPublic)
+ {
+ Requires.NotNull(property, nameof(property));
+ return property.GetAccessors(nonPublic);
+ }
+
+ public static MethodInfo GetGetMethod(PropertyInfo property)
+ {
+ Requires.NotNull(property, nameof(property));
+ return property.GetGetMethod();
+ }
+
+ public static MethodInfo GetGetMethod(PropertyInfo property, bool nonPublic)
+ {
+ Requires.NotNull(property, nameof(property));
+ return property.GetGetMethod(nonPublic);
+ }
+
+ public static MethodInfo GetSetMethod(PropertyInfo property)
+ {
+ Requires.NotNull(property, nameof(property));
+ return property.GetSetMethod();
+ }
+
+ public static MethodInfo GetSetMethod(PropertyInfo property, bool nonPublic)
+ {
+ Requires.NotNull(property, nameof(property));
+ return property.GetSetMethod(nonPublic);
+ }
+ }
+}
diff --git a/mcs/class/Facades/System.Reflection.TypeExtensions/TypeForwarders.cs b/mcs/class/Facades/System.Reflection.TypeExtensions/TypeForwarders.cs
index a6b0138ff6..757cd13035 100644
--- a/mcs/class/Facades/System.Reflection.TypeExtensions/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Reflection.TypeExtensions/TypeForwarders.cs
@@ -22,8 +22,3 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.BindingFlags))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyExtensions))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.EventInfoExtensions))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MethodInfoExtensions))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.PropertyInfoExtensions))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TypeExtensions))]
diff --git a/mcs/class/Facades/System.Reflection/TypeForwarders.cs b/mcs/class/Facades/System.Reflection/TypeForwarders.cs
index 511c1fe2ed..d1d2b4ecb1 100644
--- a/mcs/class/Facades/System.Reflection/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Reflection/TypeForwarders.cs
@@ -46,4 +46,12 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TargetInvocationException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TargetParameterCountException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TypeInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.BindingFlags))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ICustomAttributeProvider))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.InvalidFilterCriteriaException))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MemberFilter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MemberTypes))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ParameterModifier))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TargetException))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TypeFilter))]
diff --git a/mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs
index a088678a7f..94249720f6 100644
--- a/mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs
@@ -45,12 +45,11 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.STATSTG))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CriticalHandle))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CurrencyWrapper))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CustomQueryInterfaceMode))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CustomQueryInterfaceResult))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CustomQueryInterfaceMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CustomQueryInterfaceResult))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultCharSetAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultParameterValueAttribute))]
-//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DispatchWrapper))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DispIdAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DllImportAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DllImportSearchPath))]
@@ -79,3 +78,60 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.UnmanagedType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.VarEnum))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.VariantWrapper))]
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComAwareEventInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComEventsHelper))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.ADVF))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.BINDPTR))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.CALLCONV))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.CONNECTDATA))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.DATADIR))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.DESCKIND))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.DISPPARAMS))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.DVASPECT))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.ELEMDESC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.EXCEPINFO))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.FILETIME))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.FORMATETC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.FUNCDESC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.FUNCFLAGS))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.FUNCKIND))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IAdviseSink))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IBindCtx))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IConnectionPoint))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IConnectionPointContainer))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IDLDESC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IDLFLAG))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IEnumConnectionPoints))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IEnumConnections))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IEnumFORMATETC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IEnumMoniker))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IEnumString))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IEnumVARIANT))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IMoniker))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.INVOKEKIND))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IPersistFile))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IRunningObjectTable))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.ITypeComp))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.ITypeInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.ITypeInfo2))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.ITypeLib))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.ITypeLib2))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.LIBFLAGS))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.PARAMDESC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.PARAMFLAG))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.STATDATA))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.STGMEDIUM))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.SYSKIND))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.TYMED))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.TYPEATTR))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.TYPEDESC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.TYPEFLAGS))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.TYPEKIND))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.TYPELIBATTR))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.VARDESC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.VARFLAGS))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.VARKIND))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ICustomQueryInterface))]
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Formatters/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime.Serialization.Formatters/AssemblyInfo.cs
new file mode 100644
index 0000000000..9b921172c1
--- /dev/null
+++ b/mcs/class/Facades/System.Runtime.Serialization.Formatters/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Runtime.Serialization.Formatters.dll")]
+[assembly: AssemblyDescription ("System.Runtime.Serialization.Formatters.dll")]
+[assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Formatters.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Formatters/Makefile b/mcs/class/Facades/System.Runtime.Serialization.Formatters/Makefile
new file mode 100644
index 0000000000..a8c237d1da
--- /dev/null
+++ b/mcs/class/Facades/System.Runtime.Serialization.Formatters/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Runtime.Serialization.Formatters
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Runtime.Serialization.Formatters.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Formatters/System.Runtime.Serialization.Formatters.dll.sources b/mcs/class/Facades/System.Runtime.Serialization.Formatters/System.Runtime.Serialization.Formatters.dll.sources
new file mode 100644
index 0000000000..8e33d4ddea
--- /dev/null
+++ b/mcs/class/Facades/System.Runtime.Serialization.Formatters/System.Runtime.Serialization.Formatters.dll.sources
@@ -0,0 +1,3 @@
+TypeForwarders.cs
+AssemblyInfo.cs
+
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Formatters/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.Serialization.Formatters/TypeForwarders.cs
new file mode 100644
index 0000000000..31daa7cdcb
--- /dev/null
+++ b/mcs/class/Facades/System.Runtime.Serialization.Formatters/TypeForwarders.cs
@@ -0,0 +1,32 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.NonSerializedAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.IDeserializationCallback))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.IFormatterConverter))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.ISerializable))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.SerializationEntry))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.SerializationInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.SerializationInfoEnumerator))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.SerializableAttribute))]
+
+
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/ISerializationSurrogateProvider.cs b/mcs/class/Facades/System.Runtime.Serialization.Primitives/ISerializationSurrogateProvider.cs
new file mode 100644
index 0000000000..b14b6df540
--- /dev/null
+++ b/mcs/class/Facades/System.Runtime.Serialization.Primitives/ISerializationSurrogateProvider.cs
@@ -0,0 +1,32 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+namespace System.Runtime.Serialization
+{
+ public interface ISerializationSurrogateProvider
+ {
+ object GetDeserializedObject (object obj, Type targetType);
+ object GetObjectToSerialize (object obj, Type targetType);
+ Type GetSurrogateType (Type type);
+ }
+}
+
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives.dll.sources b/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives.dll.sources
index 8e33d4ddea..75ec1201b8 100644
--- a/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives.dll.sources
+++ b/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives.dll.sources
@@ -1,3 +1,3 @@
TypeForwarders.cs
AssemblyInfo.cs
-
+ISerializationSurrogateProvider.cs
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.Serialization.Primitives/TypeForwarders.cs
index ce3180fe1f..57b2d4db09 100644
--- a/mcs/class/Facades/System.Runtime.Serialization.Primitives/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Runtime.Serialization.Primitives/TypeForwarders.cs
@@ -33,4 +33,4 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnSerializingAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.SerializationException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.StreamingContext))]
-
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.InvalidDataContractException))]
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/DataContractSerializerExtensions.cs b/mcs/class/Facades/System.Runtime.Serialization.Xml/DataContractSerializerExtensions.cs
new file mode 100644
index 0000000000..3ccdff7a34
--- /dev/null
+++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/DataContractSerializerExtensions.cs
@@ -0,0 +1,84 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#if !NO_CODEDOM
+using System.CodeDom;
+#endif
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Runtime.Serialization
+{
+ public static class DataContractSerializerExtensions
+ {
+ public static ISerializationSurrogateProvider GetSerializationSurrogateProvider(this DataContractSerializer serializer)
+ {
+ SurrogateProviderAdapter adapter = serializer.DataContractSurrogate as SurrogateProviderAdapter;
+ return (adapter == null) ? null : adapter.Provider;
+ }
+
+ public static void SetSerializationSurrogateProvider(this DataContractSerializer serializer, ISerializationSurrogateProvider provider)
+ {
+ // allocate every time, expectation is that this won't happen enough to warrant maintaining a CondtionalWeakTable.
+ IDataContractSurrogate adapter = new SurrogateProviderAdapter(provider);
+
+ // DCS doesn't expose a setter, access the field directly as a workaround
+ typeof(DataContractSerializer)
+ .GetField("dataContractSurrogate", BindingFlags.Instance | BindingFlags.NonPublic)
+ .SetValue(serializer, adapter);
+ }
+
+ private class SurrogateProviderAdapter : IDataContractSurrogate
+ {
+ private ISerializationSurrogateProvider _provider;
+ public SurrogateProviderAdapter(ISerializationSurrogateProvider provider)
+ {
+ _provider = provider;
+ }
+
+ public ISerializationSurrogateProvider Provider { get { return _provider; } }
+ public object GetCustomDataToExport(Type clrType, Type dataContractType)
+ {
+ throw NotImplemented.ByDesign;
+ }
+
+ public object GetCustomDataToExport(MemberInfo memberInfo, Type dataContractType)
+ {
+ throw NotImplemented.ByDesign;
+ }
+
+ public Type GetDataContractType(Type type)
+ {
+ return _provider.GetSurrogateType(type);
+ }
+
+ public object GetDeserializedObject(object obj, Type targetType)
+ {
+ return _provider.GetDeserializedObject(obj, targetType);
+ }
+
+ public void GetKnownCustomDataTypes(Collection customDataTypes)
+ {
+ throw NotImplemented.ByDesign;
+ }
+
+ public object GetObjectToSerialize(object obj, Type targetType)
+ {
+ return _provider.GetObjectToSerialize(obj, targetType);
+ }
+
+ public Type GetReferencedTypeOnImport(string typeName, string typeNamespace, object customData)
+ {
+ throw NotImplemented.ByDesign;
+ }
+
+#if !NO_CODEDOM
+ public CodeTypeDeclaration ProcessImportedType(CodeTypeDeclaration typeDeclaration, CodeCompileUnit compileUnit)
+ {
+ throw NotImplemented.ByDesign;
+ }
+#endif
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile b/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile
index 3150204d12..1300ebdfae 100644
--- a/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile
+++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile
@@ -11,9 +11,13 @@ LIBRARY = System.Runtime.Serialization.Xml.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System.Runtime.Serialization System.Xml
+LIB_REFS = System.Runtime.Serialization System System.Xml Facades/System.Runtime.Serialization.Primitives
LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib
+ifeq (2.1, $(FRAMEWORK_VERSION))
+LIB_MCS_FLAGS += /d:NO_CODEDOM
+endif
+
PLATFORM_DEBUG_FLAGS =
NO_TEST = yes
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/NotImplemented.cs b/mcs/class/Facades/System.Runtime.Serialization.Xml/NotImplemented.cs
new file mode 100644
index 0000000000..26e5342aaf
--- /dev/null
+++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/NotImplemented.cs
@@ -0,0 +1,32 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ //
+ // This class enables one to throw a NotImplementedException using the following idiom:
+ //
+ // throw NotImplemented.ByDesign;
+ //
+ // Used by methods whose intended implementation is to throw a NotImplementedException (typically
+ // virtual methods in public abstract classes that intended to be subclassed by third parties.)
+ //
+ // This makes it distinguishable both from human eyes and CCI from NYI's that truly represent undone work.
+ //
+ internal static class NotImplemented
+ {
+ internal static Exception ByDesign
+ {
+ get
+ {
+ return new NotImplementedException();
+ }
+ }
+
+ internal static Exception ByDesignWithMessage(String message)
+ {
+ return new NotImplementedException(message);
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml.dll.sources b/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml.dll.sources
index 8e33d4ddea..d23128800b 100644
--- a/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml.dll.sources
+++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml.dll.sources
@@ -1,3 +1,6 @@
TypeForwarders.cs
AssemblyInfo.cs
+
+DataContractSerializerExtensions.cs
+NotImplemented.cs
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.Serialization.Xml/TypeForwarders.cs
index bfd4e7e471..38eea612a4 100644
--- a/mcs/class/Facades/System.Runtime.Serialization.Xml/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/TypeForwarders.cs
@@ -36,3 +36,4 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlDictionaryWriter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.OnXmlDictionaryReaderClose))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlDictionaryReaderQuotaTypes))]
diff --git a/mcs/class/Facades/System.Runtime/TypeForwarders.cs b/mcs/class/Facades/System.Runtime/TypeForwarders.cs
index 7184eee8b4..03f6d00db3 100644
--- a/mcs/class/Facades/System.Runtime/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Runtime/TypeForwarders.cs
@@ -293,3 +293,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IsConst))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TypeCode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriFormatException))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ConditionalWeakTable<,>))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.GCHandle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.GCHandleType))]
diff --git a/mcs/class/Facades/System.Security.Cryptography.Algorithms/AssemblyInfo.cs b/mcs/class/Facades/System.Security.Cryptography.Algorithms/AssemblyInfo.cs
new file mode 100644
index 0000000000..76645c3810
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Algorithms/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Security.Cryptography.Algorithms.dll")]
+[assembly: AssemblyDescription ("System.Security.Cryptography.Algorithms.dll")]
+[assembly: AssemblyDefaultAlias ("System.Security.Cryptography.Algorithms.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECCurve.cs b/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECCurve.cs
new file mode 100644
index 0000000000..3e1733e0c3
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECCurve.cs
@@ -0,0 +1,85 @@
+//
+// ECCurve.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public struct ECCurve
+ {
+ public byte[] A;
+ public byte[] B;
+ public byte[] Cofactor;
+ public ECCurveType CurveType;
+ public ECPoint G;
+ public HashAlgorithmName? Hash;
+ public byte[] Order;
+ public byte[] Polynomial;
+ public byte[] Prime;
+ public byte[] Seed;
+ public bool IsCharacteristic2 { get { throw new NotImplementedException (); } }
+ public bool IsExplicit { get { throw new NotImplementedException (); } }
+ public bool IsNamed { get { throw new NotImplementedException (); } }
+ public bool IsPrime { get { throw new NotImplementedException (); } }
+ public Oid Oid { get { throw new NotImplementedException (); } }
+ public static ECCurve CreateFromFriendlyName (string oidFriendlyName) { throw new NotImplementedException (); }
+ public static ECCurve CreateFromOid (Oid curveOid) { throw new NotImplementedException (); }
+ public static ECCurve CreateFromValue (string oidValue) { throw new NotImplementedException (); }
+ public void Validate () { throw new NotImplementedException (); }
+
+ public enum ECCurveType
+ {
+ Implicit = 0,
+ PrimeShortWeierstrass = 1,
+ PrimeTwistedEdwards = 2,
+ PrimeMontgomery = 3,
+ Characteristic2 = 4,
+ Named = 5,
+ }
+
+ public static class NamedCurves
+ {
+ public static ECCurve brainpoolP160r1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP160t1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP192r1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP192t1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP224r1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP224t1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP256r1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP256t1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP320r1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP320t1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP384r1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP384t1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP512r1 { get { throw new NotImplementedException (); } }
+ public static ECCurve brainpoolP512t1 { get { throw new NotImplementedException (); } }
+ public static ECCurve nistP256 { get { throw new NotImplementedException (); } }
+ public static ECCurve nistP384 { get { throw new NotImplementedException (); } }
+ public static ECCurve nistP521 { get { throw new NotImplementedException (); } }
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECParameters.cs b/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECParameters.cs
new file mode 100644
index 0000000000..6f1e4211c8
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECParameters.cs
@@ -0,0 +1,39 @@
+//
+// ECPArameters.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public partial struct ECParameters
+ {
+ public ECCurve Curve;
+ public byte[] D;
+ public ECPoint Q;
+ public void Validate () { throw new NotImplementedException (); }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECPoint.cs b/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECPoint.cs
new file mode 100644
index 0000000000..5693959d0e
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Algorithms/ECPoint.cs
@@ -0,0 +1,37 @@
+//
+// ECPoint.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public struct ECPoint
+ {
+ public byte[] X;
+ public byte[] Y;
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Security.Cryptography.Algorithms/IncrementalHash.cs b/mcs/class/Facades/System.Security.Cryptography.Algorithms/IncrementalHash.cs
new file mode 100644
index 0000000000..7b39b0d988
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Algorithms/IncrementalHash.cs
@@ -0,0 +1,42 @@
+//
+// IncrementalHash.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ public sealed class IncrementalHash : IDisposable
+ {
+ private IncrementalHash () { }
+ public HashAlgorithmName AlgorithmName { get { throw new NotImplementedException (); } }
+ public void AppendData (byte[] data) { }
+ public void AppendData (byte[] data, int offset, int count) { }
+ public static IncrementalHash CreateHash (HashAlgorithmName hashAlgorithm) { throw new NotImplementedException (); }
+ public static IncrementalHash CreateHMAC (HashAlgorithmName hashAlgorithm, byte[] key) { throw new NotImplementedException (); }
+ public void Dispose () { }
+ public byte[] GetHashAndReset () { throw new NotImplementedException (); }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Security.Cryptography.Algorithms/Makefile b/mcs/class/Facades/System.Security.Cryptography.Algorithms/Makefile
new file mode 100644
index 0000000000..389a11cf6c
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Algorithms/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Security.Cryptography.Algorithms
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Security.Cryptography.Algorithms.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Algorithms/System.Security.Cryptography.Algorithms.dll.sources b/mcs/class/Facades/System.Security.Cryptography.Algorithms/System.Security.Cryptography.Algorithms.dll.sources
new file mode 100644
index 0000000000..dcb3ff9de8
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Algorithms/System.Security.Cryptography.Algorithms.dll.sources
@@ -0,0 +1,6 @@
+TypeForwarders.cs
+AssemblyInfo.cs
+ECCurve.cs
+ECPoint.cs
+ECParameters.cs
+IncrementalHash.cs
diff --git a/mcs/class/Facades/System.Security.Cryptography.Algorithms/TypeForwarders.cs b/mcs/class/Facades/System.Security.Cryptography.Algorithms/TypeForwarders.cs
new file mode 100644
index 0000000000..5a59369bd4
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Algorithms/TypeForwarders.cs
@@ -0,0 +1,46 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Aes))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DeriveBytes))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECDsa))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACMD5))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA1))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA256))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA384))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA512))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.MD5))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RandomNumberGenerator))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Rfc2898DeriveBytes))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSA))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAEncryptionPadding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAEncryptionPaddingMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAParameters))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSASignaturePadding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSASignaturePaddingMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA1))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA256))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA384))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA512))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.TripleDES))]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Cng/AssemblyInfo.cs b/mcs/class/Facades/System.Security.Cryptography.Cng/AssemblyInfo.cs
new file mode 100644
index 0000000000..b902325fde
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Cng/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Security.Cryptography.Cng.dll")]
+[assembly: AssemblyDescription ("System.Security.Cryptography.Cng.dll")]
+[assembly: AssemblyDefaultAlias ("System.Security.Cryptography.Cng.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Cng/Makefile b/mcs/class/Facades/System.Security.Cryptography.Cng/Makefile
new file mode 100644
index 0000000000..4912aa302c
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Cng/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Security.Cryptography.Cng
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Security.Cryptography.Cng.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Cng/System.Security.Cryptography.Cng.dll.sources b/mcs/class/Facades/System.Security.Cryptography.Cng/System.Security.Cryptography.Cng.dll.sources
new file mode 100644
index 0000000000..8e33d4ddea
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Cng/System.Security.Cryptography.Cng.dll.sources
@@ -0,0 +1,3 @@
+TypeForwarders.cs
+AssemblyInfo.cs
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Cng/TypeForwarders.cs b/mcs/class/Facades/System.Security.Cryptography.Cng/TypeForwarders.cs
new file mode 100644
index 0000000000..309d6fb5ce
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Cng/TypeForwarders.cs
@@ -0,0 +1,46 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeNCryptHandle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeNCryptProviderHandle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AesCng))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngAlgorithm))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngAlgorithmGroup))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngExportPolicies))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngKey))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngKeyBlobFormat))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngKeyCreationOptions))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngKeyCreationParameters))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngKeyHandleOpenOptions))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngKeyOpenOptions))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngKeyUsages))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngProperty))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngPropertyCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngPropertyOptions))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngProvider))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngUIPolicy))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngUIProtectionLevels))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECDsaCng))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSACng))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.TripleDESCng))]
diff --git a/mcs/class/Facades/System.Security.Cryptography.Csp/AssemblyInfo.cs b/mcs/class/Facades/System.Security.Cryptography.Csp/AssemblyInfo.cs
new file mode 100644
index 0000000000..0d630533ad
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Csp/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Security.Cryptography.Csp.dll")]
+[assembly: AssemblyDescription ("System.Security.Cryptography.Csp.dll")]
+[assembly: AssemblyDefaultAlias ("System.Security.Cryptography.Csp.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Csp/Makefile b/mcs/class/Facades/System.Security.Cryptography.Csp/Makefile
new file mode 100644
index 0000000000..91d09321a6
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Csp/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Security.Cryptography.Csp
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Security.Cryptography.Csp.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Csp/System.Security.Cryptography.Csp.dll.sources b/mcs/class/Facades/System.Security.Cryptography.Csp/System.Security.Cryptography.Csp.dll.sources
new file mode 100644
index 0000000000..8e33d4ddea
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Csp/System.Security.Cryptography.Csp.dll.sources
@@ -0,0 +1,3 @@
+TypeForwarders.cs
+AssemblyInfo.cs
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Csp/TypeForwarders.cs b/mcs/class/Facades/System.Security.Cryptography.Csp/TypeForwarders.cs
new file mode 100644
index 0000000000..a854f1fba5
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Csp/TypeForwarders.cs
@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CspKeyContainerInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CspParameters))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CspProviderFlags))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ICspAsymmetricAlgorithm))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.KeyNumber))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSACryptoServiceProvider))]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Encoding/TypeForwarders.cs b/mcs/class/Facades/System.Security.Cryptography.Encoding/TypeForwarders.cs
index 49d9014996..07db287ab8 100644
--- a/mcs/class/Facades/System.Security.Cryptography.Encoding/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Security.Cryptography.Encoding/TypeForwarders.cs
@@ -25,5 +25,5 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.OidCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.OidEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.OidGroup))]
-
-
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsnEncodedDataCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsnEncodedDataEnumerator))]
diff --git a/mcs/class/Facades/System.Security.Cryptography.OpenSsl/AssemblyInfo.cs b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/AssemblyInfo.cs
new file mode 100644
index 0000000000..3560bf2357
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Security.Cryptography.OpenSsl.dll")]
+[assembly: AssemblyDescription ("System.Security.Cryptography.OpenSsl.dll")]
+[assembly: AssemblyDefaultAlias ("System.Security.Cryptography.OpenSsl.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.OpenSsl/ECDsaOpenSsl.cs b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/ECDsaOpenSsl.cs
new file mode 100644
index 0000000000..1a2771a4f3
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/ECDsaOpenSsl.cs
@@ -0,0 +1,45 @@
+//
+// ECDsaOpenSsl.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ public sealed class ECDsaOpenSsl : ECDsa
+ {
+ public override byte[] SignHash (byte[] hash)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override bool VerifyHash (byte[] hash, byte[] signature)
+ {
+ throw new NotImplementedException ();
+ }
+
+ // TODO: Implement full contract API
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Security.Cryptography.OpenSsl/Makefile b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/Makefile
new file mode 100644
index 0000000000..aa30bc935a
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Security.Cryptography.OpenSsl
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Security.Cryptography.OpenSsl.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.OpenSsl/RSAOpenSsl.cs b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/RSAOpenSsl.cs
new file mode 100644
index 0000000000..4bdcd80917
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/RSAOpenSsl.cs
@@ -0,0 +1,55 @@
+//
+// RSAOpenSsl.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ public sealed class RSAOpenSsl : RSA
+ {
+ public override RSAParameters ExportParameters (bool includePrivateParameters)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void ImportParameters (RSAParameters parameters)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override byte[] SignHash (byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override bool VerifyHash (byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ // TODO: Implement full contract API
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Security.Cryptography.OpenSsl/SafeEvpPKeyHandle.cs b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/SafeEvpPKeyHandle.cs
new file mode 100644
index 0000000000..85fd74539b
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/SafeEvpPKeyHandle.cs
@@ -0,0 +1,50 @@
+//
+// SafeEvpPKeyHandle.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ public sealed class SafeEvpPKeyHandle : System.Runtime.InteropServices.SafeHandle
+ {
+ public SafeEvpPKeyHandle (IntPtr handle, bool ownsHandle)
+ : base (handle, ownsHandle)
+ {
+ }
+
+ public override bool IsInvalid { get { throw new NotImplementedException (); } }
+
+ public SafeEvpPKeyHandle DuplicateHandle ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override bool ReleaseHandle ()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Security.Cryptography.OpenSsl/System.Security.Cryptography.OpenSsl.dll.sources b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/System.Security.Cryptography.OpenSsl.dll.sources
new file mode 100644
index 0000000000..9e2bb4b66f
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.OpenSsl/System.Security.Cryptography.OpenSsl.dll.sources
@@ -0,0 +1,4 @@
+AssemblyInfo.cs
+ECDsaOpenSsl.cs
+RSAOpenSsl.cs
+SafeEvpPKeyHandle.cs
diff --git a/mcs/class/Facades/System.Security.Cryptography.Pkcs/AssemblyInfo.cs b/mcs/class/Facades/System.Security.Cryptography.Pkcs/AssemblyInfo.cs
new file mode 100644
index 0000000000..06089b35e6
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Pkcs/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Security.Cryptography.Pkcs.dll")]
+[assembly: AssemblyDescription ("System.Security.Cryptography.Pkcs.dll")]
+[assembly: AssemblyDefaultAlias ("System.Security.Cryptography.Pkcs.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Pkcs/Makefile b/mcs/class/Facades/System.Security.Cryptography.Pkcs/Makefile
new file mode 100644
index 0000000000..b98a24269b
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Pkcs/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Security.Cryptography.Pkcs
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Security.Cryptography.Pkcs.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System System.Security
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Pkcs/System.Security.Cryptography.Pkcs.dll.sources b/mcs/class/Facades/System.Security.Cryptography.Pkcs/System.Security.Cryptography.Pkcs.dll.sources
new file mode 100644
index 0000000000..8e33d4ddea
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Pkcs/System.Security.Cryptography.Pkcs.dll.sources
@@ -0,0 +1,3 @@
+TypeForwarders.cs
+AssemblyInfo.cs
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Pkcs/TypeForwarders.cs b/mcs/class/Facades/System.Security.Cryptography.Pkcs/TypeForwarders.cs
new file mode 100644
index 0000000000..db96723509
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Pkcs/TypeForwarders.cs
@@ -0,0 +1,51 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CryptographicAttributeObject))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CryptographicAttributeObjectCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CryptographicAttributeObjectEnumerator))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.AlgorithmIdentifier))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipient))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipientCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipientEnumerator))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.ContentInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.EnvelopedCms))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.KeyAgreeRecipientInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.KeyTransRecipientInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9AttributeObject))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9ContentType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9DocumentDescription))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9DocumentName))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9MessageDigest))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9SigningTime))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.PublicKeyInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoCollection))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoEnumerator))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifier))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierOrKey))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierOrKeyType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Xml.X509IssuerSerial))]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Primitives/AssemblyInfo.cs b/mcs/class/Facades/System.Security.Cryptography.Primitives/AssemblyInfo.cs
new file mode 100644
index 0000000000..9b7aef5a9f
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Primitives/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Security.Cryptography.Primitives.dll")]
+[assembly: AssemblyDescription ("System.Security.Cryptography.Primitives.dll")]
+[assembly: AssemblyDefaultAlias ("System.Security.Cryptography.Primitives.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Primitives/Makefile b/mcs/class/Facades/System.Security.Cryptography.Primitives/Makefile
new file mode 100644
index 0000000000..b4c114a7e1
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Primitives/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Security.Cryptography.Primitives
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Security.Cryptography.Primitives.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Primitives/System.Security.Cryptography.Primitives.dll.sources b/mcs/class/Facades/System.Security.Cryptography.Primitives/System.Security.Cryptography.Primitives.dll.sources
new file mode 100644
index 0000000000..8e33d4ddea
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Primitives/System.Security.Cryptography.Primitives.dll.sources
@@ -0,0 +1,3 @@
+TypeForwarders.cs
+AssemblyInfo.cs
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.Security.Cryptography.Primitives/TypeForwarders.cs
new file mode 100644
index 0000000000..ea7934eb39
--- /dev/null
+++ b/mcs/class/Facades/System.Security.Cryptography.Primitives/TypeForwarders.cs
@@ -0,0 +1,37 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricAlgorithm))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CipherMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CryptographicException))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CryptoStream))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CryptoStreamMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HashAlgorithm))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HashAlgorithmName))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMAC))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ICryptoTransform))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.KeyedHashAlgorithm))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.KeySizes))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.PaddingMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SymmetricAlgorithm))]
+
+
diff --git a/mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile b/mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile
index 6e783c13ed..82db200364 100644
--- a/mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Security.Cryptography.X509Certificates.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
+LIB_REFS = System System.Core
LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.X509Certificates/TypeForwarders.cs b/mcs/class/Facades/System.Security.Cryptography.X509Certificates/TypeForwarders.cs
index 4984b098b6..a653d295fa 100644
--- a/mcs/class/Facades/System.Security.Cryptography.X509Certificates/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Security.Cryptography.X509Certificates/TypeForwarders.cs
@@ -20,7 +20,7 @@
// THE SOFTWARE.
//
-//TODO:[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeX509ChainHandle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeX509ChainHandle))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.X509Certificates.OpenFlags))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.X509Certificates.PublicKey))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.X509Certificates.StoreLocation))]
@@ -56,5 +56,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierExtension))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierHashAlgorithm))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.X509Certificates.X509VerificationFlags))]
-
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.X509Certificates.ECDsaCertificateExtensions))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.X509Certificates.RSACertificateExtensions))]
diff --git a/mcs/class/Facades/System.Security.Principal.Windows/TypeForwarders.cs b/mcs/class/Facades/System.Security.Principal.Windows/TypeForwarders.cs
index 8ce4172c84..ec9f05c624 100644
--- a/mcs/class/Facades/System.Security.Principal.Windows/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Security.Principal.Windows/TypeForwarders.cs
@@ -20,7 +20,7 @@
// THE SOFTWARE.
//
-//TODO:[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Principal.IdentityNotMappedException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Principal.IdentityReference))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Principal.IdentityReferenceCollection))]
diff --git a/mcs/class/Facades/System.Security.SecureString/SecureStringMarshal.cs b/mcs/class/Facades/System.Security.SecureString/SecureStringMarshal.cs
new file mode 100644
index 0000000000..59c85a4291
--- /dev/null
+++ b/mcs/class/Facades/System.Security.SecureString/SecureStringMarshal.cs
@@ -0,0 +1,47 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+namespace System.Security
+{
+ public static class SecureStringMarshal
+ {
+ public static IntPtr SecureStringToCoTaskMemAnsi (SecureString s)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IntPtr SecureStringToCoTaskMemUnicode (SecureString s)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IntPtr SecureStringToGlobalAllocAnsi (SecureString s)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IntPtr SecureStringToGlobalAllocUnicode (SecureString s)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
diff --git a/mcs/class/Facades/System.Security.SecureString/System.Security.SecureString.dll.sources b/mcs/class/Facades/System.Security.SecureString/System.Security.SecureString.dll.sources
index 8e33d4ddea..870ef24588 100644
--- a/mcs/class/Facades/System.Security.SecureString/System.Security.SecureString.dll.sources
+++ b/mcs/class/Facades/System.Security.SecureString/System.Security.SecureString.dll.sources
@@ -1,3 +1,3 @@
TypeForwarders.cs
AssemblyInfo.cs
-
+SecureStringMarshal.cs
diff --git a/mcs/class/Facades/System.Security.SecureString/TypeForwarders.cs b/mcs/class/Facades/System.Security.SecureString/TypeForwarders.cs
index d8898cbe77..4267f40e03 100644
--- a/mcs/class/Facades/System.Security.SecureString/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Security.SecureString/TypeForwarders.cs
@@ -21,5 +21,3 @@
//
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.SecureString))]
-
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.SecureStringMarshal))]
diff --git a/mcs/class/Facades/System.ServiceModel.Duplex/TypeForwarders.cs b/mcs/class/Facades/System.ServiceModel.Duplex/TypeForwarders.cs
index 89df055377..09d884b152 100644
--- a/mcs/class/Facades/System.ServiceModel.Duplex/TypeForwarders.cs
+++ b/mcs/class/Facades/System.ServiceModel.Duplex/TypeForwarders.cs
@@ -20,9 +20,7 @@
// THE SOFTWARE.
//
-#if !MOBILE && !XAMMAC_4_5
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CallbackBehaviorAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.DuplexChannelFactory<>))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.DuplexClientBase<>))]
-#endif
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.InstanceContext))]
diff --git a/mcs/class/Facades/System.ServiceModel.Http/TypeForwarders.cs b/mcs/class/Facades/System.ServiceModel.Http/TypeForwarders.cs
index 57276e7078..4aa28e9e49 100644
--- a/mcs/class/Facades/System.ServiceModel.Http/TypeForwarders.cs
+++ b/mcs/class/Facades/System.ServiceModel.Http/TypeForwarders.cs
@@ -24,6 +24,9 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpMessageCredentialType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpSecurity))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpSecurityMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpsBinding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpsSecurity))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpsSecurityMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.HttpRequestMessageProperty))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.HttpResponseMessageProperty))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.HttpsTransportBindingElement))]
@@ -35,5 +38,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpClientCredentialType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpTransportSecurity))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpBinding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpsBinding))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpMessageEncoding))]
diff --git a/mcs/class/Facades/System.ServiceModel.NetTcp/TypeForwarders.cs b/mcs/class/Facades/System.ServiceModel.NetTcp/TypeForwarders.cs
index a80d1c6fd1..f03bc06d93 100644
--- a/mcs/class/Facades/System.ServiceModel.NetTcp/TypeForwarders.cs
+++ b/mcs/class/Facades/System.ServiceModel.NetTcp/TypeForwarders.cs
@@ -20,7 +20,6 @@
// THE SOFTWARE.
//
-#if !MOBILE && !XAMMAC_4_5
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ConnectionOrientedTransportBindingElement))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.SslStreamSecurityBindingElement))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.TcpConnectionPoolSettings))]
@@ -30,5 +29,4 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetTcpBinding))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetTcpSecurity))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.TcpTransportSecurity))]
-#endif
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.TcpClientCredentialType))]
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/Makefile b/mcs/class/Facades/System.ServiceModel.Primitives/Makefile
index 0827bf9426..7f0ddad7f7 100644
--- a/mcs/class/Facades/System.ServiceModel.Primitives/Makefile
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/Makefile
@@ -11,9 +11,13 @@ LIBRARY = System.ServiceModel.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System.ServiceModel System.Xml
+LIB_REFS = System.ServiceModel System System.Xml Facades/System.Security.Cryptography.X509Certificates
LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib
+ifneq (2.1, $(FRAMEWORK_VERSION))
+LIB_REFS += System.IdentityModel
+endif
+
PLATFORM_DEBUG_FLAGS =
NO_TEST = yes
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives.dll.sources b/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives.dll.sources
index 8e33d4ddea..f43e364288 100644
--- a/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives.dll.sources
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives.dll.sources
@@ -1,3 +1,9 @@
TypeForwarders.cs
AssemblyInfo.cs
+../../../build/common/MonoTODOAttribute.cs
+X509ServiceCertificateAuthentication_mobile.cs
+X509CertificateValidator_mobile.cs
+X509CertificateValidationMode_mobile.cs
+X509CertificateRecipientClientCredential_mobile.cs
+X509CertificateInitiatorClientCredential_mobile.cs
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.ServiceModel.Primitives/TypeForwarders.cs
index 38f834268c..b584fc0b8e 100644
--- a/mcs/class/Facades/System.ServiceModel.Primitives/TypeForwarders.cs
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/TypeForwarders.cs
@@ -136,6 +136,7 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageContractMemberAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageCredentialType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageHeader<>))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageHeaderAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageHeaderException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageParameterAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationContext))]
@@ -158,3 +159,16 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.UnknownMessageReceivedEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.XmlSerializerFormatAttribute))]
+#if !MOBILE && !XAMMAC_4_5
+
+// TODO: These are implemented as stubs in the facade directly on mobile (contrary to Desktop where they're forwarded to System.ServiceModel.dll/System.IdentityModel.dll).
+// I'm not 100% sure this is the right approach, but Marek thinks it's fine so I'm sticking with it for now.
+// The problem on mobile is that types like X509CertificateValidator live in System.IdentityModel.dll which is not built for mobile.
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IdentityModel.Selectors.X509CertificateValidator))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.X509CertificateValidationMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.X509ServiceCertificateAuthentication))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.X509CertificateInitiatorClientCredential))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.X509CertificateRecipientClientCredential))]
+
+#endif
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateInitiatorClientCredential_mobile.cs b/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateInitiatorClientCredential_mobile.cs
new file mode 100644
index 0000000000..daf321c22e
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateInitiatorClientCredential_mobile.cs
@@ -0,0 +1,72 @@
+//
+// X509CertificateInitiatorClientCredential_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.ServiceModel.Security
+{
+ public sealed class X509CertificateInitiatorClientCredential
+ {
+ [MonoTODO]
+ public X509Certificate2 Certificate
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ internal X509CertificateInitiatorClientCredential()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void SetCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void SetCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateRecipientClientCredential_mobile.cs b/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateRecipientClientCredential_mobile.cs
new file mode 100644
index 0000000000..3545b724b5
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateRecipientClientCredential_mobile.cs
@@ -0,0 +1,117 @@
+//
+// X509CertificateRecipientClientCredential_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System;
+using System.Collections.Generic;
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.ServiceModel.Security
+{
+ public sealed class X509CertificateRecipientClientCredential
+ {
+ [MonoTODO]
+ public X509ServiceCertificateAuthentication Authentication
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public X509Certificate2 DefaultCertificate
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public Dictionary ScopedCertificates
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public X509ServiceCertificateAuthentication SslCertificateAuthentication
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ internal X509CertificateRecipientClientCredential ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void SetDefaultCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void SetDefaultCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void SetScopedCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue, Uri targetService)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void SetScopedCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName, Uri targetService)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateValidationMode_mobile.cs b/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateValidationMode_mobile.cs
new file mode 100644
index 0000000000..34b1d241c6
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateValidationMode_mobile.cs
@@ -0,0 +1,45 @@
+//
+// X509CertificateValidationMode_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+namespace System.ServiceModel.Security
+{
+ public enum X509CertificateValidationMode
+ {
+ None,
+ PeerTrust,
+ ChainTrust,
+ PeerOrChainTrust,
+ Custom
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateValidator_mobile.cs b/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateValidator_mobile.cs
new file mode 100644
index 0000000000..734e99020d
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/X509CertificateValidator_mobile.cs
@@ -0,0 +1,43 @@
+//
+// X509CertificateValidator_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.IdentityModel.Selectors
+{
+ public abstract class X509CertificateValidator
+ {
+ public abstract void Validate (X509Certificate2 certificate);
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/X509ServiceCertificateAuthentication_mobile.cs b/mcs/class/Facades/System.ServiceModel.Primitives/X509ServiceCertificateAuthentication_mobile.cs
new file mode 100644
index 0000000000..725cbd9153
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/X509ServiceCertificateAuthentication_mobile.cs
@@ -0,0 +1,95 @@
+//
+// X509ServiceCertificateAuthentication_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System;
+using System.IdentityModel.Selectors;
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.ServiceModel.Security
+{
+ public sealed class X509ServiceCertificateAuthentication
+ {
+ [MonoTODO]
+ public X509CertificateValidationMode CertificateValidationMode
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public X509CertificateValidator CustomCertificateValidator
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public X509RevocationMode RevocationMode
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public StoreLocation TrustedStoreLocation
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceModel.Security/TypeForwarders.cs b/mcs/class/Facades/System.ServiceModel.Security/TypeForwarders.cs
index 61d5b5a044..a11a6f59a0 100644
--- a/mcs/class/Facades/System.ServiceModel.Security/TypeForwarders.cs
+++ b/mcs/class/Facades/System.ServiceModel.Security/TypeForwarders.cs
@@ -24,20 +24,16 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.SecurityBindingElement))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.SecurityHeaderLayout))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.TransportSecurityBindingElement))]
-#if !MOBILE
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.DnsEndpointIdentity))]
-#if !XAMMAC_4_5
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageSecurityVersion))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.SpnEndpointIdentity))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.UpnEndpointIdentity))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.BasicSecurityProfileVersion))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.SecureConversationVersion))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.SecurityPolicyVersion))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.SecurityVersion))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.TrustVersion))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.Tokens.SecureConversationSecurityTokenParameters))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.Tokens.SecurityTokenParameters))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.Tokens.SupportingTokenParameters))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.Tokens.UserNameSecurityTokenParameters))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.TrustVersion))]
-#endif
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.SpnEndpointIdentity))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.UpnEndpointIdentity))]
-#endif
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile b/mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile
index 8c4bbbf2cb..7603ecc588 100644
--- a/mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile
@@ -12,7 +12,14 @@ LIBRARY = System.ServiceProcess.ServiceController.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.ServiceProcess.dll
+
+ifneq (2.1, $(FRAMEWORK_VERSION))
+ifndef XAMMAC_4_5
+LIB_REFS += System.ServiceProcess
+endif
+endif
+
+LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceControllerStatus_mobile.cs b/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceControllerStatus_mobile.cs
new file mode 100644
index 0000000000..f233c8bd46
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceControllerStatus_mobile.cs
@@ -0,0 +1,49 @@
+//
+// ServiceControllerStatus_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System;
+
+namespace System.ServiceProcess
+{
+ public enum ServiceControllerStatus
+ {
+ ContinuePending = 5,
+ Paused = 7,
+ PausePending = 6,
+ Running = 4,
+ StartPending = 2,
+ Stopped = 1,
+ StopPending = 3
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceController_mobile.cs b/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceController_mobile.cs
new file mode 100644
index 0000000000..f84a27d1c9
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceController_mobile.cs
@@ -0,0 +1,246 @@
+//
+// ServiceController_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace System.ServiceProcess
+{
+ public class ServiceController : IDisposable
+ {
+ [MonoTODO]
+ public bool CanPauseAndContinue
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public bool CanShutdown
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public bool CanStop
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ServiceController[] DependentServices
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public string DisplayName
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public string MachineName
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public SafeHandle ServiceHandle
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public string ServiceName
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ServiceController[] ServicesDependedOn
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ServiceType ServiceType
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ServiceStartMode StartType
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ServiceControllerStatus Status
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ServiceController (string name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public ServiceController (string name, string machineName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void Continue ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void Dispose ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual void Dispose (bool disposing)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ServiceController[] GetDevices ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ServiceController[] GetDevices (string machineName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ServiceController[] GetServices ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ServiceController[] GetServices (string machineName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void Pause ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void Refresh ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void Start ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void Start (string[] args)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void Stop ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void WaitForStatus (ServiceControllerStatus desiredStatus)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void WaitForStatus (ServiceControllerStatus desiredStatus, TimeSpan timeout)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceStartMode_mobile.cs b/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceStartMode_mobile.cs
new file mode 100644
index 0000000000..3c875c3eb6
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceStartMode_mobile.cs
@@ -0,0 +1,47 @@
+//
+// ServiceStartMode_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System;
+
+namespace System.ServiceProcess
+{
+ public enum ServiceStartMode
+ {
+ Automatic = 2,
+ Boot = 0,
+ Disabled = 4,
+ Manual = 3,
+ System = 1
+ }
+}
+
+#endif
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceType_mobile.cs b/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceType_mobile.cs
new file mode 100644
index 0000000000..ba4f144067
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/ServiceType_mobile.cs
@@ -0,0 +1,50 @@
+//
+// ServiceType_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System;
+
+namespace System.ServiceProcess
+{
+ [Flags]
+ public enum ServiceType
+ {
+ Adapter = 4,
+ FileSystemDriver = 2,
+ InteractiveProcess = 256,
+ KernelDriver = 1,
+ RecognizerDriver = 8,
+ Win32OwnProcess = 16,
+ Win32ShareProcess = 32
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/System.ServiceProcess.ServiceController.dll.sources b/mcs/class/Facades/System.ServiceProcess.ServiceController/System.ServiceProcess.ServiceController.dll.sources
index 8e33d4ddea..56e080d93c 100644
--- a/mcs/class/Facades/System.ServiceProcess.ServiceController/System.ServiceProcess.ServiceController.dll.sources
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/System.ServiceProcess.ServiceController.dll.sources
@@ -1,3 +1,9 @@
TypeForwarders.cs
AssemblyInfo.cs
+../../../build/common/MonoTODOAttribute.cs
+ServiceController_mobile.cs
+ServiceControllerStatus_mobile.cs
+ServiceStartMode_mobile.cs
+ServiceType_mobile.cs
+TimeoutException_mobile.cs
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/TimeoutException_mobile.cs b/mcs/class/Facades/System.ServiceProcess.ServiceController/TimeoutException_mobile.cs
new file mode 100644
index 0000000000..c6448d899f
--- /dev/null
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/TimeoutException_mobile.cs
@@ -0,0 +1,59 @@
+//
+// TimeoutException_mobile.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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 MOBILE || XAMMAC_4_5
+
+using System;
+
+namespace System.ServiceProcess
+{
+ public class TimeoutException : Exception
+ {
+ [MonoTODO]
+ public TimeoutException ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public TimeoutException (string message)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public TimeoutException (string message, Exception innerException)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/TypeForwarders.cs b/mcs/class/Facades/System.ServiceProcess.ServiceController/TypeForwarders.cs
index 6a21dfc46f..b14584243c 100644
--- a/mcs/class/Facades/System.ServiceProcess.ServiceController/TypeForwarders.cs
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/TypeForwarders.cs
@@ -20,10 +20,14 @@
// THE SOFTWARE.
//
+#if !MOBILE && !XAMMAC_4_5
+
+// TODO: These are implemented as stubs in the facade directly on mobile
+
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceProcess.ServiceController))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceProcess.ServiceControllerStatus))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceProcess.ServiceStartMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceProcess.ServiceType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceProcess.TimeoutException))]
-
+#endif
diff --git a/mcs/class/Facades/System.Text.Encoding.CodePages/AssemblyInfo.cs b/mcs/class/Facades/System.Text.Encoding.CodePages/AssemblyInfo.cs
new file mode 100644
index 0000000000..568942dca1
--- /dev/null
+++ b/mcs/class/Facades/System.Text.Encoding.CodePages/AssemblyInfo.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Text.Encoding.CodePages.dll")]
+[assembly: AssemblyDescription ("System.Text.Encoding.CodePages.dll")]
+[assembly: AssemblyDefaultAlias ("System.Text.Encoding.CodePages.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../msfinal.pub")]
+
+[assembly: ReferenceAssembly]
+
+
diff --git a/mcs/class/Facades/System.Text.Encoding.CodePages/CodePagesEncodingProvider.cs b/mcs/class/Facades/System.Text.Encoding.CodePages/CodePagesEncodingProvider.cs
new file mode 100644
index 0000000000..d97ad54eb8
--- /dev/null
+++ b/mcs/class/Facades/System.Text.Encoding.CodePages/CodePagesEncodingProvider.cs
@@ -0,0 +1,37 @@
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+namespace System.Text
+{
+ public sealed partial class CodePagesEncodingProvider
+ {
+ private CodePagesEncodingProvider ()
+ {
+ }
+
+ public static System.Text.EncodingProvider Instance {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Text.Encoding.CodePages/Makefile b/mcs/class/Facades/System.Text.Encoding.CodePages/Makefile
new file mode 100644
index 0000000000..7430a65175
--- /dev/null
+++ b/mcs/class/Facades/System.Text.Encoding.CodePages/Makefile
@@ -0,0 +1,23 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Text.Encoding.CodePages
+SUBDIRS =
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Text.Encoding.CodePages.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
+
+PLATFORM_DEBUG_FLAGS =
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
+
+
diff --git a/mcs/class/Facades/System.Text.Encoding.CodePages/System.Text.Encoding.CodePages.dll.sources b/mcs/class/Facades/System.Text.Encoding.CodePages/System.Text.Encoding.CodePages.dll.sources
new file mode 100644
index 0000000000..db2c267a18
--- /dev/null
+++ b/mcs/class/Facades/System.Text.Encoding.CodePages/System.Text.Encoding.CodePages.dll.sources
@@ -0,0 +1,2 @@
+AssemblyInfo.cs
+CodePagesEncodingProvider.cs
diff --git a/mcs/class/Facades/System.Text.RegularExpressions/TypeForwarders.cs b/mcs/class/Facades/System.Text.RegularExpressions/TypeForwarders.cs
index be4c7cc58b..f9b4d759a4 100644
--- a/mcs/class/Facades/System.Text.RegularExpressions/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Text.RegularExpressions/TypeForwarders.cs
@@ -30,4 +30,5 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.Regex))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.RegexMatchTimeoutException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.RegexOptions))]
-
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.RegexRunner))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.RegexRunnerFactory))]
diff --git a/mcs/class/Facades/System.Threading.AccessControl/System.Threading.AccessControl.dll.sources b/mcs/class/Facades/System.Threading.AccessControl/System.Threading.AccessControl.dll.sources
index 8e33d4ddea..0d28c34398 100644
--- a/mcs/class/Facades/System.Threading.AccessControl/System.Threading.AccessControl.dll.sources
+++ b/mcs/class/Facades/System.Threading.AccessControl/System.Threading.AccessControl.dll.sources
@@ -1,3 +1,5 @@
TypeForwarders.cs
AssemblyInfo.cs
+../../../build/common/MonoTODOAttribute.cs
+ThreadingAclExtensions.cs
diff --git a/mcs/class/Facades/System.Threading.AccessControl/ThreadingAclExtensions.cs b/mcs/class/Facades/System.Threading.AccessControl/ThreadingAclExtensions.cs
new file mode 100644
index 0000000000..af61a50a0e
--- /dev/null
+++ b/mcs/class/Facades/System.Threading.AccessControl/ThreadingAclExtensions.cs
@@ -0,0 +1,75 @@
+//
+// ThreadingAclExtensions.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Security.AccessControl;
+using System.Diagnostics.Contracts;
+
+namespace System.Threading
+{
+ public static class ThreadingAclExtensions
+ {
+ [MonoTODO]
+ public static EventWaitHandleSecurity GetAccessControl (EventWaitHandle handle)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void SetAccessControl (EventWaitHandle handle, EventWaitHandleSecurity eventSecurity)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MutexSecurity GetAccessControl (Mutex mutex)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void SetAccessControl (Mutex mutex, MutexSecurity mutexSecurity)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static SemaphoreSecurity GetAccessControl (Semaphore semaphore)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void SetAccessControl (Semaphore semaphore, SemaphoreSecurity semaphoreSecurity)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Threading.AccessControl/TypeForwarders.cs b/mcs/class/Facades/System.Threading.AccessControl/TypeForwarders.cs
index 8871794f34..02fbd79cc8 100644
--- a/mcs/class/Facades/System.Threading.AccessControl/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Threading.AccessControl/TypeForwarders.cs
@@ -33,4 +33,3 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AccessControl.SemaphoreRights))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AccessControl.SemaphoreSecurity))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ThreadingAclExtensions))]
diff --git a/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolBoundHandle.cs b/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolBoundHandle.cs
new file mode 100644
index 0000000000..40253fbc05
--- /dev/null
+++ b/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolBoundHandle.cs
@@ -0,0 +1,315 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace System.Threading
+{
+ //
+ // Implementation of ThreadPoolBoundHandle that sits on top of the CLR's ThreadPool and Overlapped infrastructure
+ //
+
+ ///
+ /// Represents an I/O handle that is bound to the system thread pool and enables low-level
+ /// components to receive notifications for asynchronous I/O operations.
+ ///
+ public sealed partial class ThreadPoolBoundHandle : IDisposable
+ {
+ private readonly SafeHandle _handle;
+ private bool _isDisposed;
+
+ private ThreadPoolBoundHandle(SafeHandle handle)
+ {
+ _handle = handle;
+ }
+
+ ///
+ /// Gets the bound operating system handle.
+ ///
+ ///
+ /// A object that holds the bound operating system handle.
+ ///
+ public SafeHandle Handle
+ {
+ get { return _handle; }
+ }
+
+ ///
+ /// Returns a for the specific handle,
+ /// which is bound to the system thread pool.
+ ///
+ ///
+ /// A object that holds the operating system handle. The
+ /// handle must have been opened for overlapped I/O on the unmanaged side.
+ ///
+ ///
+ /// for , which
+ /// is bound to the system thread pool.
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// has been disposed.
+ ///
+ /// -or-
+ ///
+ /// does not refer to a valid I/O handle.
+ ///
+ /// -or-
+ ///
+ /// refers to a handle that has not been opened
+ /// for overlapped I/O.
+ ///
+ /// -or-
+ ///
+ /// refers to a handle that has already been bound.
+ ///
+ ///
+ /// This method should be called once per handle.
+ ///
+ /// -or-
+ ///
+ /// does not take ownership of ,
+ /// it remains the responsibility of the caller to call .
+ ///
+ public static ThreadPoolBoundHandle BindHandle(SafeHandle handle)
+ {
+ if (handle == null)
+ throw new ArgumentNullException(nameof(handle));
+
+ if (handle.IsClosed || handle.IsInvalid)
+ throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle));
+
+ try
+ {
+ // ThreadPool.BindHandle will always return true, otherwise, it throws. See the underlying FCall
+ // implementation in ThreadPoolNative::CorBindIoCompletionCallback to see the implementation.
+ bool succeeded = ThreadPool.BindHandle(handle);
+ Debug.Assert(succeeded);
+ }
+ catch (Exception ex)
+ { // BindHandle throws ApplicationException on full CLR and Exception on CoreCLR.
+ // We do not let either of these leak and convert them to ArgumentException to
+ // indicate that the specified handles are invalid.
+
+ if (ex.HResult == System.HResults.E_HANDLE) // Bad handle
+ throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle));
+
+ if (ex.HResult == System.HResults.E_INVALIDARG) // Handle already bound or sync handle
+ throw new ArgumentException(SR.Argument_AlreadyBoundOrSyncHandle, nameof(handle));
+
+ throw;
+ }
+
+ return new ThreadPoolBoundHandle(handle);
+ }
+
+ ///
+ /// Returns an unmanaged pointer to a structure, specifying
+ /// a delegate that is invoked when the asynchronous I/O operation is complete, a user-provided
+ /// object providing context, and managed objects that serve as buffers.
+ ///
+ ///
+ /// An delegate that represents the callback method
+ /// invoked when the asynchronous I/O operation completes.
+ ///
+ ///
+ /// A user-provided object that distinguishes this from other
+ /// instances. Can be .
+ ///
+ ///
+ /// An object or array of objects representing the input or output buffer for the operation. Each
+ /// object represents a buffer, for example an array of bytes. Can be .
+ ///
+ ///
+ /// An unmanaged pointer to a structure.
+ ///
+ ///
+ ///
+ /// The unmanaged pointer returned by this method can be passed to the operating system in
+ /// overlapped I/O operations. The structure is fixed in
+ /// physical memory until is called.
+ ///
+ ///
+ /// The buffer or buffers specified in must be the same as those passed
+ /// to the unmanaged operating system function that performs the asynchronous I/O.
+ ///
+ ///
+ /// The buffers specified in are pinned for the duration of
+ /// the I/O operation.
+ ///
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// This method was called after the was disposed.
+ ///
+ public unsafe NativeOverlapped* AllocateNativeOverlapped(IOCompletionCallback callback, object state, object pinData)
+ {
+ if (callback == null)
+ throw new ArgumentNullException(nameof(callback));
+
+ EnsureNotDisposed();
+
+ ThreadPoolBoundHandleOverlapped overlapped = new ThreadPoolBoundHandleOverlapped(callback, state, pinData, preAllocated: null);
+ overlapped._boundHandle = this;
+ return overlapped._nativeOverlapped;
+ }
+
+ ///
+ /// Returns an unmanaged pointer to a structure, using the callback,
+ /// state, and buffers associated with the specified object.
+ ///
+ ///
+ /// A object from which to create the NativeOverlapped pointer.
+ ///
+ ///
+ /// An unmanaged pointer to a structure.
+ ///
+ ///
+ ///
+ /// The unmanaged pointer returned by this method can be passed to the operating system in
+ /// overlapped I/O operations. The structure is fixed in
+ /// physical memory until is called.
+ ///
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// is currently in use for another I/O operation.
+ ///
+ ///
+ /// This method was called after the was disposed, or
+ /// this method was called after was disposed.
+ ///
+ ///
+ public unsafe NativeOverlapped* AllocateNativeOverlapped(PreAllocatedOverlapped preAllocated)
+ {
+ if (preAllocated == null)
+ throw new ArgumentNullException(nameof(preAllocated));
+
+ EnsureNotDisposed();
+
+ preAllocated.AddRef();
+ try
+ {
+ ThreadPoolBoundHandleOverlapped overlapped = preAllocated._overlapped;
+
+ if (overlapped._boundHandle != null)
+ throw new ArgumentException(SR.Argument_PreAllocatedAlreadyAllocated, nameof(preAllocated));
+
+ overlapped._boundHandle = this;
+
+ return overlapped._nativeOverlapped;
+ }
+ catch
+ {
+ preAllocated.Release();
+ throw;
+ }
+ }
+
+ ///
+ /// Frees the unmanaged memory associated with a structure
+ /// allocated by the method.
+ ///
+ ///
+ /// An unmanaged pointer to the structure to be freed.
+ ///
+ ///
+ ///
+ /// You must call the method exactly once
+ /// on every unmanaged pointer allocated using the
+ /// method.
+ /// If you do not call the method, you will
+ /// leak memory. If you call the method more
+ /// than once on the same unmanaged pointer, memory will be corrupted.
+ ///
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// This method was called after the was disposed.
+ ///
+ public unsafe void FreeNativeOverlapped(NativeOverlapped* overlapped)
+ {
+ if (overlapped == null)
+ throw new ArgumentNullException(nameof(overlapped));
+
+ // Note: we explicitly allow FreeNativeOverlapped calls after the ThreadPoolBoundHandle has been Disposed.
+
+ ThreadPoolBoundHandleOverlapped wrapper = GetOverlappedWrapper(overlapped, this);
+
+ if (wrapper._boundHandle != this)
+ throw new ArgumentException(SR.Argument_NativeOverlappedWrongBoundHandle, nameof(overlapped));
+
+ if (wrapper._preAllocated != null)
+ wrapper._preAllocated.Release();
+ else
+ Overlapped.Free(overlapped);
+ }
+
+ ///
+ /// Returns the user-provided object specified when the instance was
+ /// allocated using the .
+ ///
+ ///
+ /// An unmanaged pointer to the structure from which to return the
+ /// asscociated user-provided object.
+ ///
+ ///
+ /// A user-provided object that distinguishes this
+ /// from other instances, otherwise, if one was
+ /// not specified when the instance was allocated using .
+ ///
+ ///
+ /// is .
+ ///
+ public unsafe static object GetNativeOverlappedState(NativeOverlapped* overlapped)
+ {
+ if (overlapped == null)
+ throw new ArgumentNullException(nameof(overlapped));
+
+ ThreadPoolBoundHandleOverlapped wrapper = GetOverlappedWrapper(overlapped, null);
+ Debug.Assert(wrapper._boundHandle != null);
+ return wrapper._userState;
+ }
+
+ private static unsafe ThreadPoolBoundHandleOverlapped GetOverlappedWrapper(NativeOverlapped* overlapped, ThreadPoolBoundHandle expectedBoundHandle)
+ {
+ ThreadPoolBoundHandleOverlapped wrapper;
+ try
+ {
+ wrapper = (ThreadPoolBoundHandleOverlapped)Overlapped.Unpack(overlapped);
+ }
+ catch (NullReferenceException ex)
+ {
+ throw new ArgumentException(SR.Argument_NativeOverlappedAlreadyFree, nameof(overlapped), ex);
+ }
+
+ return wrapper;
+ }
+
+ public void Dispose()
+ {
+ // .NET Native's version of ThreadPoolBoundHandle that wraps the Win32 ThreadPool holds onto
+ // native resources so it needs to be disposable. To match the contract, we are also disposable.
+ // We also implement a disposable state to mimic behavior between this implementation and
+ // .NET Native's version (code written against us, will also work against .NET Native's version).
+ _isDisposed = true;
+ }
+
+
+ private void EnsureNotDisposed()
+ {
+ if (_isDisposed)
+ throw new ObjectDisposedException(GetType().ToString());
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolBoundHandleOverlapped.cs b/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolBoundHandleOverlapped.cs
new file mode 100644
index 0000000000..2245254ed2
--- /dev/null
+++ b/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolBoundHandleOverlapped.cs
@@ -0,0 +1,50 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Threading
+{
+ ///
+ /// Overlapped subclass adding data needed by ThreadPoolBoundHandle.
+ ///
+ internal sealed class ThreadPoolBoundHandleOverlapped : Overlapped
+ {
+ private readonly IOCompletionCallback _userCallback;
+ internal readonly object _userState;
+ internal PreAllocatedOverlapped _preAllocated;
+ internal unsafe NativeOverlapped* _nativeOverlapped;
+ internal ThreadPoolBoundHandle _boundHandle;
+ internal bool _completed;
+
+ public unsafe ThreadPoolBoundHandleOverlapped(IOCompletionCallback callback, object state, object pinData, PreAllocatedOverlapped preAllocated)
+ {
+ _userCallback = callback;
+ _userState = state;
+ _preAllocated = preAllocated;
+
+ _nativeOverlapped = Pack(CompletionCallback, pinData);
+ _nativeOverlapped->OffsetLow = 0; // CLR reuses NativeOverlapped instances and does not reset these
+ _nativeOverlapped->OffsetHigh = 0;
+ }
+
+ private unsafe static void CompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped)
+ {
+ ThreadPoolBoundHandleOverlapped overlapped = (ThreadPoolBoundHandleOverlapped)Overlapped.Unpack(nativeOverlapped);
+
+ //
+ // The Win32 thread pool implementation of ThreadPoolBoundHandle does not permit reuse of NativeOverlapped
+ // pointers without freeing them and allocating new a new one. We need to ensure that code using the CLR
+ // ThreadPool implementation follows those rules.
+ //
+ if (overlapped._completed)
+ throw new InvalidOperationException(SR.InvalidOperation_NativeOverlappedReused);
+
+ overlapped._completed = true;
+
+ if (overlapped._boundHandle == null)
+ throw new InvalidOperationException(SR.Argument_NativeOverlappedAlreadyFree);
+
+ overlapped._userCallback(errorCode, numBytes, nativeOverlapped);
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolPreAllocatedOverlapped.cs b/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolPreAllocatedOverlapped.cs
new file mode 100644
index 0000000000..dfc7d47272
--- /dev/null
+++ b/mcs/class/Facades/System.Threading.Overlapped/ClrThreadPoolPreAllocatedOverlapped.cs
@@ -0,0 +1,104 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Threading
+{
+ ///
+ /// Represents pre-allocated state for native overlapped I/O operations.
+ ///
+ ///
+ public sealed class PreAllocatedOverlapped : IDisposable, IDeferredDisposable
+ {
+ internal readonly ThreadPoolBoundHandleOverlapped _overlapped;
+ private DeferredDisposableLifetime _lifetime;
+
+ ///
+ /// Initializes a new instance of the class, specifying
+ /// a delegate that is invoked when each asynchronous I/O operation is complete, a user-provided
+ /// object providing context, and managed objects that serve as buffers.
+ ///
+ ///
+ /// An delegate that represents the callback method
+ /// invoked when each asynchronous I/O operation completes.
+ ///
+ ///
+ /// A user-provided object that distinguishes instance produced from this
+ /// object from other instances. Can be .
+ ///
+ ///
+ /// An object or array of objects representing the input or output buffer for the operations. Each
+ /// object represents a buffer, for example an array of bytes. Can be .
+ ///
+ ///
+ /// The new instance can be passed to
+ /// , to produce
+ /// a instance that can be passed to the operating system in overlapped
+ /// I/O operations. A single instance can only be used for
+ /// a single native I/O operation at a time. However, the state stored in the
+ /// instance can be reused for subsequent native operations.
+ ///
+ /// The buffers specified in are pinned until is called.
+ ///
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// This method was called after the was disposed.
+ ///
+ public unsafe PreAllocatedOverlapped(IOCompletionCallback callback, object state, object pinData)
+ {
+ if (callback == null)
+ throw new ArgumentNullException(nameof(callback));
+
+ _overlapped = new ThreadPoolBoundHandleOverlapped(callback, state, pinData, this);
+ }
+
+ internal bool AddRef()
+ {
+ return _lifetime.AddRef(this);
+ }
+
+ internal void Release()
+ {
+ _lifetime.Release(this);
+ }
+
+ ///
+ /// Frees the resources associated with this instance.
+ ///
+ public unsafe void Dispose()
+ {
+ _lifetime.Dispose(this);
+ GC.SuppressFinalize(this);
+ }
+
+ ~PreAllocatedOverlapped()
+ {
+ //
+ // During shutdown, don't automatically clean up, because this instance may still be
+ // reachable/usable by other code.
+ //
+ if (!Environment.HasShutdownStarted)
+ Dispose();
+ }
+
+ unsafe void IDeferredDisposable.OnFinalRelease(bool disposed)
+ {
+ if (_overlapped != null)
+ {
+ if (disposed)
+ {
+ Overlapped.Free(_overlapped._nativeOverlapped);
+ }
+ else
+ {
+ _overlapped._boundHandle = null;
+ _overlapped._completed = false;
+ *_overlapped._nativeOverlapped = default(NativeOverlapped);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Threading.Overlapped/DeferredDisposableLifetime.cs b/mcs/class/Facades/System.Threading.Overlapped/DeferredDisposableLifetime.cs
new file mode 100644
index 0000000000..24509062c7
--- /dev/null
+++ b/mcs/class/Facades/System.Threading.Overlapped/DeferredDisposableLifetime.cs
@@ -0,0 +1,116 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+
+namespace System.Threading
+{
+ ///
+ /// Provides callbacks to objects whose lifetime is managed by .
+ ///
+ internal interface IDeferredDisposable
+ {
+ ///
+ /// Called when the object's refcount reaches zero.
+ ///
+ ///
+ /// Indicates whether the object has been disposed.
+ ///
+ ///
+ /// If the refount reaches zero before the object is disposed, this method will be called with
+ /// set to false. If the object is then disposed, this method will be
+ /// called again, with set to true. If the refcount reaches zero
+ /// after the object has already been disposed, this will be called a single time, with
+ /// set to true.
+ ///
+ void OnFinalRelease(bool disposed);
+ }
+
+ ///
+ /// Manages the lifetime of an object which implements IDisposable, but which must defer the actual
+ /// cleanup of state until all existing uses of the object are complete.
+ ///
+ /// The type of object whose lifetime will be managed.
+ ///
+ /// This type maintains a reference count, and tracks whether the object has been disposed. When
+ /// Callbacks are made to when the refcount
+ /// reaches zero. Objects that need to defer cleanup until they have been disposed *and* they have
+ /// no more references can do so in when
+ /// 'disposed' is true.
+ ///
+ internal struct DeferredDisposableLifetime where T : class, IDeferredDisposable
+ {
+ //
+ // _count is positive until Dispose is called, after which it's (-1 - refcount).
+ //
+ private int _count;
+
+ public bool AddRef(T obj)
+ {
+ while (true)
+ {
+ int oldCount = Volatile.Read(ref _count);
+
+ // Have we been disposed?
+ if (oldCount < 0)
+ throw new ObjectDisposedException(typeof(T).ToString());
+
+ int newCount = checked(oldCount + 1);
+
+ if (Interlocked.CompareExchange(ref _count, newCount, oldCount) == oldCount)
+ return true;
+ }
+ }
+
+ public void Release(T obj)
+ {
+ while (true)
+ {
+ int oldCount = Volatile.Read(ref _count);
+ if (oldCount > 0)
+ {
+ // We haven't been disposed. Decrement _count.
+ int newCount = oldCount - 1;
+ if (Interlocked.CompareExchange(ref _count, newCount, oldCount) == oldCount)
+ {
+ if (newCount == 0)
+ obj.OnFinalRelease(disposed: false);
+ return;
+ }
+ }
+ else
+ {
+ Debug.Assert(oldCount != 0 && oldCount != -1);
+
+ // We've been disposed. Increment _count.
+ int newCount = oldCount + 1;
+ if (Interlocked.CompareExchange(ref _count, newCount, oldCount) == oldCount)
+ {
+ if (newCount == -1)
+ obj.OnFinalRelease(disposed: true);
+ return;
+ }
+ }
+ }
+ }
+
+ public void Dispose(T obj)
+ {
+ while (true)
+ {
+ int oldCount = Volatile.Read(ref _count);
+ if (oldCount < 0)
+ return; // already disposed
+
+ int newCount = -1 - oldCount;
+ if (Interlocked.CompareExchange(ref _count, newCount, oldCount) == oldCount)
+ {
+ if (newCount == -1)
+ obj.OnFinalRelease(disposed: true);
+ return;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Threading.Overlapped/HResults.cs b/mcs/class/Facades/System.Threading.Overlapped/HResults.cs
new file mode 100644
index 0000000000..ef9a772aaa
--- /dev/null
+++ b/mcs/class/Facades/System.Threading.Overlapped/HResults.cs
@@ -0,0 +1,38 @@
+//
+// HResults.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System
+{
+ internal static class HResults
+ {
+ internal const int E_HANDLE = unchecked((int)0x80070006);
+ internal const int E_INVALIDARG = unchecked((int)0x80070057);
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Threading.Overlapped/Makefile b/mcs/class/Facades/System.Threading.Overlapped/Makefile
index b1d02543c9..a8f8e1ad0d 100644
--- a/mcs/class/Facades/System.Threading.Overlapped/Makefile
+++ b/mcs/class/Facades/System.Threading.Overlapped/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Overlapped.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib
+LIB_MCS_FLAGS = $(SIGN_FLAGS) -unsafe /r:mscorlib
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading.Overlapped/SR.cs b/mcs/class/Facades/System.Threading.Overlapped/SR.cs
new file mode 100644
index 0000000000..a65446d4b5
--- /dev/null
+++ b/mcs/class/Facades/System.Threading.Overlapped/SR.cs
@@ -0,0 +1,11 @@
+// strings taken from corefx
+
+class SR
+{
+ public const string Argument_AlreadyBoundOrSyncHandle = "'handle' has already been bound to the thread pool, or was not opened for asynchronous I/O.";
+ public const string Argument_InvalidHandle = "'handle' has been disposed or is an invalid handle.";
+ public const string Argument_NativeOverlappedAlreadyFree = "'overlapped' has already been freed.";
+ public const string Argument_NativeOverlappedWrongBoundHandle = "'overlapped' was not allocated by this ThreadPoolBoundHandle instance.";
+ public const string Argument_PreAllocatedAlreadyAllocated = "'preAllocated' is already in use.";
+ public const string InvalidOperation_NativeOverlappedReused = "NativeOverlapped cannot be reused for multiple operations.";
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Threading.Overlapped/System.Threading.Overlapped.dll.sources b/mcs/class/Facades/System.Threading.Overlapped/System.Threading.Overlapped.dll.sources
index 8e33d4ddea..eb1041a8bb 100644
--- a/mcs/class/Facades/System.Threading.Overlapped/System.Threading.Overlapped.dll.sources
+++ b/mcs/class/Facades/System.Threading.Overlapped/System.Threading.Overlapped.dll.sources
@@ -1,3 +1,9 @@
TypeForwarders.cs
AssemblyInfo.cs
+ClrThreadPoolBoundHandle.cs
+ClrThreadPoolBoundHandleOverlapped.cs
+ClrThreadPoolPreAllocatedOverlapped.cs
+DeferredDisposableLifetime.cs
+SR.cs
+HResults.cs
diff --git a/mcs/class/Facades/System.Threading.Overlapped/TypeForwarders.cs b/mcs/class/Facades/System.Threading.Overlapped/TypeForwarders.cs
index 127e5a1f08..dd272df5d9 100644
--- a/mcs/class/Facades/System.Threading.Overlapped/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Threading.Overlapped/TypeForwarders.cs
@@ -22,6 +22,3 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.IOCompletionCallback))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.NativeOverlapped))]
-
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.PreAllocatedOverlapped))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ThreadPoolBoundHandle))]
diff --git a/mcs/class/Facades/System.Xml.ReaderWriter/TypeForwarders.cs b/mcs/class/Facades/System.Xml.ReaderWriter/TypeForwarders.cs
index 1b3e7a3a46..a4915b9461 100644
--- a/mcs/class/Facades/System.Xml.ReaderWriter/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Xml.ReaderWriter/TypeForwarders.cs
@@ -47,4 +47,5 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.IXmlSerializable))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlDateTimeSerializationMode))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlSchemaProviderAttribute))]
diff --git a/mcs/class/Facades/System.Xml.XPath.XDocument/Makefile b/mcs/class/Facades/System.Xml.XPath.XDocument/Makefile
index a75dedf37f..2ec8348e64 100644
--- a/mcs/class/Facades/System.Xml.XPath.XDocument/Makefile
+++ b/mcs/class/Facades/System.Xml.XPath.XDocument/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Xml.XPath.XDocument.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Xml.Linq.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Xml.dll /r:System.Xml.Linq.dll
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Xml.XPath.XDocument/System.Xml.XPath.XDocument.dll.sources b/mcs/class/Facades/System.Xml.XPath.XDocument/System.Xml.XPath.XDocument.dll.sources
index 8e33d4ddea..dc18bbbbcb 100644
--- a/mcs/class/Facades/System.Xml.XPath.XDocument/System.Xml.XPath.XDocument.dll.sources
+++ b/mcs/class/Facades/System.Xml.XPath.XDocument/System.Xml.XPath.XDocument.dll.sources
@@ -1,3 +1,3 @@
TypeForwarders.cs
AssemblyInfo.cs
-
+XDocumentExtensions.cs
diff --git a/mcs/class/Facades/System.Xml.XPath.XDocument/TypeForwarders.cs b/mcs/class/Facades/System.Xml.XPath.XDocument/TypeForwarders.cs
index a9ce64258f..0fec9f720b 100644
--- a/mcs/class/Facades/System.Xml.XPath.XDocument/TypeForwarders.cs
+++ b/mcs/class/Facades/System.Xml.XPath.XDocument/TypeForwarders.cs
@@ -22,4 +22,3 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XPath.Extensions))]
-//Missing: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XPath.XDocumentExtensions))]
diff --git a/mcs/class/Facades/System.Xml.XPath.XDocument/XDocumentExtensions.cs b/mcs/class/Facades/System.Xml.XPath.XDocument/XDocumentExtensions.cs
new file mode 100644
index 0000000000..d254f73fe4
--- /dev/null
+++ b/mcs/class/Facades/System.Xml.XPath.XDocument/XDocumentExtensions.cs
@@ -0,0 +1,29 @@
+
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Xml.Linq;
+
+namespace System.Xml.XPath
+{
+ public static class XDocumentExtensions
+ {
+ private class XDocumentNavigable : IXPathNavigable
+ {
+ private XNode _node;
+ public XDocumentNavigable(XNode n)
+ {
+ _node = n;
+ }
+ public XPathNavigator CreateNavigator()
+ {
+ return _node.CreateNavigator();
+ }
+ }
+ public static IXPathNavigable ToXPathNavigable(this XNode node)
+ {
+ return new XDocumentNavigable(node);
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Facades/subdirs.make b/mcs/class/Facades/subdirs.make
index 0e18045fc8..e1f56af6a2 100644
--- a/mcs/class/Facades/subdirs.make
+++ b/mcs/class/Facades/subdirs.make
@@ -3,13 +3,13 @@
# Caution while renaming SUBDIRS variables as those are used outside mono repository.
# ie: macccore/builds/Makefile
-monotouch_PARALLEL_SUBDIRS = System.Collections.Concurrent System.Collections System.ComponentModel.Annotations System.ComponentModel.EventBasedAsync System.ComponentModel \
+common_SUBDIRS = System.Collections.Concurrent System.Collections System.ComponentModel.Annotations System.ComponentModel.EventBasedAsync System.ComponentModel \
System.Diagnostics.Contracts System.Diagnostics.Debug System.Diagnostics.Tracing System.Diagnostics.Tools System.Dynamic.Runtime System.Globalization System.IO System.Linq.Expressions \
System.Linq.Parallel System.Linq.Queryable System.Linq System.Net.NetworkInformation System.Net.Primitives System.Net.Requests System.ObjectModel \
System.Reflection.Extensions System.Reflection.Primitives System.Reflection System.Resources.ResourceManager System.Runtime.Extensions \
System.Runtime.InteropServices System.Runtime.InteropServices.WindowsRuntime System.Runtime.Numerics System.Runtime.Serialization.Json \
-System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml System.Runtime System.Security.Principal System.ServiceModel.Http \
-System.ServiceModel.Primitives System.ServiceModel.Security System.Text.Encoding.Extensions System.Text.Encoding System.Text.RegularExpressions System.Threading.Tasks.Parallel \
+System.Runtime System.Security.Principal System.ServiceModel.Http \
+System.ServiceModel.Security System.Text.Encoding.Extensions System.Text.Encoding System.Text.RegularExpressions System.Threading.Tasks.Parallel \
System.Threading.Tasks System.Threading.Timer System.Threading System.Xml.ReaderWriter System.Xml.XDocument System.Xml.XmlSerializer \
System.Runtime.Handles System.ServiceModel.Duplex System.ServiceModel.NetTcp \
Microsoft.Win32.Primitives Microsoft.Win32.Registry System.AppContext System.Collections.NonGeneric System.Collections.Specialized System.ComponentModel.Primitives \
@@ -22,24 +22,43 @@ System.Net.Utilities System.Net.WebHeaderCollection System.Net.WebSockets System
System.Security.AccessControl System.Security.Claims System.Security.Cryptography.DeriveBytes System.Security.Cryptography.Encoding System.Security.Cryptography.Encryption \
System.Security.Cryptography.Encryption.Aes System.Security.Cryptography.Encryption.ECDiffieHellman System.Security.Cryptography.Encryption.ECDsa System.Security.Cryptography.Hashing \
System.Security.Cryptography.Hashing.Algorithms System.Security.Cryptography.RSA System.Security.Cryptography.RandomNumberGenerator \
-System.Security.Cryptography.X509Certificates System.Security.Principal.Windows System.Threading.Thread System.Threading.ThreadPool \
+System.Security.Principal.Windows System.Threading.Thread System.Threading.ThreadPool \
System.Xml.XPath System.Xml.XmlDocument System.Xml.Xsl.Primitives Microsoft.Win32.Registry.AccessControl System.Diagnostics.StackTrace System.Globalization.Extensions \
System.IO.FileSystem.AccessControl System.Private.CoreLib.InteropServices System.Private.CoreLib.Threading System.Reflection.TypeExtensions \
-System.Security.SecureString System.Threading.AccessControl System.Threading.Overlapped System.Xml.XPath.XDocument
+System.Security.SecureString System.Threading.AccessControl System.Threading.Overlapped System.Xml.XPath.XDocument System.IO.Compression \
+System.Security.Cryptography.Algorithms System.Security.Cryptography.Primitives System.Text.Encoding.CodePages System.IO.FileSystem.Watcher \
+System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.IO.Pipes
+# common_SUBDIRS dependencies
+common_DEPS_SUBDIRS = System.Security.Cryptography.X509Certificates System.ServiceModel.Primitives System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml
reflection_PARALLEL_SUBDIRS = System.Reflection.Emit.ILGeneration System.Reflection.Emit.Lightweight System.Reflection.Emit
+monotouch_SUBDIRS = $(common_DEPS_SUBDIRS)
+monotouch_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
+
+mobile_static_SUBDIRS = $(monotouch_SUBDIRS)
mobile_static_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
-net_4_x_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS) System.Diagnostics.PerformanceCounter \
-System.IO.FileSystem.Watcher System.IO.Pipes System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.Net.Http.WebRequestHandler
+net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Primitives
+net_4_x_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(reflection_PARALLEL_SUBDIRS) System.Diagnostics.PerformanceCounter \
+System.Net.Http.WebRequestHandler
+monodroid_SUBDIRS = $(monotouch_SUBDIRS)
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
-xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
-xammac_net_4_5_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
+xammac_SUBDIRS = $(monotouch_SUBDIRS)
+xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
+xammac_net_4_5_SUBDIRS = $(net_4_x_SUBDIRS)
+xammac_net_4_5_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
+
+monotouch_watch_SUBDIRS = $(monotouch_SUBDIRS)
monotouch_watch_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
+
+monotouch_tv_SUBDIRS = $(monotouch_SUBDIRS)
monotouch_tv_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
+mobile_only_SUBDIRS = System.Net.Ping System.Runtime.Serialization.Formatters System.Security.Cryptography.Csp System.Security.Cryptography.Pkcs \
+System.Security.Cryptography.Cng System.Security.Cryptography.OpenSsl
+
PROFILE_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
diff --git a/mcs/class/Makefile b/mcs/class/Makefile
index 60b19a023a..3904b47749 100644
--- a/mcs/class/Makefile
+++ b/mcs/class/Makefile
@@ -22,6 +22,7 @@ mobile_common_dirs := \
corlib \
System \
System.Core \
+ System.Security \
System.XML \
Mono.Security \
System \
@@ -37,6 +38,7 @@ mobile_common_dirs := \
Mono.Data.Tds \
System.Transactions \
System.Numerics \
+ System.Numerics.Vectors \
System.Data \
Mono.Cairo \
Mono.Data.Sqlite \
@@ -47,14 +49,18 @@ mobile_common_dirs := \
System.ComponentModel.Composition.4.5 \
System.Net \
System.Net.Http \
- System.Net.Http.WebRequest \
System.Windows \
System.Xml.Serialization \
Mono.CSharp \
Microsoft.CSharp \
Mono.Security.Providers.DotNet \
Mono.Security.Providers.NewSystemSource \
- Mono.Security.Providers.NewTls
+ Mono.Security.Providers.NewTls \
+ System.Runtime.InteropServices.RuntimeInformation \
+ System.Reflection.DispatchProxy \
+ System.Xml.XPath.XmlDocument \
+ System.Reflection.Context \
+ System.Net.Http.WinHttpHandler
mobile_static_dirs := \
$(mobile_common_dirs) \
@@ -93,6 +99,7 @@ xammac_4_5_dirs := \
System \
Mono.Posix \
System.Core \
+ System.Security \
System.XML \
Mono.Security \
System \
@@ -130,10 +137,14 @@ xammac_4_5_dirs := \
Mono.CompilerServices.SymbolWriter \
System.Data.Linq \
System.Net.Http \
+ System.Net.Http.WebRequest \
Mono.Security.Providers.DotNet \
Mono.Security.Providers.OldTls \
Mono.Security.Providers.NewSystemSource \
Mono.Security.Providers.NewTls \
+ System.Runtime.InteropServices.RuntimeInformation \
+ System.Reflection.Context \
+ System.Net.Http.WinHttpHandler \
$(pcl_facade_dirs)
net_4_x_dirs := \
@@ -220,7 +231,8 @@ net_4_x_dirs := \
System.Web.Http.SelfHost \
System.Web.Http.WebHost \
Mono.Security.Providers.NewSystemSource \
- Mono.Security.Providers.NewTls
+ Mono.Security.Providers.NewTls \
+ System.Runtime.InteropServices.RuntimeInformation
# These are the subdirs which depends on libs in net_4_x_dirs
# or have proper dependencies between each other
@@ -270,6 +282,7 @@ net_4_x_parallel_dirs := \
Microsoft.VisualC \
WebMatrix.Data \
monodoc \
+ System.Reflection.Context \
$(pcl_facade_dirs)
xbuild_2_0_dirs := \
diff --git a/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs b/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
index e4d59f1466..0cf6136ae3 100644
--- a/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
+++ b/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
@@ -69,6 +69,11 @@ namespace System.Configuration
public virtual Type GetConfigType (string typeName, bool throwOnError)
{
Type type = Type.GetType (typeName);
+
+ // This code is in System.Configuration.dll, but some of the classes we might want to load here are in System.dll.
+ if (type == null)
+ type = Type.GetType (typeName + ",System");
+
if (type == null && throwOnError)
throw new ConfigurationErrorsException ("Type '" + typeName + "' not found.");
return type;
diff --git a/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptHandle.cs b/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptHandle.cs
new file mode 100644
index 0000000000..873ce5782a
--- /dev/null
+++ b/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptHandle.cs
@@ -0,0 +1,49 @@
+//
+// SafeNCryptHandle.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Microsoft.Win32.SafeHandles
+{
+ public abstract class SafeNCryptHandle : System.Runtime.InteropServices.SafeHandle
+ {
+ protected SafeNCryptHandle ()
+ : base (IntPtr.Zero, true)
+ {
+ }
+
+ public override bool IsInvalid { get { throw new NotImplementedException (); } }
+
+ protected override bool ReleaseHandle ()
+ {
+ return false;
+ }
+
+ protected abstract bool ReleaseNativeHandle();
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptKeyHandle.cs b/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptKeyHandle.cs
new file mode 100644
index 0000000000..3dcbfae8d6
--- /dev/null
+++ b/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptKeyHandle.cs
@@ -0,0 +1,42 @@
+//
+// SafeNCryptKeyHandle.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Microsoft.Win32.SafeHandles
+{
+ public sealed class SafeNCryptKeyHandle : SafeNCryptHandle
+ {
+ public SafeNCryptKeyHandle ()
+ {
+ }
+
+ protected override bool ReleaseNativeHandle ()
+ {
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptProviderHandle.cs b/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptProviderHandle.cs
new file mode 100644
index 0000000000..4a2d17ab82
--- /dev/null
+++ b/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptProviderHandle.cs
@@ -0,0 +1,42 @@
+//
+// SafeNCryptProviderHandle.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Microsoft.Win32.SafeHandles
+{
+ public sealed class SafeNCryptProviderHandle : SafeNCryptHandle
+ {
+ public SafeNCryptProviderHandle ()
+ {
+ }
+
+ protected override bool ReleaseNativeHandle ()
+ {
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptSecretHandle.cs b/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptSecretHandle.cs
new file mode 100644
index 0000000000..8943e38e48
--- /dev/null
+++ b/mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptSecretHandle.cs
@@ -0,0 +1,42 @@
+//
+// SafeNCryptSecretHandle.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Microsoft.Win32.SafeHandles
+{
+ public sealed class SafeNCryptSecretHandle : SafeNCryptHandle
+ {
+ public SafeNCryptSecretHandle ()
+ {
+ }
+
+ protected override bool ReleaseNativeHandle ()
+ {
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Core/System.IO.Pipes/AnonymousPipeClientStream.cs b/mcs/class/System.Core/System.IO.Pipes/AnonymousPipeClientStream.cs
index 2c195034d8..23bf26f748 100644
--- a/mcs/class/System.Core/System.IO.Pipes/AnonymousPipeClientStream.cs
+++ b/mcs/class/System.Core/System.IO.Pipes/AnonymousPipeClientStream.cs
@@ -63,7 +63,7 @@ namespace System.IO.Pipes
{
}
- public AnonymousPipeClientStream (PipeDirection direction,SafePipeHandle safePipeHandle)
+ public AnonymousPipeClientStream (PipeDirection direction, SafePipeHandle safePipeHandle)
: base (direction, DefaultBufferSize)
{
/*
@@ -73,7 +73,11 @@ namespace System.IO.Pipes
impl = new UnixAnonymousPipeClient (this, safePipeHandle);
*/
+#if MOBILE
+ throw new NotImplementedException ();
+#else
InitializeHandle (safePipeHandle, false, false);
+#endif
IsConnected = true;
}
diff --git a/mcs/class/System.Core/System.IO.Pipes/AnonymousPipeServerStream.cs b/mcs/class/System.Core/System.IO.Pipes/AnonymousPipeServerStream.cs
index 01e4b1dbf4..97455f30cd 100644
--- a/mcs/class/System.Core/System.IO.Pipes/AnonymousPipeServerStream.cs
+++ b/mcs/class/System.Core/System.IO.Pipes/AnonymousPipeServerStream.cs
@@ -59,10 +59,18 @@ namespace System.IO.Pipes
}
public AnonymousPipeServerStream (PipeDirection direction, HandleInheritability inheritability, int bufferSize)
+#if MOBILE
+ : base (direction, bufferSize)
+ {
+ throw new NotImplementedException ();
+ }
+#else
: this (direction, inheritability, bufferSize, null)
{
}
+#endif
+#if !MOBILE
public AnonymousPipeServerStream (PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity)
: base (direction, bufferSize)
{
@@ -77,6 +85,7 @@ namespace System.IO.Pipes
InitializeHandle (impl.Handle, false, false);
IsConnected = true;
}
+#endif
[MonoTODO]
public AnonymousPipeServerStream (PipeDirection direction, SafePipeHandle serverSafePipeHandle, SafePipeHandle clientSafePipeHandle)
@@ -90,6 +99,9 @@ namespace System.IO.Pipes
if (direction == PipeDirection.InOut)
throw new NotSupportedException ("Anonymous pipe direction can only be either in or out.");
+#if MOBILE
+ throw new NotImplementedException ();
+#else
if (IsWindows)
impl = new Win32AnonymousPipeServer (this, serverSafePipeHandle, clientSafePipeHandle);
else
@@ -99,6 +111,12 @@ namespace System.IO.Pipes
IsConnected = true;
ClientSafePipeHandle = clientSafePipeHandle;
+#endif
+ }
+
+ ~AnonymousPipeServerStream ()
+ {
+ // To be compatible with .net
}
IAnonymousPipeServer impl;
diff --git a/mcs/class/System.Core/System.IO.Pipes/NamedPipeClientStream.cs b/mcs/class/System.Core/System.IO.Pipes/NamedPipeClientStream.cs
index 357f7387d2..181ab1ccbf 100644
--- a/mcs/class/System.Core/System.IO.Pipes/NamedPipeClientStream.cs
+++ b/mcs/class/System.Core/System.IO.Pipes/NamedPipeClientStream.cs
@@ -72,21 +72,33 @@ namespace System.IO.Pipes
}
public NamedPipeClientStream (string serverName, string pipeName, PipeDirection direction, PipeOptions options, TokenImpersonationLevel impersonationLevel, HandleInheritability inheritability)
+#if MOBILE
+ : base (direction, DefaultBufferSize)
+ {
+ throw new NotImplementedException ();
+ }
+#else
: this (serverName, pipeName, ToAccessRights (direction), options, impersonationLevel, inheritability)
{
}
+#endif
public NamedPipeClientStream (PipeDirection direction, bool isAsync, bool isConnected, SafePipeHandle safePipeHandle)
: base (direction, DefaultBufferSize)
{
+#if MOBILE
+ throw new NotImplementedException ();
+#else
if (IsWindows)
impl = new Win32NamedPipeClient (this, safePipeHandle);
else
impl = new UnixNamedPipeClient (this, safePipeHandle);
IsConnected = isConnected;
InitializeHandle (safePipeHandle, true, isAsync);
+#endif
}
+#if !MOBILE
public NamedPipeClientStream (string serverName, string pipeName, PipeAccessRights desiredAccessRights, PipeOptions options, TokenImpersonationLevel impersonationLevel, HandleInheritability inheritability)
: base (ToDirection (desiredAccessRights), DefaultBufferSize)
{
@@ -99,21 +111,30 @@ namespace System.IO.Pipes
else
impl = new UnixNamedPipeClient (this, serverName, pipeName, desiredAccessRights, options, inheritability);
}
+#endif
INamedPipeClient impl;
public void Connect ()
{
+#if MOBILE
+ throw new NotImplementedException ();
+#else
impl.Connect ();
InitializeHandle (impl.Handle, false, impl.IsAsync);
IsConnected = true;
+#endif
}
public void Connect (int timeout)
{
+#if MOBILE
+ throw new NotImplementedException ();
+#else
impl.Connect (timeout);
InitializeHandle (impl.Handle, false, impl.IsAsync);
IsConnected = true;
+#endif
}
public int NumberOfServerInstances {
diff --git a/mcs/class/System.Core/System.IO.Pipes/NamedPipeServerStream.cs b/mcs/class/System.Core/System.IO.Pipes/NamedPipeServerStream.cs
index b29deaf330..2723109bd9 100644
--- a/mcs/class/System.Core/System.IO.Pipes/NamedPipeServerStream.cs
+++ b/mcs/class/System.Core/System.IO.Pipes/NamedPipeServerStream.cs
@@ -70,10 +70,18 @@ namespace System.IO.Pipes
}
public NamedPipeServerStream (string pipeName, PipeDirection direction, int maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, int inBufferSize, int outBufferSize)
+#if MOBILE
+ : base (direction, inBufferSize)
+ {
+ throw new NotImplementedException ();
+ }
+#else
: this (pipeName, direction, maxNumberOfServerInstances, transmissionMode, options, inBufferSize, outBufferSize, null)
{
}
+#endif
+#if !MOBILE
public NamedPipeServerStream (string pipeName, PipeDirection direction, int maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, int inBufferSize, int outBufferSize, PipeSecurity pipeSecurity)
: this (pipeName, direction, maxNumberOfServerInstances, transmissionMode, options, inBufferSize, outBufferSize, pipeSecurity, HandleInheritability.None)
{
@@ -101,16 +109,26 @@ namespace System.IO.Pipes
InitializeHandle (impl.Handle, false, (options & PipeOptions.Asynchronous) != PipeOptions.None);
}
+#endif
public NamedPipeServerStream (PipeDirection direction, bool isAsync, bool isConnected, SafePipeHandle safePipeHandle)
: base (direction, DefaultBufferSize)
{
+#if MOBILE
+ throw new NotImplementedException ();
+#else
if (IsWindows)
impl = new Win32NamedPipeServer (this, safePipeHandle);
else
impl = new UnixNamedPipeServer (this, safePipeHandle);
IsConnected = isConnected;
InitializeHandle (safePipeHandle, true, isAsync);
+#endif
+ }
+
+ ~NamedPipeServerStream ()
+ {
+ // To be compatible with .net
}
INamedPipeServer impl;
@@ -120,12 +138,14 @@ namespace System.IO.Pipes
impl.Disconnect ();
}
+#if !MOBILE
[MonoTODO]
[SecurityPermission (SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlPrincipal)]
public void RunAsClient (PipeStreamImpersonationWorker impersonationWorker)
{
throw new NotImplementedException ();
}
+#endif
public void WaitForConnection ()
{
@@ -140,6 +160,7 @@ namespace System.IO.Pipes
throw new NotImplementedException ();
}
+#if !MOBILE
// async operations
Action wait_connect_delegate;
@@ -156,6 +177,7 @@ namespace System.IO.Pipes
{
wait_connect_delegate.EndInvoke (asyncResult);
}
+#endif
}
}
diff --git a/mcs/class/System.Core/System.IO.Pipes/PipeStream.cs b/mcs/class/System.Core/System.IO.Pipes/PipeStream.cs
index fd4a57a693..ed030e7608 100644
--- a/mcs/class/System.Core/System.IO.Pipes/PipeStream.cs
+++ b/mcs/class/System.Core/System.IO.Pipes/PipeStream.cs
@@ -46,15 +46,18 @@ namespace System.IO.Pipes
// FIXME: not precise.
internal const int DefaultBufferSize = 0x400;
+#if !MOBILE
internal static bool IsWindows {
get { return Win32Marshal.IsWindows; }
}
+#endif
internal Exception ThrowACLException ()
{
return new NotImplementedException ("ACL is not supported in Mono");
}
+#if !MOBILE
internal static PipeAccessRights ToAccessRights (PipeDirection direction)
{
switch (direction) {
@@ -85,6 +88,7 @@ namespace System.IO.Pipes
throw new ArgumentOutOfRangeException ();
}
}
+#endif
protected PipeStream (PipeDirection direction, int bufferSize)
: this (direction, PipeTransmissionMode.Byte, bufferSize)
@@ -140,7 +144,9 @@ namespace System.IO.Pipes
set { stream = value; }
}
+#if !MOBILE
protected bool IsHandleExposed { get; private set; }
+#endif
[MonoTODO]
public bool IsMessageComplete { get; private set; }
@@ -176,7 +182,19 @@ namespace System.IO.Pipes
}
// initialize/dispose/state check
+#if MOBILE
+ internal static void CheckPipePropertyOperations ()
+ {
+ }
+ static void CheckReadOperations ()
+ {
+ }
+
+ static void CheckWriteOperations ()
+ {
+ }
+#else
[MonoTODO]
protected internal virtual void CheckPipePropertyOperations ()
{
@@ -206,6 +224,7 @@ namespace System.IO.Pipes
this.IsHandleExposed = isExposed;
this.IsAsync = isAsync;
}
+#endif
protected override void Dispose (bool disposing)
{
@@ -234,6 +253,7 @@ namespace System.IO.Pipes
throw new NotSupportedException ();
}
+#if !MOBILE
public PipeSecurity GetAccessControl ()
{
return new PipeSecurity (SafePipeHandle,
@@ -255,6 +275,7 @@ namespace System.IO.Pipes
public void WaitForPipeDrain ()
{
}
+#endif
[MonoTODO]
public override int Read ([In] byte [] buffer, int offset, int count)
@@ -298,6 +319,7 @@ namespace System.IO.Pipes
// async
+#if !MOBILE
Func read_delegate;
[HostProtection (SecurityAction.LinkDemand, ExternalThreading = true)]
@@ -327,6 +349,7 @@ namespace System.IO.Pipes
{
write_delegate.EndInvoke (asyncResult);
}
+#endif
}
}
diff --git a/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/ECDsaCertificateExtensions.cs b/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/ECDsaCertificateExtensions.cs
new file mode 100644
index 0000000000..aa5da449d7
--- /dev/null
+++ b/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/ECDsaCertificateExtensions.cs
@@ -0,0 +1,45 @@
+//
+// ECDsaCertificateExtensions.cs
+//
+// Authors:
+// Alexander Köplinger
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography.X509Certificates
+{
+ public static class ECDsaCertificateExtensions
+ {
+ [MonoTODO]
+ public static ECDsa GetECDsaPrivateKey (this X509Certificate2 certificate)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ECDsa GetECDsaPublicKey (this X509Certificate2 certificate)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
diff --git a/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs b/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs
new file mode 100644
index 0000000000..0e322e4b10
--- /dev/null
+++ b/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs
@@ -0,0 +1,45 @@
+//
+// RsaCertificateExtensions.cs
+//
+// Authors:
+// Alexander Köplinger
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography.X509Certificates
+{
+ public static class RSACertificateExtensions
+ {
+ [MonoTODO]
+ public static RSA GetRSAPrivateKey(this X509Certificate2 certificate)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static RSA GetRSAPublicKey(this X509Certificate2 certificate)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/AesCng.cs b/mcs/class/System.Core/System.Security.Cryptography/AesCng.cs
new file mode 100644
index 0000000000..64377b7bf0
--- /dev/null
+++ b/mcs/class/System.Core/System.Security.Cryptography/AesCng.cs
@@ -0,0 +1,104 @@
+//
+// AesCng.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ public sealed class AesCng : Aes
+ {
+ public AesCng ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public AesCng (string keyName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public AesCng (string keyName, CngProvider provider)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public AesCng (string keyName, CngProvider provider, CngKeyOpenOptions openOptions)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Byte[] Key {
+ get {
+ throw new NotImplementedException ();
+ } set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override int KeySize {
+ get {
+ throw new NotImplementedException ();
+ }
+
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ public override ICryptoTransform CreateDecryptor ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override ICryptoTransform CreateDecryptor (Byte[] rgbKey, Byte[] rgbIV)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override ICryptoTransform CreateEncryptor ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override ICryptoTransform CreateEncryptor (Byte[] rgbKey, Byte[] rgbIV)
+ {
+ return default(System.Security.Cryptography.ICryptoTransform);
+ }
+
+ protected override void Dispose (bool disposing) {
+ throw new NotImplementedException ();
+ }
+
+ public override void GenerateIV ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void GenerateKey ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithm.cs b/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithm.cs
deleted file mode 100644
index ea87b30112..0000000000
--- a/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithm.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// System.Security.Cryptography.CngAlgorithm
-//
-// Authors:
-// Sebastien Pouliot
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- // note: CNG stands for "Cryptography API: Next Generation"
-
- [Serializable]
- public sealed class CngAlgorithm : IEquatable {
-
- private string m_algorithm;
-
- public CngAlgorithm (string algorithm)
- {
- if (algorithm == null)
- throw new ArgumentNullException ("algorithm");
- if (algorithm.Length == 0)
- throw new ArgumentException ("algorithm");
-
- m_algorithm = algorithm;
- }
-
- public string Algorithm {
- get { return m_algorithm; }
- }
-
- public bool Equals (CngAlgorithm other)
- {
- if (other == null)
- return false;
- return m_algorithm == other.m_algorithm;
- }
-
- public override bool Equals (object obj)
- {
- return Equals (obj as CngAlgorithm);
- }
-
- public override int GetHashCode ()
- {
- return m_algorithm.GetHashCode ();
- }
-
- public override string ToString ()
- {
- return m_algorithm;
- }
-
- // static
-
- static CngAlgorithm dh256;
- static CngAlgorithm dh384;
- static CngAlgorithm dh521;
- static CngAlgorithm dsa256;
- static CngAlgorithm dsa384;
- static CngAlgorithm dsa521;
- static CngAlgorithm md5;
- static CngAlgorithm sha1;
- static CngAlgorithm sha256;
- static CngAlgorithm sha384;
- static CngAlgorithm sha512;
-
- public static CngAlgorithm ECDiffieHellmanP256 {
- get {
- if (dh256 == null)
- dh256 = new CngAlgorithm ("ECDH_P256");
- return dh256;
- }
- }
-
- public static CngAlgorithm ECDiffieHellmanP384 {
- get {
- if (dh384 == null)
- dh384 = new CngAlgorithm ("ECDH_P384");
- return dh384;
- }
- }
-
- public static CngAlgorithm ECDiffieHellmanP521 {
- get {
- if (dh521 == null)
- dh521 = new CngAlgorithm ("ECDH_P521");
- return dh521;
- }
- }
-
- public static CngAlgorithm ECDsaP256 {
- get {
- if (dsa256 == null)
- dsa256 = new CngAlgorithm ("ECDSA_P256");
- return dsa256;
- }
- }
-
- public static CngAlgorithm ECDsaP384 {
- get {
- if (dsa384 == null)
- dsa384 = new CngAlgorithm ("ECDSA_P384");
- return dsa384;
- }
- }
-
- public static CngAlgorithm ECDsaP521 {
- get {
- if (dsa521 == null)
- dsa521 = new CngAlgorithm ("ECDSA_P521");
- return dsa521;
- }
- }
-
- public static CngAlgorithm MD5 {
- get {
- if (md5 == null)
- md5 = new CngAlgorithm ("MD5");
- return md5;
- }
- }
-
- public static CngAlgorithm Sha1 {
- get {
- if (sha1 == null)
- sha1 = new CngAlgorithm ("SHA1");
- return sha1;
- }
- }
-
- public static CngAlgorithm Sha256 {
- get {
- if (sha256 == null)
- sha256 = new CngAlgorithm ("SHA256");
- return sha256;
- }
- }
-
- public static CngAlgorithm Sha384 {
- get {
- if (sha384 == null)
- sha384 = new CngAlgorithm ("SHA384");
- return sha384;
- }
- }
-
- public static CngAlgorithm Sha512 {
- get {
- if (sha512 == null)
- sha512 = new CngAlgorithm ("SHA512");
- return sha512;
- }
- }
-
- public static bool operator == (CngAlgorithm left, CngAlgorithm right)
- {
- if ((object)left == null)
- return ((object)right == null);
- return left.Equals (right);
- }
-
- public static bool operator != (CngAlgorithm left, CngAlgorithm right)
- {
- if ((object)left == null)
- return ((object)right != null);
- return !left.Equals (right);
- }
- }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithmGroup.cs b/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithmGroup.cs
deleted file mode 100644
index fa4396581b..0000000000
--- a/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithmGroup.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// System.Security.Cryptography.CngAlgorithmGroup
-//
-// Authors:
-// Sebastien Pouliot
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- // note: CNG stands for "Cryptography API: Next Generation"
-
- [Serializable]
- public sealed class CngAlgorithmGroup : IEquatable {
-
- private string m_algorithmGroup;
-
- public CngAlgorithmGroup (string algorithmGroup)
- {
- if (algorithmGroup == null)
- throw new ArgumentNullException ("algorithmGroup");
- if (algorithmGroup.Length == 0)
- throw new ArgumentException ("algorithmGroup");
-
- m_algorithmGroup = algorithmGroup;
- }
-
- public string AlgorithmGroup {
- get { return m_algorithmGroup; }
- }
-
- public bool Equals (CngAlgorithmGroup other)
- {
- if (other == null)
- return false;
- return m_algorithmGroup == other.m_algorithmGroup;
- }
-
- public override bool Equals (object obj)
- {
- return Equals (obj as CngAlgorithmGroup);
- }
-
- public override int GetHashCode ()
- {
- return m_algorithmGroup.GetHashCode ();
- }
-
- public override string ToString ()
- {
- return m_algorithmGroup;
- }
-
- // static
-
- private static CngAlgorithmGroup dh;
- private static CngAlgorithmGroup dsa;
- private static CngAlgorithmGroup ecdh;
- private static CngAlgorithmGroup ecdsa;
- private static CngAlgorithmGroup rsa;
-
- public static CngAlgorithmGroup DiffieHellman {
- get {
- if (dh == null)
- dh = new CngAlgorithmGroup ("DH");
- return dh;
- }
- }
-
- public static CngAlgorithmGroup Dsa {
- get {
- if (dsa == null)
- dsa = new CngAlgorithmGroup ("DSA");
- return dsa;
- }
- }
-
- public static CngAlgorithmGroup ECDiffieHellman {
- get {
- if (ecdh == null)
- ecdh = new CngAlgorithmGroup ("ECDH");
- return ecdh;
- }
- }
-
- public static CngAlgorithmGroup ECDsa {
- get {
- if (ecdsa == null)
- ecdsa = new CngAlgorithmGroup ("ECDSA");
- return ecdsa;
- }
- }
-
- public static CngAlgorithmGroup Rsa {
- get {
- if (rsa == null)
- rsa = new CngAlgorithmGroup ("RSA");
- return rsa;
- }
- }
-
- public static bool operator == (CngAlgorithmGroup left, CngAlgorithmGroup right)
- {
- if ((object)left == null)
- return ((object)right == null);
- return left.Equals (right);
- }
-
- public static bool operator != (CngAlgorithmGroup left, CngAlgorithmGroup right)
- {
- if ((object)left == null)
- return ((object)right != null);
- return !left.Equals (right);
- }
- }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/TripleDESCng.cs b/mcs/class/System.Core/System.Security.Cryptography/TripleDESCng.cs
new file mode 100644
index 0000000000..48f93772b6
--- /dev/null
+++ b/mcs/class/System.Core/System.Security.Cryptography/TripleDESCng.cs
@@ -0,0 +1,104 @@
+//
+// TripleDESCng.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography
+{
+ public sealed class TripleDESCng : TripleDES
+ {
+ public TripleDESCng ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public TripleDESCng (string keyName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public TripleDESCng (string keyName, CngProvider provider)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public TripleDESCng (string keyName, CngProvider provider, CngKeyOpenOptions openOptions)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Byte[] Key {
+ get {
+ throw new NotImplementedException ();
+ } set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override int KeySize {
+ get {
+ throw new NotImplementedException ();
+ }
+
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ public override ICryptoTransform CreateDecryptor ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override ICryptoTransform CreateDecryptor (Byte[] rgbKey, Byte[] rgbIV)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override ICryptoTransform CreateEncryptor ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override ICryptoTransform CreateEncryptor (Byte[] rgbKey, Byte[] rgbIV)
+ {
+ return default(System.Security.Cryptography.ICryptoTransform);
+ }
+
+ protected override void Dispose (bool disposing) {
+ throw new NotImplementedException ();
+ }
+
+ public override void GenerateIV ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void GenerateKey ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Core/common_System.Core.dll.sources b/mcs/class/System.Core/common_System.Core.dll.sources
index 455930f26f..808d7108c9 100644
--- a/mcs/class/System.Core/common_System.Core.dll.sources
+++ b/mcs/class/System.Core/common_System.Core.dll.sources
@@ -6,6 +6,25 @@ System.IO.MemoryMappedFiles/MemoryMappedFile.cs
System.IO.MemoryMappedFiles/MemoryMappedView.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedFileHandle.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs
+System.Security.Cryptography/AesCng.cs
+System.Security.Cryptography/TripleDESCng.cs
+System.Security.Cryptography.X509Certificates/ECDsaCertificateExtensions.cs
+System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs
+Microsoft.Win32.SafeHandles/SafeNCryptHandle.cs
+Microsoft.Win32.SafeHandles/SafeNCryptKeyHandle.cs
+Microsoft.Win32.SafeHandles/SafeNCryptProviderHandle.cs
+Microsoft.Win32.SafeHandles/SafeNCryptSecretHandle.cs
+Microsoft.Win32.SafeHandles/SafePipeHandle.cs
+
+System.IO.Pipes/AnonymousPipeClientStream.cs
+System.IO.Pipes/AnonymousPipeServerStream.cs
+System.IO.Pipes/NamedPipeClientStream.cs
+System.IO.Pipes/NamedPipeServerStream.cs
+System.IO.Pipes/PipeDirection.cs
+System.IO.Pipes/PipeInterfaces.cs
+System.IO.Pipes/PipeOptions.cs
+System.IO.Pipes/PipeStream.cs
+System.IO.Pipes/PipeTransmissionMode.cs
ReferenceSources/SR.cs
ReferenceSources/Error.cs
@@ -184,8 +203,20 @@ ReferenceSources/Strings.cs
../../../external/referencesource/System.Core/System/Runtime/CompilerServices/ExecutionScope.cs
../../../external/referencesource/System.Core/System/Security/Cryptography/Aes.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/CngAlgorithmGroup.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/CngKeyBlobFormat.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/CngKeyCreationParameters.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/CngProperty.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/CngProvider.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/CngUIPolicy.cs
../../../external/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs
../../../external/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
+../../../external/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs
../../../external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/ReaderWriterLockSlim.cs
diff --git a/mcs/class/System.Core/mobile_static_System.Core.dll.sources b/mcs/class/System.Core/mobile_static_System.Core.dll.sources
index 7d32d44a88..8b8fef0e40 100644
--- a/mcs/class/System.Core/mobile_static_System.Core.dll.sources
+++ b/mcs/class/System.Core/mobile_static_System.Core.dll.sources
@@ -1,2 +1,17 @@
#include common_System.Core.dll.sources
#include interpreter_System.Core.dll.sources
+
+System.Security.Cryptography/AesCryptoServiceProvider.cs
+System.Security.Cryptography/AesTransform.cs
+System.Security.Cryptography/MD5Cng.cs
+System.Security.Cryptography/SHA1Cng.cs
+System.Security.Cryptography/SHA256Cng.cs
+System.Security.Cryptography/SHA256CryptoServiceProvider.cs
+System.Security.Cryptography/SHA384Cng.cs
+System.Security.Cryptography/SHA384CryptoServiceProvider.cs
+System.Security.Cryptography/SHA512Cng.cs
+System.Security.Cryptography/SHA512CryptoServiceProvider.cs
+
+../referencesource/System.Core/System/Security/Cryptography/AesManaged.cs
+../referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs
+../referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs
diff --git a/mcs/class/System.Core/net_4_x_System.Core.dll.sources b/mcs/class/System.Core/net_4_x_System.Core.dll.sources
index 4d2ae3dd7e..967d58bea1 100644
--- a/mcs/class/System.Core/net_4_x_System.Core.dll.sources
+++ b/mcs/class/System.Core/net_4_x_System.Core.dll.sources
@@ -1,29 +1,16 @@
#include common_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
-Microsoft.Win32.SafeHandles/SafePipeHandle.cs
-
-System.IO.Pipes/AnonymousPipeClientStream.cs
-System.IO.Pipes/AnonymousPipeServerStream.cs
-System.IO.Pipes/NamedPipeClientStream.cs
-System.IO.Pipes/NamedPipeServerStream.cs
System.IO.Pipes/PipeAccessRights.cs
System.IO.Pipes/PipeAccessRule.cs
System.IO.Pipes/PipeAuditRule.cs
-System.IO.Pipes/PipeDirection.cs
-System.IO.Pipes/PipeInterfaces.cs
-System.IO.Pipes/PipeOptions.cs
System.IO.Pipes/PipeSecurity.cs
-System.IO.Pipes/PipeStream.cs
System.IO.Pipes/PipeStreamImpersonationWorker.cs
-System.IO.Pipes/PipeTransmissionMode.cs
System.IO.Pipes/PipeUnix.cs
System.IO.Pipes/PipeWin32.cs
System.Security.Cryptography/AesCryptoServiceProvider.cs
System.Security.Cryptography/AesTransform.cs
-System.Security.Cryptography/CngAlgorithm.cs
-System.Security.Cryptography/CngAlgorithmGroup.cs
System.Security.Cryptography/MD5Cng.cs
System.Security.Cryptography/SHA1Cng.cs
System.Security.Cryptography/SHA256Cng.cs
diff --git a/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlDataRecord.cs b/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlDataRecord.cs
index b928fc4086..04a93d20c2 100644
--- a/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlDataRecord.cs
+++ b/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlDataRecord.cs
@@ -35,87 +35,87 @@ namespace Microsoft.SqlServer.Server
{
public sealed class SqlDataRecord : IDataRecord
{
- public bool GetBoolean (int i)
+ public bool GetBoolean (int ordinal)
{
throw new NotImplementedException ();
}
- public byte GetByte (int i)
+ public byte GetByte (int ordinal)
{
throw new NotImplementedException ();
}
- public long GetBytes (int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
+ public long GetBytes (int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length)
{
throw new NotImplementedException ();
}
- public char GetChar (int i)
+ public char GetChar (int ordinal)
{
throw new NotImplementedException ();
}
- public long GetChars (int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
+ public long GetChars (int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length)
{
throw new NotImplementedException ();
}
- public IDataReader GetData (int i)
+ public IDataReader GetData (int ordinal)
{
throw new NotImplementedException ();
}
- public string GetDataTypeName (int i)
+ public string GetDataTypeName (int ordinal)
{
throw new NotImplementedException ();
}
- public DateTime GetDateTime (int i)
+ public DateTime GetDateTime (int ordinal)
{
throw new NotImplementedException ();
}
- public decimal GetDecimal (int i)
+ public decimal GetDecimal (int ordinal)
{
throw new NotImplementedException ();
}
- public double GetDouble (int i)
+ public double GetDouble (int ordinal)
{
throw new NotImplementedException ();
}
- public System.Type GetFieldType (int i)
+ public System.Type GetFieldType (int ordinal)
{
throw new NotImplementedException ();
}
- public float GetFloat (int i)
+ public float GetFloat (int ordinal)
{
throw new NotImplementedException ();
}
- public Guid GetGuid (int i)
+ public Guid GetGuid (int ordinal)
{
throw new NotImplementedException ();
}
- public short GetInt16 (int i)
+ public short GetInt16 (int ordinal)
{
throw new NotImplementedException ();
}
- public int GetInt32 (int i)
+ public int GetInt32 (int ordinal)
{
throw new NotImplementedException ();
}
- public long GetInt64 (int i)
+ public long GetInt64 (int ordinal)
{
throw new NotImplementedException ();
}
- public string GetName (int i)
+ public string GetName (int ordinal)
{
throw new NotImplementedException ();
}
@@ -125,12 +125,12 @@ namespace Microsoft.SqlServer.Server
throw new NotImplementedException ();
}
- public string GetString (int i)
+ public string GetString (int ordinal)
{
throw new NotImplementedException ();
}
- public object GetValue (int i)
+ public object GetValue (int ordinal)
{
throw new NotImplementedException ();
}
@@ -140,7 +140,7 @@ namespace Microsoft.SqlServer.Server
throw new NotImplementedException ();
}
- public bool IsDBNull (int i)
+ public bool IsDBNull (int ordinal)
{
throw new NotImplementedException ();
}
@@ -151,13 +151,13 @@ namespace Microsoft.SqlServer.Server
}
}
- public object this [string index] {
+ public object this [string name] {
get {
throw new NotImplementedException ();
}
}
- public object this [int index] {
+ public object this [int ordinal] {
get {
throw new NotImplementedException ();
}
diff --git a/mcs/class/System.Drawing/Makefile b/mcs/class/System.Drawing/Makefile
index 8827cb4f82..0794558d1e 100644
--- a/mcs/class/System.Drawing/Makefile
+++ b/mcs/class/System.Drawing/Makefile
@@ -5,7 +5,7 @@ SUBDIRS =
LIBRARY = System.Drawing.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) \
+LIB_MCS_FLAGS = /unsafe /r:$(corlib) -d:FEATURE_TYPECONVERTER \
-resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico \
-resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico \
-resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico
diff --git a/mcs/class/System.Drawing/System.Drawing/Point.cs b/mcs/class/System.Drawing/System.Drawing/Point.cs
index 88a8390b56..53f9568067 100644
--- a/mcs/class/System.Drawing/System.Drawing/Point.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Point.cs
@@ -40,7 +40,7 @@ namespace System.Drawing
{
[Serializable]
[ComVisible (true)]
-#if !MONOTOUCH && !MONOMAC
+#if !MONOTOUCH && !MONOMAC && FEATURE_TYPECONVERTER
[TypeConverter (typeof (PointConverter))]
#endif
public struct Point
diff --git a/mcs/class/System.Drawing/System.Drawing/Rectangle.cs b/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
index c2ffbc80e5..0d1194675b 100644
--- a/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
@@ -39,7 +39,7 @@ namespace System.Drawing
{
[Serializable]
[ComVisible (true)]
-#if !MONOTOUCH && !MONOMAC
+#if !MONOTOUCH && !MONOMAC && FEATURE_TYPECONVERTER
[TypeConverter (typeof (RectangleConverter))]
#endif
public struct Rectangle
diff --git a/mcs/class/System.Drawing/System.Drawing/Size.cs b/mcs/class/System.Drawing/System.Drawing/Size.cs
index be8fda0ea8..3c657dc29f 100644
--- a/mcs/class/System.Drawing/System.Drawing/Size.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Size.cs
@@ -40,7 +40,7 @@ namespace System.Drawing
{
[Serializable]
[ComVisible (true)]
-#if !MONOTOUCH && !MONOMAC
+#if !MONOTOUCH && !MONOMAC && FEATURE_TYPECONVERTER
[TypeConverter (typeof (SizeConverter))]
#endif
public struct Size
diff --git a/mcs/class/System.Drawing/System.Drawing/SizeF.cs b/mcs/class/System.Drawing/System.Drawing/SizeF.cs
index 38714d1c99..922ab4e35e 100644
--- a/mcs/class/System.Drawing/System.Drawing/SizeF.cs
+++ b/mcs/class/System.Drawing/System.Drawing/SizeF.cs
@@ -40,7 +40,7 @@ namespace System.Drawing
{
[Serializable]
[ComVisible (true)]
-#if !MONOTOUCH && !MONOMAC
+#if !MONOTOUCH && !MONOMAC && FEATURE_TYPECONVERTER
[TypeConverter (typeof (SizeFConverter))]
#endif
public struct SizeF
diff --git a/mcs/class/System.IO.Compression/SharpCompress/Archive/AbstractWritableArchive.cs b/mcs/class/System.IO.Compression/SharpCompress/Archive/AbstractWritableArchive.cs
index 96af8c4131..f844e5cb47 100644
--- a/mcs/class/System.IO.Compression/SharpCompress/Archive/AbstractWritableArchive.cs
+++ b/mcs/class/System.IO.Compression/SharpCompress/Archive/AbstractWritableArchive.cs
@@ -82,10 +82,14 @@ namespace SharpCompress.Archive
{
key = key.Substring(1);
}
+ // .NET allows duplicate entries when saving and loading Zip files.
+ // The following lines are disabled from upstream SharpCompress to allow this.
+#if ZIP_ALLOW_DUPLICATE_KEYS
if (DoesKeyMatchExisting(key))
{
throw new ArchiveException("Cannot add entry with duplicate key: " + key);
}
+#endif
var entry = CreateEntry(key, source, size, modified, closeStream);
newEntries.Add(entry);
RebuildModifiedCollection();
@@ -101,7 +105,8 @@ namespace SharpCompress.Archive
{
p = p.Substring(1);
}
- return string.Equals(p, key, StringComparison.OrdinalIgnoreCase);
+ if (string.Equals(p, key, StringComparison.OrdinalIgnoreCase))
+ return true;
}
return false;
}
diff --git a/mcs/class/System.IO.Compression/SharpCompress/Archive/Zip/ZipArchiveEntry.cs b/mcs/class/System.IO.Compression/SharpCompress/Archive/Zip/ZipArchiveEntry.cs
index 121a6b3113..37cf1fcf7a 100644
--- a/mcs/class/System.IO.Compression/SharpCompress/Archive/Zip/ZipArchiveEntry.cs
+++ b/mcs/class/System.IO.Compression/SharpCompress/Archive/Zip/ZipArchiveEntry.cs
@@ -32,5 +32,10 @@ namespace SharpCompress.Archive.Zip
{
get { return (Parts.Single() as SeekableZipFilePart).Comment; }
}
+
+ public override string ToString()
+ {
+ return this.Key;
+ }
}
}
\ No newline at end of file
diff --git a/mcs/class/System.IO.Compression/SharpCompress/Common/Zip/ZipEntry.cs b/mcs/class/System.IO.Compression/SharpCompress/Common/Zip/ZipEntry.cs
index 6ed742eeca..2c0ec07e78 100644
--- a/mcs/class/System.IO.Compression/SharpCompress/Common/Zip/ZipEntry.cs
+++ b/mcs/class/System.IO.Compression/SharpCompress/Common/Zip/ZipEntry.cs
@@ -16,6 +16,13 @@ namespace SharpCompress.Common.Zip
this.filePart = filePart;
lastModifiedTime = Utility.DosDateToDateTime(filePart.Header.LastModifiedDate,
filePart.Header.LastModifiedTime);
+ if (lastModifiedTime == default(DateTime))
+ {
+ // On .NET on Windows, for zip entries that don't have a last write time,
+ // the return value for ZipArchiveEntry.LastWriteTime is:
+ // 1/1/1980 12:00:00 AM, Ticks=624511296000000000
+ lastModifiedTime = new DateTime(624511296000000000);
+ }
}
}
diff --git a/mcs/class/System.IO.Compression/SharpCompress/IO/ReadOnlySubStream.cs b/mcs/class/System.IO.Compression/SharpCompress/IO/ReadOnlySubStream.cs
index 1393dd6c70..05c89d3719 100644
--- a/mcs/class/System.IO.Compression/SharpCompress/IO/ReadOnlySubStream.cs
+++ b/mcs/class/System.IO.Compression/SharpCompress/IO/ReadOnlySubStream.cs
@@ -16,6 +16,7 @@ namespace SharpCompress.IO
{
stream.Position = origin.Value;
}
+ length = bytesToRead;
BytesLeftToRead = bytesToRead;
}
@@ -27,6 +28,8 @@ namespace SharpCompress.IO
}
}
+ private long length;
+
private long BytesLeftToRead { get; set; }
public Stream Stream { get; private set; }
@@ -53,12 +56,12 @@ namespace SharpCompress.IO
public override long Length
{
- get { throw new System.NotImplementedException(); }
+ get { return length; }
}
public override long Position
{
- get { throw new System.NotImplementedException(); }
+ get { return Length - BytesLeftToRead; }
set { throw new System.NotImplementedException(); }
}
diff --git a/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs b/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs
index 36903c675b..6971806e46 100644
--- a/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs
+++ b/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs
@@ -238,6 +238,56 @@ namespace MonoTests.System.IO.Compression
File.Delete ("create.zip");
}
+ [Test]
+ public void ZipEnumerateArchiveDefaultLastWriteTime()
+ {
+ using (var archive = new ZipArchive(File.Open("test.nupkg", FileMode.Open),
+ ZipArchiveMode.Read))
+ {
+ var entry = archive.GetEntry("_rels/.rels");
+ Assert.AreEqual(new DateTime(624511296000000000).Ticks, entry.LastWriteTime.Ticks);
+ Assert.IsNotNull(entry);
+ }
+ }
+
+ public void ZipGetArchiveEntryStreamLengthPosition(ZipArchiveMode mode)
+ {
+ File.Copy("test.nupkg", "test2.nupkg", overwrite: true);
+ using (var archive = new ZipArchive(File.Open("test2.nupkg", FileMode.Open), mode))
+ {
+ var entry = archive.GetEntry("_rels/.rels");
+ using (var stream = entry.Open())
+ {
+ Assert.AreEqual(0, stream.Position);
+ Assert.AreEqual(425, stream.Length);
+ }
+
+ // .NET does not support these in Read mode but we do.
+ var entry2 = archive.GetEntry("modernhttpclient.nuspec");
+ using (var stream = entry2.Open())
+ {
+ Assert.AreEqual(857, stream.Length);
+ if (mode == ZipArchiveMode.Update)
+ {
+ Assert.AreEqual(0, stream.Position);
+ }
+ }
+ }
+ File.Delete ("test2.nupkg");
+ }
+
+ [Test]
+ public void ZipGetArchiveEntryStreamLengthPositionReadMode()
+ {
+ ZipGetArchiveEntryStreamLengthPosition(ZipArchiveMode.Read);
+ }
+
+ [Test]
+ public void ZipGetArchiveEntryStreamLengthPositionUpdateMode()
+ {
+ ZipGetArchiveEntryStreamLengthPosition(ZipArchiveMode.Update);
+ }
+
[Test]
public void ZipEnumerateEntriesReadMode()
{
@@ -258,6 +308,104 @@ namespace MonoTests.System.IO.Compression
File.Delete ("test.zip");
}
+ [Test]
+ public void ZipWriteEntriesUpdateMode()
+ {
+ File.Copy("archive.zip", "test.zip", overwrite: true);
+ using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
+ ZipArchiveMode.Update))
+ {
+ var foo = archive.GetEntry("foo.txt");
+ using (var stream = foo.Open())
+ using (var sw = new StreamWriter(stream))
+ {
+ sw.Write("TEST");
+ }
+ }
+
+ using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
+ ZipArchiveMode.Read))
+ {
+ var foo = archive.GetEntry("foo.txt");
+ using (var stream = foo.Open())
+ using (var sr = new StreamReader(stream))
+ {
+ var line = sr.ReadLine();
+ Assert.AreEqual("TEST", line);
+ }
+ }
+
+ File.Delete ("test.zip");
+ }
+
+ [Test]
+ public void ZipWriteEntriesUpdateModeNewEntry()
+ {
+ var stream = new MemoryStream();
+ var zipArchive = new ZipArchive(stream, ZipArchiveMode.Update);
+
+ var newEntry = zipArchive.CreateEntry("testEntry");
+
+ using (var newStream = newEntry.Open())
+ {
+ using (var sw = new StreamWriter(newStream))
+ {
+ sw.Write("TEST");
+ }
+ }
+ }
+
+ [Test]
+ public void ZipCreateDuplicateEntriesUpdateMode()
+ {
+ var stream = new MemoryStream();
+ using (var zipArchive = new ZipArchive(stream, ZipArchiveMode.Update, true))
+ {
+ var e2 = zipArchive.CreateEntry("BBB");
+ var e3 = zipArchive.CreateEntry("BBB");
+ }
+
+ stream.Position = 0;
+ using (var zipArchive = new ZipArchive(stream, ZipArchiveMode.Read))
+ {
+ Assert.AreEqual(2, zipArchive.Entries.Count);
+ }
+ }
+
+ [Test]
+ public void ZipWriteEntriesUpdateModeNonZeroPosition()
+ {
+ File.Copy("archive.zip", "test.zip", overwrite: true);
+ using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
+ ZipArchiveMode.Update))
+ {
+ var foo = archive.GetEntry("foo.txt");
+ using (var stream = foo.Open())
+ {
+ var line = stream.ReadByte();
+ using (var sw = new StreamWriter(stream))
+ {
+ sw.Write("TEST");
+ }
+ }
+ }
+
+ using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
+ ZipArchiveMode.Read))
+ {
+ var entries = archive.Entries;
+ var foo = archive.GetEntry("foo.txt");
+ using (var stream = foo.Open())
+ using (var sr = new StreamReader(stream))
+ {
+ var line = sr.ReadLine();
+ Assert.AreEqual("fTEST", line);
+ }
+ }
+
+ File.Delete ("test.zip");
+ }
+
[Test]
public void ZipEnumerateEntriesUpdateMode()
{
@@ -307,5 +455,24 @@ namespace MonoTests.System.IO.Compression
}
File.Delete ("empty.zip");
}
+
+ class MyFakeStream : FileStream
+ {
+ public MyFakeStream (string path, FileMode mode) : base(path, mode) {}
+
+ ///
+ /// Simulate "CanSeek" is false, which is the case when you are retreiving data from web.
+ ///
+ public override bool CanSeek => false;
+ }
+
+ [Test]
+ public void ZipReadNonSeekableStream()
+ {
+ var stream = new MyFakeStream("test.nupkg", FileMode.Open);
+ using (var archive = new ZipArchive (stream, ZipArchiveMode.Read))
+ {
+ }
+ }
}
}
diff --git a/mcs/class/System.IO.Compression/ZipArchive.cs b/mcs/class/System.IO.Compression/ZipArchive.cs
index b2d6e2f4bf..c1a3df5756 100644
--- a/mcs/class/System.IO.Compression/ZipArchive.cs
+++ b/mcs/class/System.IO.Compression/ZipArchive.cs
@@ -39,7 +39,7 @@ namespace System.IO.Compression
internal readonly ZipArchiveMode mode;
internal Encoding entryNameEncoding;
internal bool disposed;
- internal Dictionary entries;
+ internal List entries;
internal SharpCompress.Archive.Zip.ZipArchive zipFile;
public ZipArchive (Stream stream)
@@ -49,7 +49,7 @@ namespace System.IO.Compression
this.stream = stream;
mode = ZipArchiveMode.Read;
- CreateZip(stream, mode);
+ CreateZip(mode);
}
public ZipArchive (Stream stream, ZipArchiveMode mode)
@@ -59,7 +59,7 @@ namespace System.IO.Compression
this.stream = stream;
this.mode = mode;
- CreateZip(stream, mode);
+ CreateZip(mode);
}
public ZipArchive (Stream stream, ZipArchiveMode mode, bool leaveOpen)
@@ -70,7 +70,7 @@ namespace System.IO.Compression
this.stream = stream;
this.mode = mode;
leaveStreamOpen = leaveOpen;
- CreateZip(stream, mode);
+ CreateZip(mode);
}
public ZipArchive (Stream stream, ZipArchiveMode mode, bool leaveOpen, Encoding entryNameEncoding)
@@ -82,40 +82,59 @@ namespace System.IO.Compression
this.mode = mode;
leaveStreamOpen = leaveOpen;
this.entryNameEncoding = entryNameEncoding;
- CreateZip(stream, mode);
+ CreateZip(mode);
}
- private void CreateZip(Stream stream, ZipArchiveMode mode)
+ private void CreateZip(ZipArchiveMode mode)
{
- if (mode != ZipArchiveMode.Read && mode != ZipArchiveMode.Create && mode != ZipArchiveMode.Update)
- throw new ArgumentOutOfRangeException("mode");
-
- // If the mode parameter is set to Read, the stream must support reading.
- if (mode == ZipArchiveMode.Read && !stream.CanRead)
- throw new ArgumentException("Stream must support reading for Read archive mode");
-
- // If the mode parameter is set to Create, the stream must support writing.
- if (mode == ZipArchiveMode.Create && !stream.CanWrite)
- throw new ArgumentException("Stream must support writing for Create archive mode");
-
- // If the mode parameter is set to Update, the stream must support reading, writing, and seeking.
- if (mode == ZipArchiveMode.Update && (!stream.CanRead || !stream.CanWrite || !stream.CanSeek))
- throw new ArgumentException("Stream must support reading, writing and seeking for Update archive mode");
-
try {
- zipFile = mode != ZipArchiveMode.Create && stream.Length != 0
- ? SharpCompress.Archive.Zip.ZipArchive.Open(stream)
- : SharpCompress.Archive.Zip.ZipArchive.Create();
- } catch (Exception e) {
- throw new InvalidDataException("The contents of the stream are not in the zip archive format.", e);
- }
+ if (mode != ZipArchiveMode.Read && mode != ZipArchiveMode.Create && mode != ZipArchiveMode.Update)
+ throw new ArgumentOutOfRangeException("mode");
- entries = new Dictionary();
- if (Mode != ZipArchiveMode.Create) {
- foreach (var entry in zipFile.Entries) {
- var zipEntry = new ZipArchiveEntry(this, entry);
- entries[entry.Key] = zipEntry;
+ // If the mode parameter is set to Read, the stream must support reading.
+ if (mode == ZipArchiveMode.Read && !stream.CanRead)
+ throw new ArgumentException("Stream must support reading for Read archive mode");
+
+ // If the mode parameter is set to Create, the stream must support writing.
+ if (mode == ZipArchiveMode.Create && !stream.CanWrite)
+ throw new ArgumentException("Stream must support writing for Create archive mode");
+
+ // If the mode parameter is set to Update, the stream must support reading, writing, and seeking.
+ if (mode == ZipArchiveMode.Update && (!stream.CanRead || !stream.CanWrite || !stream.CanSeek))
+ throw new ArgumentException("Stream must support reading, writing and seeking for Update archive mode");
+
+ // If the stream is not seekable, then buffer it into memory (same behavior as .NET).
+ if (mode == ZipArchiveMode.Read && !stream.CanSeek)
+ {
+ var memoryStream = new MemoryStream();
+ stream.CopyTo(memoryStream);
+
+ if (!leaveStreamOpen)
+ stream.Dispose();
+
+ this.stream = memoryStream;
}
+
+ try {
+ zipFile = mode != ZipArchiveMode.Create && stream.Length != 0
+ ? SharpCompress.Archive.Zip.ZipArchive.Open(stream)
+ : SharpCompress.Archive.Zip.ZipArchive.Create();
+ } catch (Exception e) {
+ throw new InvalidDataException("The contents of the stream are not in the zip archive format.", e);
+ }
+
+ entries = new List();
+ if (Mode != ZipArchiveMode.Create) {
+ foreach (var entry in zipFile.Entries) {
+ var zipEntry = new ZipArchiveEntry(this, entry);
+ entries.Add(zipEntry);
+ }
+ }
+ }
+ catch {
+ if (!leaveStreamOpen)
+ stream.Dispose();
+ throw;
}
}
@@ -133,7 +152,7 @@ namespace System.IO.Compression
if (entries == null)
return new ReadOnlyCollection(new List());
- return new ReadOnlyCollection(entries.Values.ToList());
+ return new ReadOnlyCollection(entries);
}
}
@@ -154,6 +173,14 @@ namespace System.IO.Compression
return CreateEntry(entryName, CompressionLevel.Optimal);
}
+ internal SharpCompress.Archive.Zip.ZipArchiveEntry CreateEntryInternal(string entryName)
+ {
+ var memoryStream = new MemoryStream();
+ var entry = zipFile.AddEntry(entryName, memoryStream);
+
+ return entry;
+ }
+
public ZipArchiveEntry CreateEntry (string entryName, CompressionLevel compressionLevel)
{
if (disposed)
@@ -171,10 +198,9 @@ namespace System.IO.Compression
if (zipFile == null)
throw new InvalidDataException("The zip archive is corrupt, and its entries cannot be retrieved.");
- var memoryStream = new MemoryStream();
- var entry = zipFile.AddEntry(entryName, memoryStream);
- var archiveEntry = new ZipArchiveEntry(this, entry);
- entries[entryName] = archiveEntry;
+ var internalEntry = CreateEntryInternal(entryName);
+ var archiveEntry = new ZipArchiveEntry(this, internalEntry);
+ entries.Add(archiveEntry);
return archiveEntry;
}
@@ -196,7 +222,7 @@ namespace System.IO.Compression
if (zipFile == null)
throw new InvalidDataException("The zip archive is corrupt, and its entries cannot be retrieved.");
- return entries.ContainsKey(entryName) ? entries[entryName] : null;
+ return entries.FirstOrDefault(e => e.FullName == entryName);
}
private void Save()
diff --git a/mcs/class/System.IO.Compression/ZipArchiveEntry.cs b/mcs/class/System.IO.Compression/ZipArchiveEntry.cs
index 0bc6978641..9b415fbe6f 100644
--- a/mcs/class/System.IO.Compression/ZipArchiveEntry.cs
+++ b/mcs/class/System.IO.Compression/ZipArchiveEntry.cs
@@ -32,7 +32,7 @@ namespace System.IO.Compression
internal class ZipArchiveEntryStream : Stream, IDisposable
{
private readonly ZipArchiveEntry entry;
- private readonly Stream stream;
+ private Stream stream;
public override bool CanRead {
get {
@@ -42,19 +42,19 @@ namespace System.IO.Compression
public override bool CanSeek {
get {
- return stream.CanSeek;
+ return entry.Archive.Mode != ZipArchiveMode.Read;
}
}
public override bool CanWrite {
get {
- return stream.CanWrite;
+ return entry.Archive.Mode != ZipArchiveMode.Read;
}
}
public override long Length {
get {
- return stream.Length;
+ return stream.CanWrite ? stream.Length : entry.Length;
}
}
@@ -98,6 +98,34 @@ namespace System.IO.Compression
stream.Write(buffer, offset, count);
}
+ internal void EnsureWriteable()
+ {
+ if (entry.Archive.Mode == ZipArchiveMode.Update && !stream.CanWrite)
+ {
+ // Replace the read-only stream with a writeable memory stream.
+ SetWriteable();
+ }
+ }
+
+ internal void SetWriteable()
+ {
+ var archive = entry.Archive;
+
+ var internalEntry = entry.entry;
+ var newEntry = archive.CreateEntryInternal(internalEntry.Key);
+ var newStream = newEntry.OpenEntryStream();
+
+ var openStream = stream;
+ openStream.CopyTo(newStream);
+ openStream.Dispose();
+
+ newStream.Position = 0;
+
+ archive.zipFile.RemoveEntry(internalEntry);
+ entry.entry = newEntry;
+ stream = newStream;
+ }
+
public new void Dispose()
{
Dispose(true);
@@ -117,8 +145,9 @@ namespace System.IO.Compression
public class ZipArchiveEntry
{
- readonly SharpCompress.Archive.Zip.ZipArchiveEntry entry;
+ internal SharpCompress.Archive.Zip.ZipArchiveEntry entry;
internal ZipArchiveEntryStream openStream;
+ internal bool wasWritten;
private bool wasDeleted;
internal ZipArchiveEntry(ZipArchive archive, SharpCompress.Archive.Zip.ZipArchiveEntry entry)
@@ -174,7 +203,7 @@ namespace System.IO.Compression
if (Archive.disposed)
throw new ObjectDisposedException("The zip archive for this entry has been disposed.");
- if (Archive.Mode != ZipArchiveMode.Update)
+ if (Archive.Mode != ZipArchiveMode.Update)
throw new NotSupportedException("The zip archive for this entry was opened in a mode other than Update.");
if (openStream != null)
@@ -198,9 +227,16 @@ namespace System.IO.Compression
if (Archive.Mode == ZipArchiveMode.Create && openStream != null)
throw new IOException("The archive for this entry was opened with the Create mode, and this entry has already been written to.");
- openStream = new ZipArchiveEntryStream(this, entry.OpenEntryStream());
+ var entryStream = entry.OpenEntryStream();
+ openStream = new ZipArchiveEntryStream(this, entryStream);
+ openStream.EnsureWriteable();
return openStream;
}
+
+ public override string ToString()
+ {
+ return FullName;
+ }
}
}
diff --git a/mcs/class/System.Net.Http.WinHttpHandler/Assembly/AssemblyInfo.cs b/mcs/class/System.Net.Http.WinHttpHandler/Assembly/AssemblyInfo.cs
new file mode 100644
index 0000000000..d477aee449
--- /dev/null
+++ b/mcs/class/System.Net.Http.WinHttpHandler/Assembly/AssemblyInfo.cs
@@ -0,0 +1,62 @@
+//
+// AssemblyInfo.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Resources;
+using System.Security;
+using System.Security.Permissions;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about the assembly
+
+[assembly: AssemblyTitle ("System.Net.Http.WinHttpHandler.dll")]
+[assembly: AssemblyDescription ("System.Net.Http.WinHttpHandler.dll")]
+[assembly: AssemblyDefaultAlias ("System.Net.Http.WinHttpHandler.dll")]
+
+[assembly: AssemblyCompany (Consts.MonoCompany)]
+[assembly: AssemblyProduct (Consts.MonoProduct)]
+[assembly: AssemblyCopyright (Consts.MonoCopyright)]
+[assembly: AssemblyVersion (Consts.FxVersion)]
+[assembly: SatelliteContractVersion (Consts.FxVersion)]
+[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
+[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
+
+[assembly: NeutralResourcesLanguage ("en-US")]
+[assembly: CLSCompliant (true)]
+[assembly: AssemblyDelaySign (true)]
+
+[assembly: AssemblyKeyFile("../msfinal.pub")]
+
+[assembly: SecurityCritical]
+
+[assembly: ComVisible (false)]
\ No newline at end of file
diff --git a/mcs/class/System.Net.Http.WinHttpHandler/Makefile b/mcs/class/System.Net.Http.WinHttpHandler/Makefile
new file mode 100644
index 0000000000..55b07ffdd6
--- /dev/null
+++ b/mcs/class/System.Net.Http.WinHttpHandler/Makefile
@@ -0,0 +1,11 @@
+thisdir = class/System.Net.Http.WinHttpHandler
+SUBDIRS =
+include ../../build/rules.make
+
+LIBRARY = System.Net.Http.WinHttpHandler.dll
+LIB_REFS = System System.Net.Http
+LIB_MCS_FLAGS =
+
+NO_TEST = yes
+
+include ../../build/library.make
diff --git a/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http.WinHttpHandler.dll.sources b/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http.WinHttpHandler.dll.sources
new file mode 100644
index 0000000000..97feb39e8a
--- /dev/null
+++ b/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http.WinHttpHandler.dll.sources
@@ -0,0 +1,8 @@
+../../build/common/Consts.cs
+../../build/common/Locale.cs
+../../build/common/MonoTODOAttribute.cs
+Assembly/AssemblyInfo.cs
+
+System.Net.Http/CookieUsePolicy.cs
+System.Net.Http/WindowsProxyUsePolicy.cs
+System.Net.Http/WinHttpHandler.cs
diff --git a/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/CookieUsePolicy.cs b/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/CookieUsePolicy.cs
new file mode 100644
index 0000000000..f27cb2ca49
--- /dev/null
+++ b/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/CookieUsePolicy.cs
@@ -0,0 +1,39 @@
+//
+// CookieUsePolicy.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Net.Http
+{
+ public enum CookieUsePolicy
+ {
+ IgnoreCookies = 0,
+ UseInternalCookieStoreOnly = 1,
+ UseSpecifiedCookieContainer = 2,
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/WinHttpHandler.cs b/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/WinHttpHandler.cs
new file mode 100644
index 0000000000..e2db5f66fa
--- /dev/null
+++ b/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/WinHttpHandler.cs
@@ -0,0 +1,92 @@
+//
+// WinHttpHandler.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Net.Security;
+using System.Security.Authentication;
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.Net.Http
+{
+ public class WinHttpHandler : HttpMessageHandler
+ {
+ public WinHttpHandler() { throw new PlatformNotSupportedException (); }
+
+ public DecompressionMethods AutomaticDecompression { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public bool AutomaticRedirection { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public bool CheckCertificateRevocationList { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public ClientCertificateOption ClientCertificateOption { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public X509Certificate2Collection ClientCertificates { get { throw new PlatformNotSupportedException (); } }
+
+ public CookieContainer CookieContainer { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public CookieUsePolicy CookieUsePolicy { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public ICredentials DefaultProxyCredentials { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public int MaxAutomaticRedirections { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public int MaxConnectionsPerServer { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public int MaxResponseDrainSize { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public int MaxResponseHeadersLength { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public bool PreAuthenticate { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public IDictionary Properties { get { throw new PlatformNotSupportedException (); } }
+
+ public IWebProxy Proxy { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public TimeSpan ReceiveDataTimeout { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public TimeSpan ReceiveHeadersTimeout { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public TimeSpan SendTimeout { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public Func ServerCertificateValidationCallback { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public ICredentials ServerCredentials { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public SslProtocols SslProtocols { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ public WindowsProxyUsePolicy WindowsProxyUsePolicy { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
+
+ protected override void Dispose (bool disposing) { throw new PlatformNotSupportedException (); }
+
+ protected override Task SendAsync (HttpRequestMessage request, Threading.CancellationToken cancellationToken) { throw new PlatformNotSupportedException (); }
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/WindowsProxyUsePolicy.cs b/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/WindowsProxyUsePolicy.cs
new file mode 100644
index 0000000000..48de6bb82c
--- /dev/null
+++ b/mcs/class/System.Net.Http.WinHttpHandler/System.Net.Http/WindowsProxyUsePolicy.cs
@@ -0,0 +1,40 @@
+//
+// WindowsProxyUsePolicy.cs
+//
+// Author:
+// Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Net.Http
+{
+ public enum WindowsProxyUsePolicy
+ {
+ DoNotUseProxy = 0,
+ UseCustomProxy = 3,
+ UseWinHttpProxy = 1,
+ UseWinInetProxy = 2,
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Numerics.Vectors/Assembly/TypeForwarders.cs b/mcs/class/System.Numerics.Vectors/Assembly/TypeForwarders.cs
new file mode 100644
index 0000000000..b2929d84ec
--- /dev/null
+++ b/mcs/class/System.Numerics.Vectors/Assembly/TypeForwarders.cs
@@ -0,0 +1,36 @@
+//
+// TypeForwarders.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2011 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Numerics;
+using System.Runtime.CompilerServices;
+
+[assembly: TypeForwardedTo(typeof(Matrix3x2))]
+[assembly: TypeForwardedTo(typeof(Matrix4x4))]
+[assembly: TypeForwardedTo(typeof(Plane))]
+[assembly: TypeForwardedTo(typeof(Quaternion))]
+[assembly: TypeForwardedTo(typeof(Vector2))]
+[assembly: TypeForwardedTo(typeof(Vector3))]
+[assembly: TypeForwardedTo(typeof(Vector4))]
diff --git a/mcs/class/System.Numerics.Vectors/Makefile b/mcs/class/System.Numerics.Vectors/Makefile
index f5ff0937ea..42fb194dbf 100644
--- a/mcs/class/System.Numerics.Vectors/Makefile
+++ b/mcs/class/System.Numerics.Vectors/Makefile
@@ -3,8 +3,8 @@ SUBDIRS =
include ../../build/rules.make
LIBRARY = System.Numerics.Vectors.dll
-LIB_REFS = System
-LIB_MCS_FLAGS =
+LIB_REFS = System System.Numerics
+LIB_MCS_FLAGS = -unsafe
EXTRA_DISTFILES =
diff --git a/mcs/class/System.Numerics.Vectors/SR.cs b/mcs/class/System.Numerics.Vectors/SR.cs
new file mode 100644
index 0000000000..72e9cfb0ac
--- /dev/null
+++ b/mcs/class/System.Numerics.Vectors/SR.cs
@@ -0,0 +1,17 @@
+// generated from Strings.resx in corefx
+
+partial class SR
+{
+ public const string Arg_ArgumentOutOfRangeException="Index was out of bounds:";
+ public const string Arg_ElementsInSourceIsGreaterThanDestination="Number of elements in source vector is greater than the destination array";
+ public const string Arg_MultiDimArrayNotSupported="Only one-dimensional arrays are supported";
+ public const string Arg_NullArgumentNullRef="The method was called with a null array argument.";
+ public const string Arg_RegisterLengthOfRangeException="length must be less than";
+ public const string Arg_TypeNotSupported="Specified type is not supported";
+ public const string Reflection_MethodNotSupported="Vector.Count cannot be called via reflection when intrinsics are enabled.";
+
+ public static string Format (string message, object data)
+ {
+ return string.Format (message, data);
+ }
+}
diff --git a/mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources b/mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources
index 45b755ee19..01bdfc1724 100644
--- a/mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources
+++ b/mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources
@@ -1,3 +1,11 @@
../../build/common/Consts.cs
../../build/common/SR.cs
Assembly/AssemblyInfo.cs
+Assembly/TypeForwarders.cs
+SR.cs
+System.Numerics/ConstantHelper.cs
+System.Numerics/HashCodeHelper.cs
+System.Numerics/JitIntrinsicAttribute.cs
+System.Numerics/Register.cs
+System.Numerics/Vector_Operations.cs
+System.Numerics/Vector.cs
diff --git a/mcs/class/System.Numerics.Vectors/System.Numerics/ConstantHelper.cs b/mcs/class/System.Numerics.Vectors/System.Numerics/ConstantHelper.cs
new file mode 100644
index 0000000000..ea32ed3803
--- /dev/null
+++ b/mcs/class/System.Numerics.Vectors/System.Numerics/ConstantHelper.cs
@@ -0,0 +1,142 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.CompilerServices;
+
+namespace System.Numerics
+{
+ internal class ConstantHelper
+ {
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Byte GetByteWithAllBitsSet()
+ {
+ Byte value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((Byte*)&value) = (Byte)0xff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static SByte GetSByteWithAllBitsSet()
+ {
+ SByte value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((SByte*)&value) = (SByte)0xff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static UInt16 GetUInt16WithAllBitsSet()
+ {
+ UInt16 value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((UInt16*)&value) = (UInt16)0xffff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Int16 GetInt16WithAllBitsSet()
+ {
+ Int16 value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((Int16*)&value) = (Int16)0xffff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static UInt32 GetUInt32WithAllBitsSet()
+ {
+ UInt32 value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((UInt32*)&value) = (UInt32)0xffffffff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Int32 GetInt32WithAllBitsSet()
+ {
+ Int32 value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((Int32*)&value) = (Int32)0xffffffff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static UInt64 GetUInt64WithAllBitsSet()
+ {
+ UInt64 value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((UInt64*)&value) = (UInt64)0xffffffffffffffff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Int64 GetInt64WithAllBitsSet()
+ {
+ Int64 value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((Int64*)&value) = (Int64)0xffffffffffffffff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Single GetSingleWithAllBitsSet()
+ {
+ Single value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((Int32*)&value) = (Int32)0xffffffff;
+ }
+ }
+ return value;
+ }
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Double GetDoubleWithAllBitsSet()
+ {
+ Double value = 0;
+ unsafe
+ {
+ unchecked
+ {
+ *((Int64*)&value) = (Int64)0xffffffffffffffff;
+ }
+ }
+ return value;
+ }
+ }
+}
diff --git a/mcs/class/System.Numerics.Vectors/System.Numerics/HashCodeHelper.cs b/mcs/class/System.Numerics.Vectors/System.Numerics/HashCodeHelper.cs
new file mode 100644
index 0000000000..1467e2f68f
--- /dev/null
+++ b/mcs/class/System.Numerics.Vectors/System.Numerics/HashCodeHelper.cs
@@ -0,0 +1,17 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Numerics
+{
+ internal static class HashCodeHelper
+ {
+ ///
+ /// Combines two hash codes, useful for combining hash codes of individual vector elements
+ ///
+ internal static int CombineHashCodes(int h1, int h2)
+ {
+ return (((h1 << 5) + h1) ^ h2);
+ }
+ }
+}
diff --git a/mcs/class/System.Numerics.Vectors/System.Numerics/JitIntrinsicAttribute.cs b/mcs/class/System.Numerics.Vectors/System.Numerics/JitIntrinsicAttribute.cs
new file mode 100644
index 0000000000..741041222f
--- /dev/null
+++ b/mcs/class/System.Numerics.Vectors/System.Numerics/JitIntrinsicAttribute.cs
@@ -0,0 +1,14 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Numerics
+{
+ ///
+ /// An attribute that can be attached to JIT Intrinsic methods/properties
+ ///
+ [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)]
+ internal class JitIntrinsicAttribute : Attribute
+ {
+ }
+}
diff --git a/mcs/class/System.Numerics.Vectors/System.Numerics/Register.cs b/mcs/class/System.Numerics.Vectors/System.Numerics/Register.cs
new file mode 100644
index 0000000000..a27e922b9d
--- /dev/null
+++ b/mcs/class/System.Numerics.Vectors/System.Numerics/Register.cs
@@ -0,0 +1,172 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.InteropServices;
+
+namespace System.Numerics
+{
+ ///
+ /// A structure describing the layout of an SSE2-sized register.
+ /// Contains overlapping fields representing the set of valid numeric types.
+ /// Allows the generic Vector'T struct to contain an explicit field layout.
+ ///
+ [StructLayout(LayoutKind.Explicit)]
+ internal struct Register
+ {
+ #region Internal Storage Fields
+ // Internal System.Byte Fields
+ [FieldOffset(0)]
+ internal Byte byte_0;
+ [FieldOffset(1)]
+ internal Byte byte_1;
+ [FieldOffset(2)]
+ internal Byte byte_2;
+ [FieldOffset(3)]
+ internal Byte byte_3;
+ [FieldOffset(4)]
+ internal Byte byte_4;
+ [FieldOffset(5)]
+ internal Byte byte_5;
+ [FieldOffset(6)]
+ internal Byte byte_6;
+ [FieldOffset(7)]
+ internal Byte byte_7;
+ [FieldOffset(8)]
+ internal Byte byte_8;
+ [FieldOffset(9)]
+ internal Byte byte_9;
+ [FieldOffset(10)]
+ internal Byte byte_10;
+ [FieldOffset(11)]
+ internal Byte byte_11;
+ [FieldOffset(12)]
+ internal Byte byte_12;
+ [FieldOffset(13)]
+ internal Byte byte_13;
+ [FieldOffset(14)]
+ internal Byte byte_14;
+ [FieldOffset(15)]
+ internal Byte byte_15;
+
+ // Internal System.SByte Fields
+ [FieldOffset(0)]
+ internal SByte sbyte_0;
+ [FieldOffset(1)]
+ internal SByte sbyte_1;
+ [FieldOffset(2)]
+ internal SByte sbyte_2;
+ [FieldOffset(3)]
+ internal SByte sbyte_3;
+ [FieldOffset(4)]
+ internal SByte sbyte_4;
+ [FieldOffset(5)]
+ internal SByte sbyte_5;
+ [FieldOffset(6)]
+ internal SByte sbyte_6;
+ [FieldOffset(7)]
+ internal SByte sbyte_7;
+ [FieldOffset(8)]
+ internal SByte sbyte_8;
+ [FieldOffset(9)]
+ internal SByte sbyte_9;
+ [FieldOffset(10)]
+ internal SByte sbyte_10;
+ [FieldOffset(11)]
+ internal SByte sbyte_11;
+ [FieldOffset(12)]
+ internal SByte sbyte_12;
+ [FieldOffset(13)]
+ internal SByte sbyte_13;
+ [FieldOffset(14)]
+ internal SByte sbyte_14;
+ [FieldOffset(15)]
+ internal SByte sbyte_15;
+
+ // Internal System.UInt16 Fields
+ [FieldOffset(0)]
+ internal UInt16 uint16_0;
+ [FieldOffset(2)]
+ internal UInt16 uint16_1;
+ [FieldOffset(4)]
+ internal UInt16 uint16_2;
+ [FieldOffset(6)]
+ internal UInt16 uint16_3;
+ [FieldOffset(8)]
+ internal UInt16 uint16_4;
+ [FieldOffset(10)]
+ internal UInt16 uint16_5;
+ [FieldOffset(12)]
+ internal UInt16 uint16_6;
+ [FieldOffset(14)]
+ internal UInt16 uint16_7;
+
+ // Internal System.Int16 Fields
+ [FieldOffset(0)]
+ internal Int16 int16_0;
+ [FieldOffset(2)]
+ internal Int16 int16_1;
+ [FieldOffset(4)]
+ internal Int16 int16_2;
+ [FieldOffset(6)]
+ internal Int16 int16_3;
+ [FieldOffset(8)]
+ internal Int16 int16_4;
+ [FieldOffset(10)]
+ internal Int16 int16_5;
+ [FieldOffset(12)]
+ internal Int16 int16_6;
+ [FieldOffset(14)]
+ internal Int16 int16_7;
+
+ // Internal System.UInt32 Fields
+ [FieldOffset(0)]
+ internal UInt32 uint32_0;
+ [FieldOffset(4)]
+ internal UInt32 uint32_1;
+ [FieldOffset(8)]
+ internal UInt32 uint32_2;
+ [FieldOffset(12)]
+ internal UInt32 uint32_3;
+
+ // Internal System.Int32 Fields
+ [FieldOffset(0)]
+ internal Int32 int32_0;
+ [FieldOffset(4)]
+ internal Int32 int32_1;
+ [FieldOffset(8)]
+ internal Int32 int32_2;
+ [FieldOffset(12)]
+ internal Int32 int32_3;
+
+ // Internal System.UInt64 Fields
+ [FieldOffset(0)]
+ internal UInt64 uint64_0;
+ [FieldOffset(8)]
+ internal UInt64 uint64_1;
+
+ // Internal System.Int64 Fields
+ [FieldOffset(0)]
+ internal Int64 int64_0;
+ [FieldOffset(8)]
+ internal Int64 int64_1;
+
+ // Internal System.Single Fields
+ [FieldOffset(0)]
+ internal Single single_0;
+ [FieldOffset(4)]
+ internal Single single_1;
+ [FieldOffset(8)]
+ internal Single single_2;
+ [FieldOffset(12)]
+ internal Single single_3;
+
+ // Internal System.Double Fields
+ [FieldOffset(0)]
+ internal Double double_0;
+ [FieldOffset(8)]
+ internal Double double_1;
+
+ #endregion Internal Storage Fields
+ }
+}
diff --git a/mcs/class/System.Numerics.Vectors/System.Numerics/Vector.cs.REMOVED.git-id b/mcs/class/System.Numerics.Vectors/System.Numerics/Vector.cs.REMOVED.git-id
new file mode 100644
index 0000000000..cba21b7fe7
--- /dev/null
+++ b/mcs/class/System.Numerics.Vectors/System.Numerics/Vector.cs.REMOVED.git-id
@@ -0,0 +1 @@
+13785ed5cfe49a9b83029b75bd5fbe239a875333
\ No newline at end of file
diff --git a/mcs/class/System.Numerics.Vectors/System.Numerics/Vector_Operations.cs b/mcs/class/System.Numerics.Vectors/System.Numerics/Vector_Operations.cs
new file mode 100644
index 0000000000..83a5ad38ca
--- /dev/null
+++ b/mcs/class/System.Numerics.Vectors/System.Numerics/Vector_Operations.cs
@@ -0,0 +1,865 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.CompilerServices;
+
+namespace System.Numerics
+{
+ ///
+ /// Contains various methods useful for creating, manipulating, combining, and converting generic vectors with one another.
+ ///
+ public static class Vector
+ {
+ // JIT is not looking at the Vector class methods
+ // all methods here should be inlined and they must be implemented in terms of Vector intrinsics
+ #region Select Methods
+ ///
+ /// Creates a new vector with elements selected between the two given source vectors, and based on a mask vector.
+ ///
+ /// The integral mask vector used to drive selection.
+ /// The first source vector.
+ /// The second source vector.
+ /// The new vector with elements selected based on the mask.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector ConditionalSelect(Vector condition, Vector left, Vector right)
+ {
+ return (Vector)Vector.ConditionalSelect((Vector)condition, left, right);
+ }
+
+ ///
+ /// Creates a new vector with elements selected between the two given source vectors, and based on a mask vector.
+ ///
+ /// The integral mask vector used to drive selection.
+ /// The first source vector.
+ /// The second source vector.
+ /// The new vector with elements selected based on the mask.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector ConditionalSelect(Vector condition, Vector left, Vector right)
+ {
+ return (Vector)Vector.ConditionalSelect((Vector)condition, left, right);
+ }
+
+ ///
+ /// Creates a new vector with elements selected between the two given source vectors, and based on a mask vector.
+ ///
+ /// The mask vector used to drive selection.
+ /// The first source vector.
+ /// The second source vector.
+ /// The new vector with elements selected based on the mask.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector ConditionalSelect(Vector condition, Vector left, Vector right) where T : struct
+ {
+ return Vector.ConditionalSelect(condition, left, right);
+ }
+ #endregion Select Methods
+
+ #region Comparison methods
+ #region Equals methods
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left and right were equal.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector Equals(Vector left, Vector right) where T : struct
+ {
+ return Vector.Equals(left, right);
+ }
+
+ ///
+ /// Returns an integral vector whose elements signal whether elements in the left and right floating point vectors were equal.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector Equals(Vector left, Vector right)
+ {
+ return (Vector)Vector.Equals(left, right);
+ }
+
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left and right were equal.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector Equals(Vector left, Vector right)
+ {
+ return Vector.Equals(left, right);
+ }
+
+ ///
+ /// Returns an integral vector whose elements signal whether elements in the left and right floating point vectors were equal.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector Equals(Vector left, Vector right)
+ {
+ return (Vector)Vector.Equals(left, right);
+ }
+
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left and right were equal.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector Equals(Vector left, Vector right)
+ {
+ return Vector.Equals(left, right);
+ }
+
+ ///
+ /// Returns a boolean indicating whether each pair of elements in the given vectors are equal.
+ ///
+ /// The first vector to compare.
+ /// The first vector to compare.
+ /// True if all elements are equal; False otherwise.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static bool EqualsAll(Vector left, Vector right) where T : struct
+ {
+ return left == right;
+ }
+
+ ///
+ /// Returns a boolean indicating whether any single pair of elements in the given vectors are equal.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// True if any element pairs are equal; False if no element pairs are equal.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static bool EqualsAny(Vector left, Vector right) where T : struct
+ {
+ return !Vector.Equals(left, right).Equals(Vector.Zero);
+ }
+ #endregion Equals methods
+
+ #region Lessthan Methods
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were less than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThan(Vector left, Vector right) where T : struct
+ {
+ return Vector.LessThan(left, right);
+ }
+
+ ///
+ /// Returns an integral vector whose elements signal whether the elements in left were less than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant integral vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThan(Vector left, Vector right)
+ {
+ return (Vector)Vector.LessThan(left, right);
+ }
+
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were less than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThan(Vector left, Vector right)
+ {
+ return Vector.LessThan(left, right);
+ }
+
+ ///
+ /// Returns an integral vector whose elements signal whether the elements in left were less than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant integral vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThan(Vector left, Vector right)
+ {
+ return (Vector)Vector.LessThan(left, right);
+ }
+
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were less than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThan(Vector left, Vector right)
+ {
+ return Vector.LessThan(left, right);
+ }
+
+ ///
+ /// Returns a boolean indicating whether all of the elements in left are less than their corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// True if all elements in left are less than their corresponding elements in right; False otherwise.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static bool LessThanAll(Vector left, Vector right) where T : struct
+ {
+ Vector cond = (Vector)Vector.LessThan(left, right);
+ return cond.Equals(Vector.AllOnes);
+ }
+
+ ///
+ /// Returns a boolean indicating whether any element in left is less than its corresponding element in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// True if any elements in left are less than their corresponding elements in right; False otherwise.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static bool LessThanAny(Vector left, Vector right) where T : struct
+ {
+ Vector cond = (Vector)Vector.LessThan(left, right);
+ return !cond.Equals(Vector.Zero);
+ }
+ #endregion LessthanMethods
+
+ #region Lessthanorequal methods
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were less than or equal to their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThanOrEqual(Vector left, Vector right) where T : struct
+ {
+ return Vector.LessThanOrEqual(left, right);
+ }
+
+ ///
+ /// Returns an integral vector whose elements signal whether the elements in left were less than or equal to their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant integral vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThanOrEqual(Vector left, Vector right)
+ {
+ return (Vector)Vector.LessThanOrEqual(left, right);
+ }
+
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were less than or equal to their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThanOrEqual(Vector left, Vector right)
+ {
+ return Vector.LessThanOrEqual(left, right);
+ }
+
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were less than or equal to their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThanOrEqual(Vector left, Vector right)
+ {
+ return Vector.LessThanOrEqual(left, right);
+ }
+
+ ///
+ /// Returns an integral vector whose elements signal whether the elements in left were less than or equal to their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant integral vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector LessThanOrEqual(Vector left, Vector right)
+ {
+ return (Vector)Vector.LessThanOrEqual(left, right);
+ }
+
+ ///
+ /// Returns a boolean indicating whether all elements in left are less than or equal to their corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// True if all elements in left are less than or equal to their corresponding elements in right; False otherwise.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static bool LessThanOrEqualAll(Vector left, Vector right) where T : struct
+ {
+ Vector cond = (Vector)Vector.LessThanOrEqual(left, right);
+ return cond.Equals(Vector.AllOnes);
+ }
+
+ ///
+ /// Returns a boolean indicating whether any element in left is less than or equal to its corresponding element in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// True if any elements in left are less than their corresponding elements in right; False otherwise.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static bool LessThanOrEqualAny(Vector left, Vector right) where T : struct
+ {
+ Vector cond = (Vector)Vector.LessThanOrEqual(left, right);
+ return !cond.Equals(Vector.Zero);
+ }
+ #endregion Lessthanorequal methods
+
+ #region Greaterthan methods
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were greater than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector GreaterThan(Vector left, Vector right) where T : struct
+ {
+ return Vector.GreaterThan(left, right);
+ }
+
+ ///
+ /// Returns an integral vector whose elements signal whether the elements in left were greater than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant integral vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector GreaterThan(Vector left, Vector right)
+ {
+ return (Vector)Vector.GreaterThan(left, right);
+ }
+
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were greater than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector GreaterThan(Vector left, Vector right)
+ {
+ return Vector.GreaterThan(left, right);
+ }
+
+ ///
+ /// Returns an integral vector whose elements signal whether the elements in left were greater than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant integral vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector GreaterThan(Vector left, Vector right)
+ {
+ return (Vector)Vector.GreaterThan(left, right);
+ }
+
+ ///
+ /// Returns a new vector whose elements signal whether the elements in left were greater than their
+ /// corresponding elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// The resultant vector.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static Vector GreaterThan(Vector left, Vector right)
+ {
+ return Vector.GreaterThan(left, right);
+ }
+
+ ///
+ /// Returns a boolean indicating whether all elements in left are greater than the corresponding elements in right.
+ /// elements in right.
+ ///
+ /// The first vector to compare.
+ /// The second vector to compare.
+ /// True if all elements in left are greater than their corresponding elements in right; False otherwise.
+ [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
+ public static bool GreaterThanAll(Vector left, Vector right) where T : struct
+ {
+ Vector cond = (Vector)Vector.GreaterThan(left, right);
+ return cond.Equals(Vector