本文整理汇总了C#中System.Globalization.CultureData.YearMonths方法的典型用法代码示例。如果您正苦于以下问题:C# CultureData.YearMonths方法的具体用法?C# CultureData.YearMonths怎么用?C# CultureData.YearMonths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Globalization.CultureData
的用法示例。
在下文中一共展示了CultureData.YearMonths方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeOverridableProperties
private void InitializeOverridableProperties(CultureData cultureData, CalendarId calendarId)
{
Contract.Requires(cultureData != null);
Contract.Assert(calendarId != CalendarId.UNINITIALIZED_VALUE, "[DateTimeFormatInfo.Populate] Expected initalized calendarId");
if (this.firstDayOfWeek == -1) { this.firstDayOfWeek = cultureData.IFIRSTDAYOFWEEK; }
if (this.calendarWeekRule == -1) { this.calendarWeekRule = cultureData.IFIRSTWEEKOFYEAR; }
if (this.amDesignator == null) { this.amDesignator = cultureData.SAM1159; }
if (this.pmDesignator == null) { this.pmDesignator = cultureData.SPM2359; }
if (this.timeSeparator == null) { this.timeSeparator = cultureData.TimeSeparator; }
if (this.dateSeparator == null) { this.dateSeparator = cultureData.DateSeparator(calendarId); }
this.allLongTimePatterns = _cultureData.LongTimes;
Contract.Assert(this.allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns");
this.allShortTimePatterns = _cultureData.ShortTimes;
Contract.Assert(this.allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns");
this.allLongDatePatterns = cultureData.LongDates(calendarId);
Contract.Assert(this.allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns");
this.allShortDatePatterns = cultureData.ShortDates(calendarId);
Contract.Assert(this.allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns");
_allYearMonthPatterns = cultureData.YearMonths(calendarId);
Contract.Assert(_allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns");
}
示例2: InitializeOverridableProperties
private void InitializeOverridableProperties(CultureData cultureData, int calendarID)
{
#if !FEATURE_CORECLR
// Silverlight 2.0 never took a snapshot of the user's overridable properties
// This has a substantial performance impact so skip when CoreCLR
Contract.Requires(cultureData != null);
Contract.Assert(calendarID > 0, "[DateTimeFormatInfo.Populate] Expected Calendar.ID > 0");
if (this.firstDayOfWeek == -1) { this.firstDayOfWeek = cultureData.IFIRSTDAYOFWEEK; }
if (this.calendarWeekRule == -1) { this.calendarWeekRule = cultureData.IFIRSTWEEKOFYEAR; }
if (this.amDesignator == null) { this.amDesignator = cultureData.SAM1159; }
if (this.pmDesignator == null) { this.pmDesignator = cultureData.SPM2359; }
if (this.timeSeparator == null) { this.timeSeparator = cultureData.TimeSeparator; }
if (this.dateSeparator == null) { this.dateSeparator = cultureData.DateSeparator(calendarID); }
this.allLongTimePatterns = this.m_cultureData.LongTimes;
Contract.Assert(this.allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns");
this.allShortTimePatterns = this.m_cultureData.ShortTimes;
Contract.Assert(this.allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns");
this.allLongDatePatterns = cultureData.LongDates(calendarID);
Contract.Assert(this.allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns");
this.allShortDatePatterns = cultureData.ShortDates(calendarID);
Contract.Assert(this.allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns");
this.allYearMonthPatterns = cultureData.YearMonths(calendarID);
Contract.Assert(this.allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns");
#endif
}
示例3: InitializeOverridableProperties
private void InitializeOverridableProperties(CultureData cultureData, int calendarID)
{
if (this.firstDayOfWeek == -1)
this.firstDayOfWeek = cultureData.IFIRSTDAYOFWEEK;
if (this.calendarWeekRule == -1)
this.calendarWeekRule = cultureData.IFIRSTWEEKOFYEAR;
if (this.amDesignator == null)
this.amDesignator = cultureData.SAM1159;
if (this.pmDesignator == null)
this.pmDesignator = cultureData.SPM2359;
if (this.timeSeparator == null)
this.timeSeparator = cultureData.TimeSeparator;
if (this.dateSeparator == null)
this.dateSeparator = cultureData.DateSeparator(calendarID);
this.allLongTimePatterns = this.m_cultureData.LongTimes;
this.allShortTimePatterns = this.m_cultureData.ShortTimes;
this.allLongDatePatterns = cultureData.LongDates(calendarID);
this.allShortDatePatterns = cultureData.ShortDates(calendarID);
this.allYearMonthPatterns = cultureData.YearMonths(calendarID);
}