Exemplo n.º 1
0
        /// <summary>
        /// Allows setting all field both for constructors and serialization methods.
        /// </summary>
        private void setAllFields(CurrencyIsoCode isoCode, string englishName, string nativeName, string symbol, int significantDecimalDigits, string decimalSeparator, string groupSeparator, int[] groupSizes, int positivePattern, int negativePattern, bool isObsolete, CharacterReference entity)
        {
            IsoCode                  = isoCode;
            EnglishName              = englishName;
            Symbol                   = symbol;
            AlphabeticCode           = IsoSymbol = isoCode.ToString();
            SignificantDecimalDigits = significantDecimalDigits;
            NativeName               = nativeName;
            DecimalSeparator         = decimalSeparator;
            GroupSeparator           = groupSeparator;
            GroupSizes               = groupSizes;
            PositivePattern          = positivePattern;
            NegativePattern          = negativePattern;
            IsObsolete               = isObsolete;
            Entity                   = entity;

            FormatInfo = NumberFormatInfo.ReadOnly(new NumberFormatInfo
            {
                CurrencySymbol           = symbol,
                CurrencyDecimalDigits    = significantDecimalDigits,
                CurrencyDecimalSeparator = decimalSeparator,
                CurrencyGroupSeparator   = groupSeparator,
                CurrencyGroupSizes       = groupSizes,
                CurrencyPositivePattern  = positivePattern,
                CurrencyNegativePattern  = negativePattern,
                NumberDecimalDigits      = significantDecimalDigits,
                NumberDecimalSeparator   = decimalSeparator,
                NumberGroupSeparator     = groupSeparator,
                NumberGroupSizes         = groupSizes,
                NumberNegativePattern    = negativePattern.TranslateNegativePattern(),
            });
        }
 static CurrencyCharacterReferences()
 {
     _currencyReferences = new Dictionary <string, CharacterReference>(6, StringComparer.OrdinalIgnoreCase)
     {
         { "cent", Cent = new CharacterReference("cent") },
         { "pound", Pound = new CharacterReference("pound") },
         { "curren", Curren = new CharacterReference("curren") },
         { "yen", Yen = new CharacterReference("yen") },
         { "fnof", Fnof = new CharacterReference("fnof") },
         { "euro", Euro = new CharacterReference("euro") }
     };
 }
Exemplo n.º 3
0
        public CurrencyInfo(CurrencyIsoCode code, string englishName, string nativeName, string tokenizedSymbol, int significantDecimalDigits, string decimalSeparator, string groupSeparator, string tokenizedGroupSizes, int positivePattern, int negativePattern, bool obsolete, CharacterReference entity)
        {
            Code        = code;
            EnglishName = englishName;
            NativeName  = nativeName;

            Symbol = Support.UnicodeSymbol.FromTokenizedCodePoints(tokenizedSymbol).Symbol;
            SignificantDecimalDigits = significantDecimalDigits;
            DecimalSeparator         = decimalSeparator;
            GroupSeparator           = groupSeparator;
            GroupSizes      = Support.GroupSizes.FromTokenizedSizes(tokenizedGroupSizes).Sizes;
            PositivePattern = positivePattern;
            NegativePattern = negativePattern;

            Obsolete = obsolete;
            Entity   = entity;
        }
Exemplo n.º 4
0
 private Currency(CurrencyIsoCode isoCode, string englishName, string nativeName, string symbol, int significantDecimalDigits, string decimalSeparator, string groupSeparator, int[] groupSizes, int positivePattern, int negativePattern, bool isObsolete, CharacterReference entity)
 {
     setAllFields(isoCode, englishName, nativeName, symbol, significantDecimalDigits, decimalSeparator, groupSeparator, groupSizes, positivePattern, negativePattern, isObsolete, entity);
 }