DateSeparator() private method

private DateSeparator ( int calendarId ) : String
calendarId int
return String
コード例 #1
0
ファイル: DateTimeFormatInfo.cs プロジェクト: kyulee1/corert
        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
0
        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
0
 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);
 }