Move Nullable and string normalization to shared CoreLib partition (#15184)
authorJan Kotas <jkotas@microsoft.com>
Thu, 23 Nov 2017 02:29:54 +0000 (18:29 -0800)
committerGitHub <noreply@github.com>
Thu, 23 Nov 2017 02:29:54 +0000 (18:29 -0800)
src/mscorlib/System.Private.CoreLib.csproj
src/mscorlib/shared/Interop/Windows/Normaliz/Interop.Idna.cs [moved from src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs with 63% similarity]
src/mscorlib/shared/Interop/Windows/Normaliz/Interop.Normalization.cs [moved from src/mscorlib/src/Interop/Windows/Normaliz/Interop.Normalization.cs with 100% similarity]
src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/mscorlib/shared/System/Globalization/IdnMapping.Windows.cs [moved from src/mscorlib/src/System/Globalization/IdnMapping.Windows.cs with 72% similarity]
src/mscorlib/shared/System/Globalization/Normalization.Unix.cs [moved from src/mscorlib/shared/System/Text/Normalization.Unix.cs with 92% similarity]
src/mscorlib/shared/System/Globalization/Normalization.Windows.cs [moved from src/mscorlib/src/System/Text/Normalization.Windows.cs with 88% similarity]
src/mscorlib/shared/System/Nullable.cs [moved from src/mscorlib/src/System/Nullable.cs with 64% similarity]
src/mscorlib/shared/System/Text/NormalizationForm.cs [moved from src/mscorlib/shared/System/Text/Normalization.cs with 100% similarity]

index 443a6bd..bac8f88 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\Resources\ResourceSet.cs" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="$(BclSourcesRoot)\System\Nullable.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Collections\Generic\Comparer.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Collections\Generic\ComparerHelpers.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Collections\Generic\EqualityComparer.cs" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetsWindows)' == 'true'">
     <Compile Include="$(BclSourcesRoot)\Interop\Windows\Kernel32\Interop.GetSystemDirectoryW.cs" />
-    <Compile Include="$(BclSourcesRoot)\Interop\Windows\Normaliz\Interop.Idna.cs" />
-    <Compile Include="$(BclSourcesRoot)\Interop\Windows\Normaliz\Interop.Normalization.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debug.Windows.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Globalization\CompareInfo.Windows.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Globalization\CultureData.Windows.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Globalization\CultureInfo.Windows.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Globalization\GlobalizationMode.Windows.cs" />
-    <Compile Include="$(BclSourcesRoot)\System\Globalization\IdnMapping.Windows.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Globalization\TextInfo.Windows.cs" />
-    <Compile Include="$(BclSourcesRoot)\System\Text\Normalization.Windows.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Threading\ClrThreadPoolBoundHandle.Windows.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Environment.Windows.cs" />
     <Compile Include="$(BclSourcesRoot)\System\TimeZoneInfo.Win32.cs" />
@@ -14,25 +14,22 @@ internal partial class Interop
         //
 
         [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern int IdnToAscii(
+        internal static extern unsafe int IdnToAscii(
                                         uint dwFlags,
-                                        IntPtr lpUnicodeCharStr,
+                                        char* lpUnicodeCharStr,
                                         int cchUnicodeChar,
-                                        [System.Runtime.InteropServices.OutAttribute()]
-                                        IntPtr lpASCIICharStr,
+                                        char* lpASCIICharStr,
                                         int cchASCIIChar);
 
         [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern int IdnToUnicode(
+        internal static extern unsafe int IdnToUnicode(
                                         uint dwFlags,
-                                        IntPtr lpASCIICharStr,
+                                        char* lpASCIICharStr,
                                         int cchASCIIChar,
-                                        [System.Runtime.InteropServices.OutAttribute()]
-                                        IntPtr lpUnicodeCharStr,
+                                        char* lpUnicodeCharStr,
                                         int cchUnicodeChar);
 
         internal const int IDN_ALLOW_UNASSIGNED = 0x1;
         internal const int IDN_USE_STD3_ASCII_RULES = 0x2;
-        internal const int ERROR_INVALID_NAME = 123;
     }
 }
index 0c2b677..d053ec1 100644 (file)
     <Compile Include="$(MSBuildThisFileDirectory)System\NotImplementedException.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\NonSerializedAttribute.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\NotSupportedException.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Nullable.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Number.Formatting.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Number.NumberBuffer.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Number.Parsing.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Text\EncodingNLS.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Text\EncodingProvider.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Text\Latin1Encoding.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)System\Text\Normalization.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Text\NormalizationForm.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Text\StringBuilder.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Text\UnicodeEncoding.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Text\UTF32Encoding.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.WideCharToMultiByte.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Normaliz\Interop.Idna.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
+    <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Normaliz\Interop.Normalization.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\OleAut32\Interop.SysAllocStringLen.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\OleAut32\Interop.SysFreeString.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\OleAut32\Interop.SysStringLen.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarData.Windows.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\HijriCalendar.Win32.cs" Condition="'$(EnableWinRT)' != 'true' and '$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\HijriCalendar.WinRT.cs" Condition="'$(EnableWinRT)' == 'true'" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\IdnMapping.Windows.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\JapaneseCalendar.Win32.cs" Condition="'$(EnableWinRT)' != 'true' and '$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\JapaneseCalendar.WinRT.cs" Condition="'$(EnableWinRT)' == 'true'" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\Normalization.Windows.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Windows.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStreamCompletionSource.Win32.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\IO\Path.Windows.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\IdnMapping.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\JapaneseCalendar.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\LocaleData.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\Normalization.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.OSX.cs" Condition="'$(TargetsOSX)' == 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Linux.cs" Condition="'$(TargetsOSX)' != 'true'" />
     <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Unix.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\IO\Path.Unix.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\IO\PathInternal.Unix.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Security\SecureString.Unix.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)System\Text\Normalization.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'" />
   </ItemGroup>
 </Project>
@@ -16,10 +16,10 @@ namespace System.Globalization
             uint flags = Flags;
 
             // Determine the required length
-            int length = Interop.Normaliz.IdnToAscii(flags, new IntPtr(unicode), count, IntPtr.Zero, 0);
+            int length = Interop.Normaliz.IdnToAscii(flags, unicode, count, null, 0);
             if (length == 0)
             {
-                ThrowForZeroLength(nameof(unicode), SR.Argument_IdnIllegalName, SR.Argument_InvalidCharSequenceNoIndex);
+                ThrowForZeroLength(unicode: true);
             }
 
             // Do the conversion
@@ -32,7 +32,7 @@ namespace System.Globalization
             else
             {
                 char[] output = new char[length];
-                fixed (char* pOutput = output)
+                fixed (char* pOutput = &output[0])
                 {
                     return GetAsciiCore(unicode, count, flags, pOutput, length);
                 }
@@ -43,10 +43,10 @@ namespace System.Globalization
         {
             Debug.Assert(!GlobalizationMode.Invariant);
 
-            int length = Interop.Normaliz.IdnToAscii(flags, new IntPtr(unicode), count, new IntPtr(output), outputLength);
+            int length = Interop.Normaliz.IdnToAscii(flags, unicode, count, output, outputLength);
             if (length == 0)
             {
-                ThrowForZeroLength(nameof(unicode), SR.Argument_IdnIllegalName, SR.Argument_InvalidCharSequenceNoIndex);
+                ThrowForZeroLength(unicode: true);
             }
             Debug.Assert(length == outputLength);
             return new string(output, 0, length);
@@ -59,10 +59,10 @@ namespace System.Globalization
             uint flags = Flags;
 
             // Determine the required length
-            int length = Interop.Normaliz.IdnToUnicode(flags, new IntPtr(ascii), count, IntPtr.Zero, 0);
+            int length = Interop.Normaliz.IdnToUnicode(flags, ascii, count, null, 0);
             if (length == 0)
             {
-                ThrowForZeroLength(nameof(ascii), SR.Argument_IdnIllegalName, SR.Argument_IdnBadPunycode);
+                ThrowForZeroLength(unicode: false);
             }
 
             // Do the conversion
@@ -75,7 +75,7 @@ namespace System.Globalization
             else
             {
                 char[] output = new char[length];
-                fixed (char* pOutput = output)
+                fixed (char* pOutput = &output[0])
                 {
                     return GetUnicodeCore(ascii, count, flags, pOutput, length);
                 }
@@ -86,10 +86,10 @@ namespace System.Globalization
         {
             Debug.Assert(!GlobalizationMode.Invariant);
 
-            int length = Interop.Normaliz.IdnToUnicode(flags, new IntPtr(ascii), count, new IntPtr(output), outputLength);
+            int length = Interop.Normaliz.IdnToUnicode(flags, ascii, count, output, outputLength);
             if (length == 0)
             {
-                ThrowForZeroLength(nameof(ascii), SR.Argument_IdnIllegalName, SR.Argument_IdnBadPunycode);
+                ThrowForZeroLength(unicode: false);
             }
             Debug.Assert(length == outputLength);
             return new string(output, 0, length);
@@ -110,11 +110,14 @@ namespace System.Globalization
             }
         }
 
-        private static void ThrowForZeroLength(string paramName, string invalidNameString, string otherString)
+        private static void ThrowForZeroLength(bool unicode)
         {
+            int lastError = Marshal.GetLastWin32Error();
+
             throw new ArgumentException(
-                Marshal.GetLastWin32Error() == Interop.Normaliz.ERROR_INVALID_NAME ? invalidNameString : otherString,
-                paramName);
+                lastError == Interop.Errors.ERROR_INVALID_NAME ? SR.Argument_IdnIllegalName : 
+                    (unicode ? SR.Argument_InvalidCharSequenceNoIndex : SR.Argument_IdnBadPunycode),
+                unicode ? "unicode" : "ascii");
         }
     }
 }
@@ -2,18 +2,17 @@
 // 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.Security;
 using System.Text;
 using System.Globalization;
 
 namespace System.Text
 {
-    static partial class Normalization
+    internal static partial class Normalization
     {
-        public static bool IsNormalized(this string strInput, NormalizationForm normalizationForm)
+        internal static bool IsNormalized(string strInput, NormalizationForm normalizationForm)
         {
-            ValidateArguments(strInput, normalizationForm);
-
             if (GlobalizationMode.Invariant)
             {
                 // In Invariant mode we assume all characters are normalized. 
@@ -21,6 +20,8 @@ namespace System.Text
                 return true;
             }
 
+            ValidateArguments(strInput, normalizationForm);
+
             int ret = Interop.GlobalizationInterop.IsNormalized(normalizationForm, strInput, strInput.Length);
 
             if (ret == -1)
@@ -31,10 +32,8 @@ namespace System.Text
             return ret == 1;
         }
 
-        public static string Normalize(this string strInput, NormalizationForm normalizationForm)
+        internal static string Normalize(string strInput, NormalizationForm normalizationForm)
         {
-            ValidateArguments(strInput, normalizationForm);
-
             if (GlobalizationMode.Invariant)
             {
                 // In Invariant mode we assume all characters are normalized. 
@@ -42,6 +41,8 @@ namespace System.Text
                 return strInput;
             }
 
+            ValidateArguments(strInput, normalizationForm);
+
             char[] buf = new char[strInput.Length];
 
             for (int attempts = 2; attempts > 0; attempts--)
@@ -70,10 +71,7 @@ namespace System.Text
 
         private static void ValidateArguments(string strInput, NormalizationForm normalizationForm)
         {
-            if (strInput == null)
-            {
-                throw new ArgumentNullException(nameof(strInput));
-            }
+            Debug.Assert(strInput != null);
 
             if (normalizationForm != NormalizationForm.FormC && normalizationForm != NormalizationForm.FormD &&
                 normalizationForm != NormalizationForm.FormKC && normalizationForm != NormalizationForm.FormKD)
@@ -2,22 +2,16 @@
 // 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.Security;
+using System.Diagnostics;
 using System.Globalization;
-using System.Text;
-using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
-using System.Runtime.Versioning;
-using System.Diagnostics;
+using System.Text;
 
 namespace System.Text
 {
-    // This internal class wraps up our normalization behavior
-
-    internal class Normalization
+    internal static partial class Normalization
     {
-        internal static bool IsNormalized(String strInput, NormalizationForm normalizationForm)
+        internal static bool IsNormalized(string strInput, NormalizationForm normalizationForm)
         {
             if (GlobalizationMode.Invariant)
             {
@@ -41,7 +35,10 @@ namespace System.Text
 
                 case Interop.Errors.ERROR_INVALID_PARAMETER:
                 case Interop.Errors.ERROR_NO_UNICODE_TRANSLATION:
-                    if (!Enum.IsDefined(typeof(NormalizationForm), normalizationForm))
+                    if (normalizationForm != NormalizationForm.FormC && 
+                        normalizationForm != NormalizationForm.FormD && 
+                        normalizationForm != NormalizationForm.FormKC && 
+                        normalizationForm != NormalizationForm.FormKD)
                     {
                         throw new ArgumentException(SR.Argument_InvalidNormalizationForm, nameof(normalizationForm));
                     }
@@ -58,7 +55,7 @@ namespace System.Text
             return result;
         }
 
-        internal static String Normalize(String strInput, NormalizationForm normalizationForm)
+        internal static string Normalize(string strInput, NormalizationForm normalizationForm)
         {
             if (GlobalizationMode.Invariant)
             {
@@ -82,7 +79,10 @@ namespace System.Text
             {
                 if (lastError == Interop.Errors.ERROR_INVALID_PARAMETER)
                 {
-                    if (!Enum.IsDefined(typeof(NormalizationForm), normalizationForm))
+                    if (normalizationForm != NormalizationForm.FormC && 
+                        normalizationForm != NormalizationForm.FormD && 
+                        normalizationForm != NormalizationForm.FormKC && 
+                        normalizationForm != NormalizationForm.FormKD)
                     {
                         throw new ArgumentException(SR.Argument_InvalidNormalizationForm, nameof(normalizationForm));
                     }
similarity index 64%
rename from src/mscorlib/src/System/Nullable.cs
rename to src/mscorlib/shared/System/Nullable.cs
index 159453d..5ee55e7 100644 (file)
@@ -2,33 +2,29 @@
 // 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.Globalization;
 using System.Reflection;
 using System.Collections.Generic;
 using System.Runtime;
+using System.Runtime.Versioning;
 using System.Runtime.CompilerServices;
-using System.Security;
 
 namespace System
 {
-    // Warning, don't put System.Runtime.Serialization.On*Serializ*Attribute
-    // on this class without first fixing ObjectClone::InvokeVtsCallbacks
     // Also, because we have special type system support that says a a boxed Nullable<T>
     // can be used where a boxed<T> is use, Nullable<T> can not implement any intefaces
     // at all (since T may not).   Do NOT add any interfaces to Nullable!
     // 
     [Serializable]
-    [System.Runtime.Versioning.NonVersionable] // This only applies to field layout
+    [NonVersionable] // This only applies to field layout
     [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
     public readonly struct Nullable<T> where T : struct
     {
         private readonly bool hasValue; // Do not rename (binary serialization)
         internal readonly T value; // Do not rename (binary serialization)
 
-        [System.Runtime.Versioning.NonVersionable]
+        [NonVersionable]
         public Nullable(T value)
         {
             this.value = value;
@@ -37,7 +33,7 @@ namespace System
 
         public bool HasValue
         {
-            [System.Runtime.Versioning.NonVersionable]
+            [NonVersionable]
             get
             {
                 return hasValue;
@@ -56,13 +52,13 @@ namespace System
             }
         }
 
-        [System.Runtime.Versioning.NonVersionable]
+        [NonVersionable]
         public T GetValueOrDefault()
         {
             return value;
         }
 
-        [System.Runtime.Versioning.NonVersionable]
+        [NonVersionable]
         public T GetValueOrDefault(T defaultValue)
         {
             return hasValue ? value : defaultValue;
@@ -85,33 +81,17 @@ namespace System
             return hasValue ? value.ToString() : "";
         }
 
-        [System.Runtime.Versioning.NonVersionable]
+        [NonVersionable]
         public static implicit operator Nullable<T>(T value)
         {
             return new Nullable<T>(value);
         }
 
-        [System.Runtime.Versioning.NonVersionable]
+        [NonVersionable]
         public static explicit operator T(Nullable<T> value)
         {
             return value.Value;
         }
-
-        // The following already obsoleted methods were removed:
-        //   public int CompareTo(object other)
-        //   public int CompareTo(Nullable<T> other)
-        //   public bool Equals(Nullable<T> other)
-        //   public static Nullable<T> FromObject(object value)
-        //   public object ToObject()
-        //   public string ToString(string format)
-        //   public string ToString(IFormatProvider provider)
-        //   public string ToString(string format, IFormatProvider provider)
-
-        // The following newly obsoleted methods were removed:
-        //   string IFormattable.ToString(string format, IFormatProvider provider)
-        //   int IComparable.CompareTo(object other)
-        //   int IComparable<Nullable<T>>.CompareTo(Nullable<T> other)
-        //   bool IEquatable<Nullable<T>>.Equals(Nullable<T> other)
     }
 
     public static class Nullable
@@ -146,28 +126,32 @@ namespace System
             {
                 throw new ArgumentNullException(nameof(nullableType));
             }
-            Type result = null;
+
+#if CORERT
+            // This is necessary to handle types without reflection metadata
+            if (nullableType.TryGetEEType(out EETypePtr nullableEEType))
+            {
+                if (nullableEEType.IsGeneric)
+                {
+                    if (nullableEEType.IsNullable)
+                    {
+                        return Internal.Reflection.Core.NonPortable.RuntimeTypeUnifier.GetRuntimeTypeForEEType(nullableEEType.NullableType);
+                    }
+                }
+                return null;
+            }
+#endif
+
             if (nullableType.IsGenericType && !nullableType.IsGenericTypeDefinition)
             {
                 // instantiated generic type only                
                 Type genericType = nullableType.GetGenericTypeDefinition();
                 if (Object.ReferenceEquals(genericType, typeof(Nullable<>)))
                 {
-                    result = nullableType.GetGenericArguments()[0];
+                    return nullableType.GetGenericArguments()[0];
                 }
             }
-            return result;
+            return null;
         }
-
-        // The following already obsoleted methods were removed:
-        //   public static bool HasValue<T>(Nullable<T> value)
-        //   public static T GetValueOrDefault<T>(Nullable<T> value)
-        //   public static T GetValueOrDefault<T>(Nullable<T> value, T valueWhenNull)
-
-        // The following newly obsoleted methods were removed:
-        //   public static Nullable<T> FromObject<T>(object value)
-        //   public static object ToObject<T>(Nullable<T> value)
-        //   public static object Wrap(object value, Type type)
-        //   public static object Unwrap(object value)
     }
 }