diff --git a/src/System.Globalization.Extensions/ref/System.Globalization.Extensions.csproj b/src/System.Globalization.Extensions/ref/System.Globalization.Extensions.csproj index 286fca013886..d54d23056b29 100644 --- a/src/System.Globalization.Extensions/ref/System.Globalization.Extensions.csproj +++ b/src/System.Globalization.Extensions/ref/System.Globalization.Extensions.csproj @@ -8,19 +8,12 @@ - + - - - - + - - - - \ No newline at end of file diff --git a/src/System.Globalization.Extensions/ref/System.Globalization.Extensions.netfx.cs b/src/System.Globalization.Extensions/ref/System.Globalization.Extensions.netfx.cs deleted file mode 100644 index bdb68e8d21be..000000000000 --- a/src/System.Globalization.Extensions/ref/System.Globalization.Extensions.netfx.cs +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.NormalizationForm))] -[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.IdnMapping))] - -namespace System -{ - public static class StringNormalizationExtensions - { - public static bool IsNormalized(this string value) { return default(bool); } - public static bool IsNormalized(this string value, System.Text.NormalizationForm normalizationForm) { return default(bool); } - public static String Normalize(this string value) { return default(string); } - public static String Normalize(this string value, System.Text.NormalizationForm normalizationForm) { return default(string); } - } -} - -namespace System.Globalization -{ - public static partial class GlobalizationExtensions - { - public static StringComparer GetStringComparer(this CompareInfo compareInfo, CompareOptions options) { return default(StringComparer); } - } -} diff --git a/src/System.Globalization.Extensions/src/ApiCompatBaseline.netfx.txt b/src/System.Globalization.Extensions/src/ApiCompatBaseline.netfx.txt deleted file mode 100644 index 00cbe9f3a480..000000000000 --- a/src/System.Globalization.Extensions/src/ApiCompatBaseline.netfx.txt +++ /dev/null @@ -1,4 +0,0 @@ -# This one is needed because when ApiCompat looks for the type, it will first check the v4.6.x targetting pack and find the System.Runtime.Extensions file -# which is not the latest (the one we just built) and it will load that instead of the one built inside CoreFx. -TypesMustExist : Type 'System.StringNormalizationExtensions' does not exist in the implementation but it does exist in the contract. -TypesMustExist : Type 'System.Globalization.GlobalizationExtensions' does not exist in the implementation but it does exist in the contract. diff --git a/src/System.Globalization.Extensions/src/Resources/Strings.resx b/src/System.Globalization.Extensions/src/Resources/Strings.resx deleted file mode 100644 index 9891a3c007b3..000000000000 --- a/src/System.Globalization.Extensions/src/Resources/Strings.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Value of flags is invalid. - - \ No newline at end of file diff --git a/src/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj b/src/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj index f8bf84548b18..542266563708 100644 --- a/src/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj +++ b/src/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj @@ -9,7 +9,6 @@ true {2B96AA10-84C0-4927-8611-8D2474B990E8} true - true @@ -17,21 +16,9 @@ - - - - - - - - + - - - - - \ No newline at end of file diff --git a/src/System.Globalization.Extensions/src/System/Globalization/Extensions.cs b/src/System.Globalization.Extensions/src/System/Globalization/Extensions.cs deleted file mode 100644 index 3e35e10b88fb..000000000000 --- a/src/System.Globalization.Extensions/src/System/Globalization/Extensions.cs +++ /dev/null @@ -1,97 +0,0 @@ -// 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; - -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)); - } - - // 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/src/System.Globalization.Extensions/src/System/StringNormalizationExtensions.netfx.cs b/src/System.Globalization.Extensions/src/System/StringNormalizationExtensions.netfx.cs deleted file mode 100644 index 02cfa407aef0..000000000000 --- a/src/System.Globalization.Extensions/src/System/StringNormalizationExtensions.netfx.cs +++ /dev/null @@ -1,29 +0,0 @@ -// 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 -{ - public static class StringNormalizationExtensions - { - public static bool IsNormalized(this string value) - { - return value.IsNormalized(); - } - - public static bool IsNormalized(this string value, System.Text.NormalizationForm normalizationForm) - { - return value.IsNormalized(normalizationForm); - } - - public static String Normalize(this string value) - { - return value.Normalize(); - } - - public static String Normalize(this string value, System.Text.NormalizationForm normalizationForm) - { - return value.Normalize(normalizationForm); - } - } -} diff --git a/src/System.Runtime.Extensions/src/System.Runtime.Extensions.csproj b/src/System.Runtime.Extensions/src/System.Runtime.Extensions.csproj index 718d19ffc5b4..61a1d0dcec83 100644 --- a/src/System.Runtime.Extensions/src/System.Runtime.Extensions.csproj +++ b/src/System.Runtime.Extensions/src/System.Runtime.Extensions.csproj @@ -33,7 +33,6 @@ - diff --git a/src/System.Runtime.Extensions/src/System/Globalization/Extensions.cs b/src/System.Runtime.Extensions/src/System/Globalization/Extensions.cs deleted file mode 100644 index 3e35e10b88fb..000000000000 --- a/src/System.Runtime.Extensions/src/System/Globalization/Extensions.cs +++ /dev/null @@ -1,97 +0,0 @@ -// 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; - -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)); - } - - // 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); - } - } -} -