Exemple #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 (c == null || DecimalDigits != c.DecimalDigits)
            {
                writer.WriteInt(prefix + "DecimalDigits", DecimalDigits);
            }

            if (!UseLocale)
            {
                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);
                }
            }
        }
Exemple #2
0
 internal virtual void Serialize(FRWriter writer, string prefix, FormatBase format)
 {
     if (format.GetType() != GetType())
     {
         writer.WriteStr("Format", Name);
     }
 }
Exemple #3
0
 /// <summary>
 /// Removes the specified object from the collection.
 /// </summary>
 /// <param name="value">Object to remove.</param>
 public void Remove(FormatBase value)
 {
     if (Contains(value))
     {
         List.Remove(value);
     }
 }
Exemple #4
0
 /// <summary>
 /// Inserts an object into this collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="value">The object to insert.</param>
 public void Insert(int index, FormatBase value)
 {
     if (value != null)
     {
         List.Insert(index, value);
     }
 }
Exemple #5
0
 /// <summary>
 /// Adds an object to the end of this collection.
 /// </summary>
 /// <param name="value">Object to add.</param>
 /// <returns>Index of the added object.</returns>
 public int Add(FormatBase value)
 {
     if (value == null)
     {
         return(-1);
     }
     return(List.Add(value));
 }
Exemple #6
0
 /// <inheritdoc/>
 public void Deserialize(FRReader reader)
 {
     Clear();
     while (reader.NextItem())
     {
         FormatBase format = reader.Read() as FormatBase;
         Add(format);
     }
 }
Exemple #7
0
        internal override void Serialize(FRWriter writer, string prefix, FormatBase format)
        {
            base.Serialize(writer, prefix, format);
            CustomFormat c = format as CustomFormat;

            if (c == null || Format != c.Format)
            {
                writer.WriteStr(prefix + "Format", Format);
            }
        }
Exemple #8
0
        internal override void Serialize(FRWriter writer, string prefix, FormatBase format)
        {
            base.Serialize(writer, prefix, format);
            BooleanFormat c = format as BooleanFormat;

            if (c == null || TrueText != c.TrueText)
            {
                writer.WriteStr(prefix + "TrueText", TrueText);
            }
            if (c == null || FalseText != c.FalseText)
            {
                writer.WriteStr(prefix + "FalseText", FalseText);
            }
        }
Exemple #9
0
 /// <summary>
 /// Determines whether an element is in the collection.
 /// </summary>
 /// <param name="value">The object to locate in the collection.</param>
 /// <returns><b>true</b> if object is found in the collection; otherwise, <b>false</b>.</returns>
 public bool Contains(FormatBase value)
 {
     return(List.Contains(value));
 }
Exemple #10
0
 /// <summary>
 /// Returns the zero-based index of the first occurrence of an object.
 /// </summary>
 /// <param name="value">The object to locate in the collection.</param>
 /// <returns>The zero-based index of the first occurrence of value within the entire collection, if found;
 /// otherwise, -1.</returns>
 public int IndexOf(FormatBase value)
 {
     return(List.IndexOf(value));
 }