コード例 #1
0
        public override PluralForm SelectPluralForm(decimal number, PluralForm availablePluralForms)
        {
            if (availablePluralForms.HasBitMask(PluralForm.ExplicitZero))
            {
                if (ExplicitZeroRule.AppliesTo(number))
                {
                    return(ExplicitZeroRule.PluralForm);
                }
            }
            else if (!hasZeroForm && availablePluralForms.HasBitMask(PluralForm.Zero))
            {
                if (ExplicitZeroRule.AppliesTo(number))
                {
                    return(PluralForm.Zero);
                }
            }

            if (availablePluralForms.HasBitMask(PluralForm.ExplicitOne))
            {
                if (ExplicitOneRule.AppliesTo(number))
                {
                    return(ExplicitOneRule.PluralForm);
                }
            }
            else if (!hasOneForm && availablePluralForms.HasBitMask(PluralForm.One))
            {
                if (ExplicitOneRule.AppliesTo(number))
                {
                    return(PluralForm.One);
                }
            }

            return(base.SelectPluralForm(number, availablePluralForms));
        }