/// <summary> /// Writes partial data for the container into the specified format. /// </summary> /// <param name="writer">The writer.</param> /// <param name="container">The container.</param> public override void Write(IFormatWriter writer, object container) { using (writer.Section(this.Tag)) { var collection = (ICollection <TElement>) this.GetAction(container); writer.WriteInteger("Length", collection.Count); this.WriteCollection(writer, collection); foreach (TElement element in collection) { using (writer.Section(this.ElementTag)) { this.WriteElement(writer, element); } } } }
/// <summary> /// Writes property for the specified container. /// </summary> /// <param name="writer">The writer.</param> /// <param name="container">The container.</param> public override void Write(IFormatWriter writer, object container) { writer.WriteInteger(this.Tag, (int)this.GetAction(container)); }
/// <summary> /// Writes the specified value. /// </summary> /// <param name="writer">The writer.</param> /// <param name="value">The value.</param> public override void Write(IFormatWriter writer, int value) { writer.WriteInteger("Value", value); }