当前位置: 首页>>代码示例>>C#>>正文


C# CultureData.LongDates方法代码示例

本文整理汇总了C#中System.Globalization.CultureData.LongDates方法的典型用法代码示例。如果您正苦于以下问题:C# CultureData.LongDates方法的具体用法?C# CultureData.LongDates怎么用?C# CultureData.LongDates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Globalization.CultureData的用法示例。


在下文中一共展示了CultureData.LongDates方法的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");
        }
开发者ID:kyulee1,项目名称:corert,代码行数:28,代码来源:DateTimeFormatInfo.cs

示例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
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:32,代码来源:DateTimeFormatInfo.cs

示例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);
 }
开发者ID:korifey,项目名称:hackathon-Ideaphone,代码行数:20,代码来源:DateTimeFormatInfo.cs


注:本文中的System.Globalization.CultureData.LongDates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。