diff options
Diffstat (limited to 'src/mscorlib/src/System/Globalization')
35 files changed, 16 insertions, 388 deletions
diff --git a/src/mscorlib/src/System/Globalization/Calendar.cs b/src/mscorlib/src/System/Globalization/Calendar.cs index d0460386b6..1ff795ddc5 100644 --- a/src/mscorlib/src/System/Globalization/Calendar.cs +++ b/src/mscorlib/src/System/Globalization/Calendar.cs @@ -31,7 +31,6 @@ namespace System.Globalization { // since most of the calendars (or all?) have the same way of calcuating hour/minute/second. [Serializable] - [System.Runtime.InteropServices.ComVisible(true)] public abstract class Calendar : ICloneable { @@ -98,7 +97,6 @@ namespace System.Globalization { // The minimum supported DateTime range for the calendar. - [System.Runtime.InteropServices.ComVisible(false)] public virtual DateTime MinSupportedDateTime { get @@ -109,7 +107,6 @@ namespace System.Globalization { // The maximum supported DateTime range for the calendar. - [System.Runtime.InteropServices.ComVisible(false)] public virtual DateTime MaxSupportedDateTime { get @@ -145,7 +142,6 @@ namespace System.Globalization { // Returns the type of the calendar. // - [System.Runtime.InteropServices.ComVisible(false)] public virtual CalendarAlgorithmType AlgorithmType { get @@ -161,7 +157,6 @@ namespace System.Globalization { // Detect if the object is readonly. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public bool IsReadOnly { get { return (m_isReadOnly); } @@ -174,7 +169,6 @@ namespace System.Globalization { // Is the implementation of ICloneable. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public virtual Object Clone() { object o = MemberwiseClone(); @@ -190,7 +184,6 @@ namespace System.Globalization { // readonly. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public static Calendar ReadOnly(Calendar calendar) { if (calendar == null) { throw new ArgumentNullException(nameof(calendar)); } @@ -709,7 +702,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public virtual int GetLeapMonth(int year) { return (GetLeapMonth(year, CurrentEra)); @@ -719,7 +711,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public virtual int GetLeapMonth(int year, int era) { if (!IsLeapYear(year, era)) diff --git a/src/mscorlib/src/System/Globalization/CalendarAlgorithmType.cs b/src/mscorlib/src/System/Globalization/CalendarAlgorithmType.cs index 4bf636656f..33b5035a8d 100644 --- a/src/mscorlib/src/System/Globalization/CalendarAlgorithmType.cs +++ b/src/mscorlib/src/System/Globalization/CalendarAlgorithmType.cs @@ -5,7 +5,6 @@ namespace System.Globalization { using System; -[System.Runtime.InteropServices.ComVisible(true)] public enum CalendarAlgorithmType { Unknown = 0, // This is the default value to return in the Calendar base class. SolarCalendar = 1, // Solar-base calendar, such as GregorianCalendar, jaoaneseCalendar, JulianCalendar, etc. diff --git a/src/mscorlib/src/System/Globalization/CalendarData.cs b/src/mscorlib/src/System/Globalization/CalendarData.cs index 6f583fbcbc..d66331b31d 100644 --- a/src/mscorlib/src/System/Globalization/CalendarData.cs +++ b/src/mscorlib/src/System/Globalization/CalendarData.cs @@ -400,41 +400,6 @@ namespace System.Globalization return "en-US"; } - internal void FixupWin7MonthDaySemicolonBug() - { - int unescapedCharacterIndex = FindUnescapedCharacter(sMonthDay, ';'); - if (unescapedCharacterIndex > 0) - { - sMonthDay = sMonthDay.Substring(0, unescapedCharacterIndex); - } - } - private static int FindUnescapedCharacter(string s, char charToFind) - { - bool inComment = false; - int length = s.Length; - for (int i = 0; i < length; i++) - { - char c = s[i]; - - switch (c) - { - case '\'': - inComment = !inComment; - break; - case '\\': - i++; // escape sequence -- skip next character - break; - default: - if (!inComment && charToFind == c) - { - return i; - } - break; - } - } - return -1; - } - // Get native two digit year max [MethodImplAttribute(MethodImplOptions.InternalCall)] diff --git a/src/mscorlib/src/System/Globalization/CalendarWeekRule.cs b/src/mscorlib/src/System/Globalization/CalendarWeekRule.cs index 578b5672fc..fa2a6429f1 100644 --- a/src/mscorlib/src/System/Globalization/CalendarWeekRule.cs +++ b/src/mscorlib/src/System/Globalization/CalendarWeekRule.cs @@ -7,7 +7,6 @@ namespace System.Globalization { [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public enum CalendarWeekRule { diff --git a/src/mscorlib/src/System/Globalization/ChineseLunisolarCalendar.cs b/src/mscorlib/src/System/Globalization/ChineseLunisolarCalendar.cs index 6479152e09..374ed0dcfa 100644 --- a/src/mscorlib/src/System/Globalization/ChineseLunisolarCalendar.cs +++ b/src/mscorlib/src/System/Globalization/ChineseLunisolarCalendar.cs @@ -44,7 +44,6 @@ namespace System.Globalization { internal static DateTime minDate = new DateTime(MIN_GREGORIAN_YEAR, MIN_GREGORIAN_MONTH, MIN_GREGORIAN_DAY); internal static DateTime maxDate = new DateTime((new DateTime(MAX_GREGORIAN_YEAR, MAX_GREGORIAN_MONTH, MAX_GREGORIAN_DAY, 23, 59, 59, 999)).Ticks + 9999); - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MinSupportedDateTime { get { @@ -53,7 +52,6 @@ namespace System.Globalization { } - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MaxSupportedDateTime { get { @@ -371,7 +369,6 @@ namespace System.Globalization { } - [System.Runtime.InteropServices.ComVisible(false)] public override int GetEra(DateTime time) { CheckTicksRange(time.Ticks); return (ChineseEra); @@ -391,7 +388,6 @@ namespace System.Globalization { } - [System.Runtime.InteropServices.ComVisible(false)] public override int[] Eras { get { return (new int[] {ChineseEra}); diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.cs b/src/mscorlib/src/System/Globalization/CompareInfo.cs index dcf1f32e4a..6c2230b66b 100644 --- a/src/mscorlib/src/System/Globalization/CompareInfo.cs +++ b/src/mscorlib/src/System/Globalization/CompareInfo.cs @@ -29,7 +29,6 @@ namespace System.Globalization { using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Threading; - using System.Security.Permissions; using Microsoft.Win32; using System.Security; using System.Diagnostics; @@ -45,7 +44,6 @@ namespace System.Globalization { [Serializable] [Flags] - [System.Runtime.InteropServices.ComVisible(true)] public enum CompareOptions { None = 0x00000000, @@ -66,7 +64,6 @@ namespace System.Globalization { [Serializable] - [System.Runtime.InteropServices.ComVisible(true)] public partial class CompareInfo : IDeserializationCallback { // Mask used to check if IndexOf()/LastIndexOf()/IsPrefix()/IsPostfix() has the right flags. @@ -217,12 +214,10 @@ namespace System.Globalization { return CultureInfo.GetCultureInfo(name).CompareInfo; } - [System.Runtime.InteropServices.ComVisible(false)] public static bool IsSortable(char ch) { return(IsSortable(ch.ToString())); } - [System.Runtime.InteropServices.ComVisible(false)] public static bool IsSortable(String text) { if (text == null) { // A null param is invalid here. @@ -316,7 +311,6 @@ namespace System.Globalization { // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public virtual String Name { get diff --git a/src/mscorlib/src/System/Globalization/CultureData.cs b/src/mscorlib/src/System/Globalization/CultureData.cs index 0bcb796152..a93b7d43bb 100644 --- a/src/mscorlib/src/System/Globalization/CultureData.cs +++ b/src/mscorlib/src/System/Globalization/CultureData.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// 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. @@ -1102,15 +1102,6 @@ namespace System.Globalization } } - // (user can override) country code (RegionInfo) - internal int ICOUNTRY - { - get - { - return DoGetLocaleInfoInt(LOCALE_ICOUNTRY); - } - } - // GeoId internal int IGEOID { @@ -1214,15 +1205,6 @@ namespace System.Globalization } } - // Default Country - private int IDEFAULTCOUNTRY - { - get - { - return DoGetLocaleInfoInt(LOCALE_IDEFAULTCOUNTRY); - } - } - // Console fallback name (ie: locale to use for console apps for unicode-only locales) internal int IINPUTLANGUAGEHANDLE { @@ -1262,26 +1244,6 @@ namespace System.Globalization } } - ///////////// - // Numbers // - //////////// - - // internal String sPositiveSign ; // (user can override) positive sign - // internal String sNegativeSign ; // (user can override) negative sign - // internal String[] saNativeDigits ; // (user can override) native characters for digits 0-9 - // internal int iDigitSubstitution ; // (user can override) Digit substitution 0=context, 1=none/arabic, 2=Native/national (2 seems to be unused) (Windows Only) - // internal int iDigits ; // (user can override) number of fractional digits - // internal int iNegativeNumber ; // (user can override) negative number format - - // Leading zeroes - private bool ILEADINGZEROS - { - get - { - return (DoGetLocaleInfoInt(LOCALE_ILZERO) == 1); - } - } - // (user can override) grouping of digits internal int[] WAGROUPING @@ -1506,15 +1468,6 @@ namespace System.Globalization } } - // Paper size - private int IPAPERSIZE - { - get - { - return DoGetLocaleInfoInt(LOCALE_IPAPERSIZE); - } - } - //////////////////////////// // Calendar/Time (Gregorian) // //////////////////////////// @@ -1712,20 +1665,6 @@ namespace System.Globalization return index; } - // time duration format - internal String[] SADURATION - { - get - { - if (this.saDurationFormats == null) - { - String durationFormat = DoGetLocaleInfo(LOCALE_SDURATION); - this.saDurationFormats = new String[] { ReescapeWin32String(durationFormat) }; - } - return this.saDurationFormats; - } - } - // (user can override) first day of week internal int IFIRSTDAYOFWEEK { @@ -1944,11 +1883,6 @@ namespace System.Globalization return calendarData; } - internal int CurrentEra(int calendarId) - { - return GetCalendar(calendarId).iCurrentEra; - } - /////////////////// // Text Information // /////////////////// @@ -2054,48 +1988,6 @@ namespace System.Globalization } } - // Typical Scripts for this locale (latn;cyrl; etc) - - private String SSCRIPTS - { - get - { - if (this.sScripts == null) - { - this.sScripts = DoGetLocaleInfo(LOCALE_SSCRIPTS); - } - return this.sScripts; - } - } - - private String SOPENTYPELANGUAGETAG - { - get - { - return DoGetLocaleInfo(LOCALE_SOPENTYPELANGUAGETAG); - } - } - - private String FONTSIGNATURE - { - get - { - if (this.fontSignature == null) - { - this.fontSignature = DoGetLocaleInfo(LOCALE_FONTSIGNATURE); - } - return this.fontSignature; - } - } - - private String SKEYBOARDSTOINSTALL - { - get - { - return DoGetLocaleInfo(LOCALE_SKEYBOARDSTOINSTALL); - } - } - internal int IDEFAULTANSICODEPAGE // default ansi code page ID (ACP) { diff --git a/src/mscorlib/src/System/Globalization/CultureInfo.cs b/src/mscorlib/src/System/Globalization/CultureInfo.cs index 9f306c3c99..ba61c146f6 100644 --- a/src/mscorlib/src/System/Globalization/CultureInfo.cs +++ b/src/mscorlib/src/System/Globalization/CultureInfo.cs @@ -36,7 +36,6 @@ namespace System.Globalization { using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; - using System.Security.Permissions; using System.Reflection; using Microsoft.Win32; using System.Diagnostics; @@ -44,7 +43,6 @@ namespace System.Globalization { using System.Resources; [Serializable] - [System.Runtime.InteropServices.ComVisible(true)] public partial class CultureInfo : ICloneable, IFormatProvider { //--------------------------------------------------------------------// // Internal Information // @@ -82,10 +80,6 @@ namespace System.Globalization { [NonSerialized]internal CultureData m_cultureData; [NonSerialized]internal bool m_isInherited; -#if FEATURE_LEAK_CULTURE_INFO - [NonSerialized]private bool m_isSafeCrossDomain; - [NonSerialized]private int m_createdDomainID; -#endif // !FEATURE_LEAK_CULTURE_INFO [NonSerialized]private CultureInfo m_consoleFallbackCulture; // Names are confusing. Here are 3 names we have: @@ -370,25 +364,6 @@ namespace System.Globalization { } #endif // FEATURE_USE_LCID - // - // CheckDomainSafetyObject throw if the object is customized object which cannot be attached to - // other object (like CultureInfo or DateTimeFormatInfo). - // - - internal static void CheckDomainSafetyObject(Object obj, Object container) - { - if (obj.GetType().Assembly != typeof(System.Globalization.CultureInfo).Assembly) { - - throw new InvalidOperationException( - String.Format( - CultureInfo.CurrentCulture, - Environment.GetResourceString("InvalidOperation_SubclassedObject"), - obj.GetType(), - container.GetType())); - } - Contract.EndContractBlock(); - } - #region Serialization // We need to store the override from the culture data record. private bool m_useUserOverride; @@ -421,21 +396,6 @@ namespace System.Globalization { } #endif m_isInherited = (this.GetType() != typeof(System.Globalization.CultureInfo)); - - // in case we have non customized CultureInfo object we shouldn't allow any customized object - // to be attached to it for cross app domain safety. - if (this.GetType().Assembly == typeof(System.Globalization.CultureInfo).Assembly) - { - if (textInfo != null) - { - CheckDomainSafetyObject(textInfo, this); - } - - if (compareInfo != null) - { - CheckDomainSafetyObject(compareInfo, this); - } - } } #if FEATURE_USE_LCID @@ -470,57 +430,8 @@ namespace System.Globalization { this.cultureID = this.m_cultureData.ILANGUAGE; #endif } -#endregion Serialization - -#if FEATURE_LEAK_CULTURE_INFO - // Is it safe to send this CultureInfo as an instance member of a Thread cross AppDomain boundaries? - // For Silverlight, the answer is always no. - internal bool IsSafeCrossDomain { - get { - Debug.Assert(m_createdDomainID != 0, "[CultureInfo.IsSafeCrossDomain] m_createdDomainID != 0"); - return m_isSafeCrossDomain; - } - } - - internal int CreatedDomainID { - get { - Debug.Assert(m_createdDomainID != 0, "[CultureInfo.CreatedDomain] m_createdDomainID != 0"); - return m_createdDomainID; - } - } - - internal void StartCrossDomainTracking() { - - // If we have decided about cross domain safety of this instance, we are done - if (m_createdDomainID != 0) - return; - - // If FEATURE_LEAK_CULTURE_INFO isn't enabled, we never want to pass - // CultureInfo as an instance member of a Thread. - if (CanSendCrossDomain()) - { - m_isSafeCrossDomain = true; - } - - // m_createdDomainID has to be assigned last. We use it to signal that we have - // completed the check. - System.Threading.Thread.MemoryBarrier(); - m_createdDomainID = Thread.GetDomainID(); - } -#endif // FEATURE_LEAK_CULTURE_INFO - // Is it safe to pass the CultureInfo cross AppDomain boundaries, not necessarily as an instance - // member of Thread. This is different from IsSafeCrossDomain, which implies passing the CultureInfo - // as a Thread instance member. - internal bool CanSendCrossDomain() - { - bool isSafe = false; - if (this.GetType() == typeof(System.Globalization.CultureInfo)) - { - isSafe = true; - } - return isSafe; - } +#endregion Serialization // Constructor called by SQL Server's special munged culture - creates a culture with // a TextInfo and CompareInfo that come from a supplied alternate source. This object @@ -949,7 +860,6 @@ namespace System.Globalization { // //////////////////////////////////////////////////////////////////////// #if FEATURE_USE_LCID - [System.Runtime.InteropServices.ComVisible(false)] public virtual int KeyboardLayoutId { get @@ -1010,7 +920,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public String IetfLanguageTag { get @@ -1258,7 +1167,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public CultureTypes CultureTypes { get @@ -1473,7 +1381,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public CultureInfo GetConsoleFallbackUICulture() { Contract.Ensures(Contract.Result<CultureInfo>() != null); @@ -1885,9 +1792,6 @@ namespace System.Globalization { [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern int nativeGetLocaleInfoExInt(String localeName, uint field); - [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal static extern bool nativeSetThreadLocale(String localeName); - private static String GetDefaultLocaleName(int localeType) { Debug.Assert(localeType == LOCALE_USER_DEFAULT || localeType == LOCALE_SYSTEM_DEFAULT, "[CultureInfo.GetDefaultLocaleName] localeType must be LOCALE_USER_DEFAULT or LOCALE_SYSTEM_DEFAULT"); diff --git a/src/mscorlib/src/System/Globalization/CultureNotFoundException.cs b/src/mscorlib/src/System/Globalization/CultureNotFoundException.cs index 17c0b43f9c..d4ab700a16 100644 --- a/src/mscorlib/src/System/Globalization/CultureNotFoundException.cs +++ b/src/mscorlib/src/System/Globalization/CultureNotFoundException.cs @@ -10,7 +10,6 @@ namespace System.Globalization { using System.Threading; using System.Diagnostics.Contracts; - [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public partial class CultureNotFoundException : ArgumentException, ISerializable { diff --git a/src/mscorlib/src/System/Globalization/CultureTypes.cs b/src/mscorlib/src/System/Globalization/CultureTypes.cs index d506d50c9d..b19ab86bb1 100644 --- a/src/mscorlib/src/System/Globalization/CultureTypes.cs +++ b/src/mscorlib/src/System/Globalization/CultureTypes.cs @@ -11,7 +11,6 @@ namespace System.Globalization { [Serializable] [Flags] - [System.Runtime.InteropServices.ComVisible(true)] public enum CultureTypes { NeutralCultures = 0x0001, // Neutral cultures are cultures like "en", "de", "zh", etc, for enumeration this includes ALL neutrals regardless of other flags diff --git a/src/mscorlib/src/System/Globalization/DateTimeFormat.cs b/src/mscorlib/src/System/Globalization/DateTimeFormat.cs index c6e0591a74..1ace207952 100644 --- a/src/mscorlib/src/System/Globalization/DateTimeFormat.cs +++ b/src/mscorlib/src/System/Globalization/DateTimeFormat.cs @@ -1124,14 +1124,6 @@ namespace System { // local DateTime with a format that will be interpreted as UTC. internal static void InvalidFormatForLocal(String format, DateTime dateTime) { } - - // This is an MDA for cases when the user is using a local format with - // a Utc DateTime. - internal static void InvalidFormatForUtc(String format, DateTime dateTime) { -#if MDA_SUPPORTED - Mda.DateTimeInvalidLocalFormat(); -#endif - } } diff --git a/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs b/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs index 14cdeb60e9..b2374ef0b2 100644 --- a/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs +++ b/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs @@ -10,7 +10,6 @@ namespace System.Globalization { using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; - using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; @@ -56,7 +55,6 @@ namespace System.Globalization { [Serializable] - [System.Runtime.InteropServices.ComVisible(true)] public sealed class DateTimeFormatInfo : ICloneable, IFormatProvider { // @@ -378,8 +376,6 @@ namespace System.Globalization { private int nDataItem; [OptionalField(VersionAdded = 2)] internal bool m_isDefaultCalendar; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey) - [OptionalField(VersionAdded = 2)] - private static volatile Hashtable s_calendarNativeNames; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey) // This was synthesized by Whidbey so we knew what words might appear in the middle of a date string // Now we always synthesize so its not helpful @@ -408,10 +404,6 @@ namespace System.Globalization { calendar = (Calendar) GregorianCalendar.GetDefaultInstance().Clone(); calendar.SetReadOnlyState(m_isReadOnly); } - else - { - CultureInfo.CheckDomainSafetyObject(calendar, this); - } InitializeOverridableProperties(m_cultureData, calendar.ID); // @@ -587,12 +579,6 @@ namespace System.Globalization { return; } - // - // Because the culture is agile object which can be attached to a thread and then thread can travel - // to another app domain then we prevent attaching any customized object to culture that we cannot contol. - // - CultureInfo.CheckDomainSafetyObject(value, this); - for (int i = 0; i < this.OptionalCalendars.Length; i++) { if (this.OptionalCalendars[i] == value.ID) @@ -1370,7 +1356,6 @@ namespace System.Globalization { // Returns the string array of the one-letter day of week names. - [System.Runtime.InteropServices.ComVisible(false)] public String[] ShortestDayNames { get @@ -1593,7 +1578,6 @@ namespace System.Globalization { // Returns the super short day of week names for the specified day of week. - [System.Runtime.InteropServices.ComVisible(false)] public String GetShortestDayName(DayOfWeek dayOfWeek) { @@ -1971,7 +1955,6 @@ namespace System.Globalization { // String nativeName = dtfi.NativeCalendarName; // Get the Japanese name for the Japanese calendar. // DateTimeFormatInfo dtfi = new CultureInfo("ja-JP", false).DateTimeFormat.Calendar = new GregorianCalendar(GregorianCalendarTypes.Localized); // String nativeName = dtfi.NativeCalendarName; // Get the Japanese name for the Gregorian calendar. - [System.Runtime.InteropServices.ComVisible(false)] public String NativeCalendarName { get @@ -1998,7 +1981,6 @@ namespace System.Globalization { // WARNING: If more validation is ever done in one place, it should be done in the other. // - [System.Runtime.InteropServices.ComVisible(false)] public void SetAllDateTimePatterns(String[] patterns, char format) { if (IsReadOnly) @@ -2061,7 +2043,6 @@ namespace System.Globalization { return; } - [System.Runtime.InteropServices.ComVisible(false)] public String[] AbbreviatedMonthGenitiveNames { get @@ -2089,7 +2070,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public String[] MonthGenitiveNames { get @@ -2455,7 +2435,7 @@ namespace System.Globalization { case DateTimeFormatInfoScanner.IgnorableSymbolChar: String symbol = dateWords[i].Substring(1); InsertHash(temp, symbol, TokenType.IgnorableSymbol, 0); - if (this.DateSeparator.Trim(null).Equals(symbol)) + if (this.DateSeparator.Trim().Equals(symbol)) { // The date separator is the same as the ingorable symbol. useDateSepAsIgnorableSymbol = true; @@ -2802,7 +2782,7 @@ namespace System.Globalization { // If there is whitespace characters in the beginning and end of the string, trim them since whitespaces are skipped by // DateTime.Parse(). if (Char.IsWhiteSpace(str[0]) || Char.IsWhiteSpace(str[str.Length - 1])) { - str = str.Trim(null); // Trim white space characters. + str = str.Trim(); // Trim white space characters. // Could have space for separators if (str.Length == 0) return; diff --git a/src/mscorlib/src/System/Globalization/DateTimeStyles.cs b/src/mscorlib/src/System/Globalization/DateTimeStyles.cs index ddae7b2f29..eadeda8e72 100644 --- a/src/mscorlib/src/System/Globalization/DateTimeStyles.cs +++ b/src/mscorlib/src/System/Globalization/DateTimeStyles.cs @@ -16,7 +16,6 @@ namespace System.Globalization { [Serializable] [Flags] -[System.Runtime.InteropServices.ComVisible(true)] public enum DateTimeStyles { // Bit flag indicating that leading whitespace is allowed. Character values // 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, and 0x0020 are considered to be diff --git a/src/mscorlib/src/System/Globalization/DaylightTime.cs b/src/mscorlib/src/System/Globalization/DaylightTime.cs index a164867576..a21e092955 100644 --- a/src/mscorlib/src/System/Globalization/DaylightTime.cs +++ b/src/mscorlib/src/System/Globalization/DaylightTime.cs @@ -8,7 +8,6 @@ namespace System.Globalization { // This class represents a starting/ending time for a period of daylight saving time. [Serializable] - [ComVisible(true)] public class DaylightTime { internal DateTime m_start; diff --git a/src/mscorlib/src/System/Globalization/DigitShapes.cs b/src/mscorlib/src/System/Globalization/DigitShapes.cs index d5b5ecc89c..1513d56f5c 100644 --- a/src/mscorlib/src/System/Globalization/DigitShapes.cs +++ b/src/mscorlib/src/System/Globalization/DigitShapes.cs @@ -9,7 +9,6 @@ namespace System.Globalization { [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public enum DigitShapes : int { Context = 0x0000, // The shape depends on the previous text in the same output. diff --git a/src/mscorlib/src/System/Globalization/EastAsianLunisolarCalendar.cs b/src/mscorlib/src/System/Globalization/EastAsianLunisolarCalendar.cs index 3c9391fa63..3f6df52a96 100644 --- a/src/mscorlib/src/System/Globalization/EastAsianLunisolarCalendar.cs +++ b/src/mscorlib/src/System/Globalization/EastAsianLunisolarCalendar.cs @@ -14,7 +14,6 @@ namespace System.Globalization { [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public abstract class EastAsianLunisolarCalendar : Calendar { internal const int LeapMonth = 0; internal const int Jan1Month = 1; diff --git a/src/mscorlib/src/System/Globalization/EncodingTable.cs b/src/mscorlib/src/System/Globalization/EncodingTable.cs index d908a2ac2b..b7c268a956 100644 --- a/src/mscorlib/src/System/Globalization/EncodingTable.cs +++ b/src/mscorlib/src/System/Globalization/EncodingTable.cs @@ -203,10 +203,6 @@ namespace System.Globalization [MethodImplAttribute(MethodImplOptions.InternalCall)] private unsafe static extern InternalCodePageDataItem* GetCodePageData(); - - [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal unsafe static extern byte* nativeCreateOpenFileMapping( - String inSectionName, int inBytesToAllocate, out IntPtr mappedFileHandle); } /*=================================InternalEncodingDataItem========================== diff --git a/src/mscorlib/src/System/Globalization/GlobalizationAssembly.cs b/src/mscorlib/src/System/Globalization/GlobalizationAssembly.cs index 0810d67b59..e203223eb0 100644 --- a/src/mscorlib/src/System/Globalization/GlobalizationAssembly.cs +++ b/src/mscorlib/src/System/Globalization/GlobalizationAssembly.cs @@ -10,7 +10,6 @@ namespace System.Globalization { using System.Collections.Generic; using System.Threading; using System.Security; - using System.Security.Permissions; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; diff --git a/src/mscorlib/src/System/Globalization/GregorianCalendar.cs b/src/mscorlib/src/System/Globalization/GregorianCalendar.cs index 6cf9b2eb85..9083e6de27 100644 --- a/src/mscorlib/src/System/Globalization/GregorianCalendar.cs +++ b/src/mscorlib/src/System/Globalization/GregorianCalendar.cs @@ -22,7 +22,6 @@ namespace System.Globalization { // 0 CurrentEra (AD) // 1 BeforeCurrentEra (BC) - [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public class GregorianCalendar : Calendar { @@ -77,7 +76,6 @@ namespace System.Globalization { } #endregion Serialization - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MinSupportedDateTime { get @@ -86,7 +84,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MaxSupportedDateTime { get @@ -98,7 +95,6 @@ namespace System.Globalization { // Return the type of the Gregorian calendar. // - [System.Runtime.InteropServices.ComVisible(false)] public override CalendarAlgorithmType AlgorithmType { get @@ -495,7 +491,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public override int GetLeapMonth(int year, int era) { if (era != CurrentEra && era != ADEra) diff --git a/src/mscorlib/src/System/Globalization/GregorianCalendarTypes.cs b/src/mscorlib/src/System/Globalization/GregorianCalendarTypes.cs index a9e25d06bf..1af5e9221c 100644 --- a/src/mscorlib/src/System/Globalization/GregorianCalendarTypes.cs +++ b/src/mscorlib/src/System/Globalization/GregorianCalendarTypes.cs @@ -6,7 +6,6 @@ namespace System.Globalization { using System; [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public enum GregorianCalendarTypes { Localized = Calendar.CAL_GREGORIAN, USEnglish = Calendar.CAL_GREGORIAN_US, diff --git a/src/mscorlib/src/System/Globalization/HebrewCalendar.cs b/src/mscorlib/src/System/Globalization/HebrewCalendar.cs index 44cbdb8bde..190c3f17d2 100644 --- a/src/mscorlib/src/System/Globalization/HebrewCalendar.cs +++ b/src/mscorlib/src/System/Globalization/HebrewCalendar.cs @@ -64,7 +64,6 @@ namespace System.Globalization { [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public class HebrewCalendar : Calendar { diff --git a/src/mscorlib/src/System/Globalization/HijriCalendar.cs b/src/mscorlib/src/System/Globalization/HijriCalendar.cs index 39a01e5774..061d380285 100644 --- a/src/mscorlib/src/System/Globalization/HijriCalendar.cs +++ b/src/mscorlib/src/System/Globalization/HijriCalendar.cs @@ -49,7 +49,6 @@ namespace System.Globalization { */ [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public class HijriCalendar : Calendar { @@ -84,7 +83,6 @@ namespace System.Globalization { internal static readonly DateTime calendarMaxValue = DateTime.MaxValue; - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MinSupportedDateTime { get @@ -94,7 +92,6 @@ namespace System.Globalization { } - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MaxSupportedDateTime { get @@ -106,7 +103,6 @@ namespace System.Globalization { // Return the type of the Hijri calendar. // - [System.Runtime.InteropServices.ComVisible(false)] public override CalendarAlgorithmType AlgorithmType { get @@ -614,7 +610,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public override int GetLeapMonth(int year, int era) { CheckYearRange(year, era); diff --git a/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs b/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs index 6b168ce916..72331f8346 100644 --- a/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs +++ b/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs @@ -8,8 +8,6 @@ namespace System.Globalization { using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using Microsoft.Win32; - using PermissionSet = System.Security.PermissionSet; - using System.Security.Permissions; /*=================================JapaneseCalendar========================== ** @@ -41,13 +39,11 @@ namespace System.Globalization { [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public class JapaneseCalendar : Calendar { internal static readonly DateTime calendarMinValue = new DateTime(1868, 9, 8); - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MinSupportedDateTime { get @@ -56,7 +52,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MaxSupportedDateTime { get @@ -68,7 +63,6 @@ namespace System.Globalization { // Return the type of the Japanese calendar. // - [System.Runtime.InteropServices.ComVisible(false)] public override CalendarAlgorithmType AlgorithmType { get @@ -167,10 +161,6 @@ namespace System.Globalization { try { - // Need to access registry - PermissionSet permSet = new PermissionSet(PermissionState.None); - permSet.AddPermission(new RegistryPermission(RegistryPermissionAccess.Read, c_japaneseErasHivePermissionList)); - permSet.Assert(); RegistryKey key = Registry.LocalMachine.OpenSubKey(c_japaneseErasHive, writable: false); // Abort if we didn't find anything @@ -311,7 +301,7 @@ namespace System.Globalization { // Get Strings // // Needs to be a certain length e_a_E_A at least (7 chars, exactly 4 groups) - String[] names = data.Split(new char[] {'_'}); + String[] names = data.Split('_'); // Should have exactly 4 parts // 0 - Era Name @@ -425,7 +415,6 @@ namespace System.Globalization { [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems. - [System.Runtime.InteropServices.ComVisible(false)] public override int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek) { return (helper.GetWeekOfYear(time, rule, firstDayOfWeek)); @@ -469,7 +458,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public override int GetLeapMonth(int year, int era) { return (helper.GetLeapMonth(year, era)); diff --git a/src/mscorlib/src/System/Globalization/JulianCalendar.cs b/src/mscorlib/src/System/Globalization/JulianCalendar.cs index db286e0363..ff8801433c 100644 --- a/src/mscorlib/src/System/Globalization/JulianCalendar.cs +++ b/src/mscorlib/src/System/Globalization/JulianCalendar.cs @@ -18,7 +18,6 @@ namespace System.Globalization { //* Julia 0001/01/03 9999/10/19 [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public class JulianCalendar : Calendar { @@ -51,7 +50,6 @@ namespace System.Globalization { internal int MaxYear = 9999; - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MinSupportedDateTime { get @@ -60,7 +58,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MaxSupportedDateTime { get @@ -72,7 +69,6 @@ namespace System.Globalization { // Return the type of the Julian calendar. // - [System.Runtime.InteropServices.ComVisible(false)] public override CalendarAlgorithmType AlgorithmType { get @@ -344,7 +340,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public override int GetLeapMonth(int year, int era) { CheckYearEraRange(year, era); diff --git a/src/mscorlib/src/System/Globalization/KoreanCalendar.cs b/src/mscorlib/src/System/Globalization/KoreanCalendar.cs index dde82b6e6b..6c5a03b7e8 100644 --- a/src/mscorlib/src/System/Globalization/KoreanCalendar.cs +++ b/src/mscorlib/src/System/Globalization/KoreanCalendar.cs @@ -24,7 +24,6 @@ namespace System.Globalization { ============================================================================*/ -[System.Runtime.InteropServices.ComVisible(true)] [Serializable] public class KoreanCalendar: Calendar { // // The era value for the current era. @@ -49,7 +48,6 @@ namespace System.Globalization { internal GregorianCalendarHelper helper; - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MinSupportedDateTime { get @@ -58,7 +56,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MaxSupportedDateTime { get @@ -70,7 +67,6 @@ namespace System.Globalization { // Return the type of the Korean calendar. // - [System.Runtime.InteropServices.ComVisible(false)] public override CalendarAlgorithmType AlgorithmType { get @@ -165,7 +161,6 @@ namespace System.Globalization { [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems. - [System.Runtime.InteropServices.ComVisible(false)] public override int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek) { return (helper.GetWeekOfYear(time, rule, firstDayOfWeek)); @@ -200,7 +195,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public override int GetLeapMonth(int year, int era) { return (helper.GetLeapMonth(year, era)); diff --git a/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs b/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs index a5dce46aa4..d95aac3d3d 100644 --- a/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs +++ b/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. namespace System.Globalization { - using System.Security.Permissions; using System.Runtime.Serialization; using System.Text; using System; @@ -41,7 +40,6 @@ namespace System.Globalization { // [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] sealed public partial class NumberFormatInfo : ICloneable, IFormatProvider { // invariantInfo is constant irrespective of your current culture. @@ -312,7 +310,7 @@ namespace System.Globalization { get { return currencyDecimalSeparator; } set { VerifyWritable(); - VerifyDecimalSeparator(value, "CurrencyDecimalSeparator"); + VerifyDecimalSeparator(value, nameof(CurrencyDecimalSeparator)); currencyDecimalSeparator = value; } } @@ -361,7 +359,7 @@ namespace System.Globalization { VerifyWritable(); Int32[] inputSizes = (Int32[])value.Clone(); - CheckGroupSize("CurrencyGroupSizes", inputSizes); + CheckGroupSize(nameof(CurrencyGroupSizes), inputSizes); currencyGroupSizes = inputSizes; } @@ -382,7 +380,7 @@ namespace System.Globalization { VerifyWritable(); Int32[] inputSizes = (Int32[])value.Clone(); - CheckGroupSize("NumberGroupSizes", inputSizes); + CheckGroupSize(nameof(NumberGroupSizes), inputSizes); numberGroupSizes = inputSizes; } } @@ -400,7 +398,7 @@ namespace System.Globalization { Contract.EndContractBlock(); VerifyWritable(); Int32[] inputSizes = (Int32[])value.Clone(); - CheckGroupSize("PercentGroupSizes", inputSizes); + CheckGroupSize(nameof(PercentGroupSizes), inputSizes); percentGroupSizes = inputSizes; } @@ -411,7 +409,7 @@ namespace System.Globalization { get { return currencyGroupSeparator; } set { VerifyWritable(); - VerifyGroupSeparator(value, "CurrencyGroupSeparator"); + VerifyGroupSeparator(value, nameof(CurrencyGroupSeparator)); currencyGroupSeparator = value; } } @@ -602,7 +600,7 @@ namespace System.Globalization { get { return numberDecimalSeparator; } set { VerifyWritable(); - VerifyDecimalSeparator(value, "NumberDecimalSeparator"); + VerifyDecimalSeparator(value, nameof(NumberDecimalSeparator)); numberDecimalSeparator = value; } } @@ -612,7 +610,7 @@ namespace System.Globalization { get { return numberGroupSeparator; } set { VerifyWritable(); - VerifyGroupSeparator(value, "NumberGroupSeparator"); + VerifyGroupSeparator(value, nameof(NumberGroupSeparator)); numberGroupSeparator = value; } } @@ -690,7 +688,7 @@ namespace System.Globalization { get { return percentDecimalSeparator; } set { VerifyWritable(); - VerifyDecimalSeparator(value, "PercentDecimalSeparator"); + VerifyDecimalSeparator(value, nameof(PercentDecimalSeparator)); percentDecimalSeparator = value; } } @@ -700,7 +698,7 @@ namespace System.Globalization { get { return percentGroupSeparator; } set { VerifyWritable(); - VerifyGroupSeparator(value, "PercentGroupSeparator"); + VerifyGroupSeparator(value, nameof(PercentGroupSeparator)); percentGroupSeparator = value; } } @@ -736,26 +734,24 @@ namespace System.Globalization { } - [System.Runtime.InteropServices.ComVisible(false)] public String[] NativeDigits { get { return (String[])nativeDigits.Clone(); } set { VerifyWritable(); - VerifyNativeDigits(value, "NativeDigits"); + VerifyNativeDigits(value, nameof(NativeDigits)); nativeDigits = value; } } - [System.Runtime.InteropServices.ComVisible(false)] public DigitShapes DigitSubstitution { get { return (DigitShapes)digitSubstitution; } set { VerifyWritable(); - VerifyDigitSubstitution(value, "DigitSubstitution"); + VerifyDigitSubstitution(value, nameof(DigitSubstitution)); digitSubstitution = (int)value; } } diff --git a/src/mscorlib/src/System/Globalization/NumberStyles.cs b/src/mscorlib/src/System/Globalization/NumberStyles.cs index 42b9847ed3..969c07fc2a 100644 --- a/src/mscorlib/src/System/Globalization/NumberStyles.cs +++ b/src/mscorlib/src/System/Globalization/NumberStyles.cs @@ -16,7 +16,6 @@ namespace System.Globalization { using System; [Serializable] [Flags] - [System.Runtime.InteropServices.ComVisible(true)] public enum NumberStyles { // Bit flag indicating that leading whitespace is allowed. Character values // 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, and 0x0020 are considered to be diff --git a/src/mscorlib/src/System/Globalization/RegionInfo.cs b/src/mscorlib/src/System/Globalization/RegionInfo.cs index 4bed87570f..b719af7128 100644 --- a/src/mscorlib/src/System/Globalization/RegionInfo.cs +++ b/src/mscorlib/src/System/Globalization/RegionInfo.cs @@ -23,7 +23,6 @@ namespace System.Globalization { using System.Diagnostics.Contracts; [Serializable] - [System.Runtime.InteropServices.ComVisible(true)] public partial class RegionInfo { //--------------------------------------------------------------------// @@ -259,7 +258,6 @@ namespace System.Globalization { // WARNING: You need a full locale name for this to make sense. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public virtual String NativeName { get @@ -329,7 +327,6 @@ namespace System.Globalization { } - [System.Runtime.InteropServices.ComVisible(false)] public virtual int GeoId { get @@ -345,7 +342,6 @@ namespace System.Globalization { // English name for this region's currency, ie: Swiss Franc // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public virtual String CurrencyEnglishName { get @@ -362,7 +358,6 @@ namespace System.Globalization { // WARNING: You need a full locale name for this to make sense. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public virtual String CurrencyNativeName { get diff --git a/src/mscorlib/src/System/Globalization/SortKey.cs b/src/mscorlib/src/System/Globalization/SortKey.cs index 9c35f485e5..7c7408b009 100644 --- a/src/mscorlib/src/System/Globalization/SortKey.cs +++ b/src/mscorlib/src/System/Globalization/SortKey.cs @@ -19,7 +19,6 @@ namespace System.Globalization { using System.Diagnostics; using System.Diagnostics.Contracts; - [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public partial class SortKey { diff --git a/src/mscorlib/src/System/Globalization/StringInfo.cs b/src/mscorlib/src/System/Globalization/StringInfo.cs index d86e11592e..dc32fe9493 100644 --- a/src/mscorlib/src/System/Globalization/StringInfo.cs +++ b/src/mscorlib/src/System/Globalization/StringInfo.cs @@ -16,12 +16,10 @@ namespace System.Globalization { using System; using System.Runtime.Serialization; - using System.Security.Permissions; using System.Diagnostics; using System.Diagnostics.Contracts; [Serializable] - [System.Runtime.InteropServices.ComVisible(true)] public class StringInfo { @@ -57,7 +55,6 @@ namespace System.Globalization { } #endregion Serialization - [System.Runtime.InteropServices.ComVisible(false)] public override bool Equals(Object value) { StringInfo that = value as StringInfo; @@ -68,7 +65,6 @@ namespace System.Globalization { return (false); } - [System.Runtime.InteropServices.ComVisible(false)] public override int GetHashCode() { return this.m_str.GetHashCode(); diff --git a/src/mscorlib/src/System/Globalization/TaiwanCalendar.cs b/src/mscorlib/src/System/Globalization/TaiwanCalendar.cs index 476ddeef7c..ec84a06b76 100644 --- a/src/mscorlib/src/System/Globalization/TaiwanCalendar.cs +++ b/src/mscorlib/src/System/Globalization/TaiwanCalendar.cs @@ -22,7 +22,6 @@ namespace System.Globalization { ============================================================================*/ /* SSS_WARNINGS_ON */ /* SSS_DROP_END */ - [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public class TaiwanCalendar: Calendar { // // The era value for the current era. @@ -62,7 +61,6 @@ namespace System.Globalization { internal static readonly DateTime calendarMinValue = new DateTime(1912, 1, 1); - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MinSupportedDateTime { get @@ -71,7 +69,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MaxSupportedDateTime { get @@ -83,7 +80,6 @@ namespace System.Globalization { // Return the type of the Taiwan calendar. // - [System.Runtime.InteropServices.ComVisible(false)] public override CalendarAlgorithmType AlgorithmType { get @@ -151,7 +147,6 @@ namespace System.Globalization { [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems. - [System.Runtime.InteropServices.ComVisible(false)] public override int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek) { return (helper.GetWeekOfYear(time, rule, firstDayOfWeek)); @@ -186,7 +181,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public override int GetLeapMonth(int year, int era) { return (helper.GetLeapMonth(year, era)); diff --git a/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs b/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs index 049ccf6f81..0fee7a0745 100644 --- a/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs +++ b/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs @@ -23,7 +23,6 @@ namespace System.Globalization { // [Serializable] - [System.Runtime.InteropServices.ComVisible(true)] public class TextElementEnumerator: IEnumerator { private String str; diff --git a/src/mscorlib/src/System/Globalization/TextInfo.cs b/src/mscorlib/src/System/Globalization/TextInfo.cs index c8108e4922..9ece275dd3 100644 --- a/src/mscorlib/src/System/Globalization/TextInfo.cs +++ b/src/mscorlib/src/System/Globalization/TextInfo.cs @@ -23,13 +23,11 @@ namespace System.Globalization { using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Versioning; - using System.Security.Permissions; using System.Diagnostics; using System.Diagnostics.Contracts; [Serializable] - [System.Runtime.InteropServices.ComVisible(true)] public partial class TextInfo : ICloneable, IDeserializationCallback { //--------------------------------------------------------------------// @@ -378,7 +376,6 @@ namespace System.Globalization { //////////////////////////////////////////////////////////////////////// #if FEATURE_USE_LCID - [System.Runtime.InteropServices.ComVisible(false)] public int LCID { get @@ -395,7 +392,6 @@ namespace System.Globalization { // The name of the culture associated with the current TextInfo. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public string CultureName { get @@ -411,7 +407,6 @@ namespace System.Globalization { // Detect if the object is readonly. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public bool IsReadOnly { get { return (m_isReadOnly); } @@ -424,7 +419,6 @@ namespace System.Globalization { // Is the implementation of ICloneable. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public virtual Object Clone() { object o = MemberwiseClone(); @@ -440,7 +434,6 @@ namespace System.Globalization { // readonly. // //////////////////////////////////////////////////////////////////////// - [System.Runtime.InteropServices.ComVisible(false)] public static TextInfo ReadOnly(TextInfo textInfo) { if (textInfo == null) { throw new ArgumentNullException(nameof(textInfo)); } @@ -487,7 +480,6 @@ namespace System.Globalization { return (m_listSeparator); } - [System.Runtime.InteropServices.ComVisible(false)] set { if (value == null) @@ -901,7 +893,6 @@ namespace System.Globalization { // // Returns true if the dominant direction of text and UI such as the relative position of buttons and scroll bars // - [System.Runtime.InteropServices.ComVisible(false)] public bool IsRightToLeft { get diff --git a/src/mscorlib/src/System/Globalization/ThaiBuddhistCalendar.cs b/src/mscorlib/src/System/Globalization/ThaiBuddhistCalendar.cs index e294b51325..762c3ca7cb 100644 --- a/src/mscorlib/src/System/Globalization/ThaiBuddhistCalendar.cs +++ b/src/mscorlib/src/System/Globalization/ThaiBuddhistCalendar.cs @@ -21,7 +21,6 @@ namespace System.Globalization { ============================================================================*/ -[System.Runtime.InteropServices.ComVisible(true)] [Serializable] public class ThaiBuddhistCalendar: Calendar { // Initialize our era info. @@ -40,7 +39,6 @@ namespace System.Globalization { internal GregorianCalendarHelper helper; - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MinSupportedDateTime { get @@ -49,7 +47,6 @@ namespace System.Globalization { } } - [System.Runtime.InteropServices.ComVisible(false)] public override DateTime MaxSupportedDateTime { get @@ -61,7 +58,6 @@ namespace System.Globalization { // Return the type of the Thai Buddhist calendar. // - [System.Runtime.InteropServices.ComVisible(false)] public override CalendarAlgorithmType AlgorithmType { get @@ -123,7 +119,6 @@ namespace System.Globalization { [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems. - [System.Runtime.InteropServices.ComVisible(false)] public override int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek) { return (helper.GetWeekOfYear(time, rule, firstDayOfWeek)); @@ -158,7 +153,6 @@ namespace System.Globalization { // if this calendar does not have leap month, or this year is not a leap year. // - [System.Runtime.InteropServices.ComVisible(false)] public override int GetLeapMonth(int year, int era) { return (helper.GetLeapMonth(year, era)); diff --git a/src/mscorlib/src/System/Globalization/UnicodeCategory.cs b/src/mscorlib/src/System/Globalization/UnicodeCategory.cs index 3848b6142f..c9898f135b 100644 --- a/src/mscorlib/src/System/Globalization/UnicodeCategory.cs +++ b/src/mscorlib/src/System/Globalization/UnicodeCategory.cs @@ -13,7 +13,6 @@ namespace System.Globalization { [Serializable] -[System.Runtime.InteropServices.ComVisible(true)] public enum UnicodeCategory { UppercaseLetter = 0, |