Exemplo n.º 1
0
        private static string getValue(PluralFormatInfo.PluralRuleDelegate pluralRule, int value, string[] units)
        {
            // Get the plural index from the plural rule,
            // unless there's only 1 unit in the first place:
            var pluralIndex = (units.Length == 1) ? 0 : pluralRule(value, units.Length);

            return(string.Format(units[pluralIndex], value));
        }
Exemplo n.º 2
0
 public TimeTextInfo(string week, string day, string hour, string minute, string second, string millisecond, string lessThan)
 {
     // Always use singular:
     this.PluralRule  = (d, c) => 0;
     this.week        = new[] { week };
     this.day         = new[] { day };
     this.hour        = new[] { hour };
     this.minute      = new[] { minute };
     this.second      = new[] { second };
     this.millisecond = new[] { millisecond };
     this.lessThan    = lessThan;
 }
Exemplo n.º 3
0
        public TimeTextInfo(PluralFormatInfo.PluralRuleDelegate pluralRule, string[] week, string[] day, string[] hour, string[] minute, string[] second, string[] millisecond, string[] w, string[] d, string[] h, string[] m, string[] s, string[] ms, string lessThan)
        {
            this.PluralRule = pluralRule;

            this.week        = week;
            this.day         = day;
            this.hour        = hour;
            this.minute      = minute;
            this.second      = second;
            this.millisecond = millisecond;

            this.w  = w;
            this.d  = d;
            this.h  = h;
            this.m  = m;
            this.s  = s;
            this.ms = ms;

            this.lessThan = lessThan;
        }
Exemplo n.º 4
0
 public TimeTextInfo(string week, string day, string hour, string minute, string second, string millisecond, string lessThan)
 {
     // Always use singular:
     this.PluralRule = (d, c) => 0;
     this.week = new[] { week };
     this.day = new[] { day };
     this.hour = new[] { hour };
     this.minute = new[] { minute };
     this.second = new[] { second };
     this.millisecond = new[] { millisecond };
     this.lessThan = lessThan;
 }
Exemplo n.º 5
0
        public TimeTextInfo(PluralFormatInfo.PluralRuleDelegate pluralRule, string[] week, string[] day, string[] hour, string[] minute, string[] second, string[] millisecond, string[] w, string[] d, string[] h, string[] m, string[] s, string[] ms, string lessThan)
        {
            this.PluralRule = pluralRule;
            
            this.week = week;
            this.day = day;
            this.hour = hour;
            this.minute = minute;
            this.second = second;
            this.millisecond = millisecond;

            this.w = w;
            this.d = d;
            this.h = h;
            this.m = m;
            this.s = s;
            this.ms = ms;

            this.lessThan = lessThan;
        }