Esempio n. 1
0
        internal override void Serialize(FRWriter writer, string prefix, FormatBase format)
        {
            base.Serialize(writer, prefix, format);
            NumberFormat c = format as NumberFormat;

            if (c == null || UseLocale != c.UseLocale)
            {
                writer.WriteBool(prefix + "UseLocale", UseLocale);
            }
            if (!UseLocale)
            {
                if (c == null || DecimalDigits != c.DecimalDigits)
                {
                    writer.WriteInt(prefix + "DecimalDigits", DecimalDigits);
                }
                if (c == null || DecimalSeparator != c.DecimalSeparator)
                {
                    writer.WriteStr(prefix + "DecimalSeparator", DecimalSeparator);
                }
                if (c == null || GroupSeparator != c.GroupSeparator)
                {
                    writer.WriteStr(prefix + "GroupSeparator", GroupSeparator);
                }
                if (c == null || NegativePattern != c.NegativePattern)
                {
                    writer.WriteInt(prefix + "NegativePattern", NegativePattern);
                }
            }
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public override bool Equals(object obj)
        {
            NumberFormat f = obj as NumberFormat;

            return(f != null &&
                   UseLocale == f.UseLocale &&
                   DecimalDigits == f.DecimalDigits &&
                   DecimalSeparator == f.DecimalSeparator &&
                   GroupSeparator == f.GroupSeparator &&
                   NegativePattern == f.NegativePattern);
        }
Esempio n. 3
0
        /// <inheritdoc/>
        public override FormatBase Clone()
        {
            NumberFormat result = new NumberFormat();

            result.UseLocale        = UseLocale;
            result.DecimalDigits    = DecimalDigits;
            result.DecimalSeparator = DecimalSeparator;
            result.GroupSeparator   = GroupSeparator;
            result.NegativePattern  = NegativePattern;
            return(result);
        }