private static string getValue(PluralRules.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); }
public CustomPluralRuleProvider(PluralRules.PluralRuleDelegate pluralRule) { this.pluralRule = pluralRule; }
public TimeTextInfo(PluralRules.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; }