diff options
Diffstat (limited to 'src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs')
-rw-r--r-- | src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs | 24 |
1 files changed, 2 insertions, 22 deletions
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; |