/// <summary> /// Appends the value as an additional (unexpected) data-field for the instance. /// Note that for non-repeated sub-objects, this equates to a merge operation; /// for repeated sub-objects this adds a new instance to the set; for simple /// values the new value supercedes the old value. /// </summary> /// <remarks>Note that appending a value does not remove the old value from /// the stream; avoid repeatedly appending values for the same field.</remarks> /// <param name="model">The model to use for configuration.</param> /// <param name="format">The data-format to use when encoding the value.</param> /// <param name="instance">The extensible object to append the value to.</param> /// <param name="tag">The field identifier; the tag should not be defined as a known data-field for the instance.</param> /// <param name="value">The value to append.</param> public static void AppendValue(TypeModel model, IExtensible instance, int tag, DataFormat format, object value) { ExtensibleUtil.AppendExtendValue(model, instance, tag, format, value); }
/// <summary> /// Queries an extensible object for an additional (unexpected) data-field for the instance. /// Each occurrence of the field is yielded separately, making this usage suitable for "repeated" /// (list) fields. /// </summary> /// <remarks>The extended data is processed lazily as the enumerator is iterated.</remarks> /// <param name="model">The model to use for configuration.</param> /// <param name="type">The data-type of the field.</param> /// <param name="instance">The extensible object to obtain the value from.</param> /// <param name="tag">The field identifier; the tag should not be defined as a known data-field for the instance.</param> /// <param name="format">The data-format to use when decoding the value.</param> /// <returns>An enumerator that yields each occurrence of the field.</returns> public static IEnumerable GetValues(TypeModel model, Type type, IExtensible instance, int tag, DataFormat format) { return(ExtensibleUtil.GetExtendedValues(model, type, instance, tag, format, false, false)); }
/// <summary> /// Appends the value as an additional (unexpected) data-field for the instance. /// Note that for non-repeated sub-objects, this equates to a merge operation; /// for repeated sub-objects this adds a new instance to the set; for simple /// values the new value supercedes the old value. /// </summary> /// <remarks>Note that appending a value does not remove the old value from /// the stream; avoid repeatedly appending values for the same field.</remarks> /// <typeparam name="TValue">The data-type of the field.</typeparam> /// <param name="format">The data-format to use when encoding the value.</param> /// <param name="instance">The extensible object to append the value to.</param> /// <param name="tag">The field identifier; the tag should not be defined as a known data-field for the instance.</param> /// <param name="value">The value to append.</param> public static void AppendValue <TValue>(IExtensible instance, int tag, DataFormat format, TValue value) { ExtensibleUtil.AppendExtendValue(RuntimeTypeModel.Default, instance, tag, format, value); }
/// <summary> /// Queries an extensible object for an additional (unexpected) data-field for the instance. /// Each occurrence of the field is yielded separately, making this usage suitable for "repeated" /// (list) fields. /// </summary> /// <remarks>The extended data is processed lazily as the enumerator is iterated.</remarks> /// <typeparam name="TValue">The data-type of the field.</typeparam> /// <param name="instance">The extensible object to obtain the value from.</param> /// <param name="tag">The field identifier; the tag should not be defined as a known data-field for the instance.</param> /// <param name="format">The data-format to use when decoding the value.</param> /// <returns>An enumerator that yields each occurrence of the field.</returns> public static IEnumerable <TValue> GetValues <TValue>(IExtensible instance, int tag, DataFormat format) { return(ExtensibleUtil.GetExtendedValues <TValue>(instance, tag, format, false, false)); }
/// <summary> /// Appends the value as an additional (unexpected) data-field for the instance. /// Note that for non-repeated sub-objects, this equates to a merge operation; /// for repeated sub-objects this adds a new instance to the set; for simple /// values the new value supercedes the old value. /// </summary> /// <remarks>Note that appending a value does not remove the old value from /// the stream; avoid repeatedly appending values for the same field.</remarks> /// <typeparam name="TValue">The data-type of the field.</typeparam> /// <param name="format">The data-format to use when encoding the value.</param> /// <param name="instance">The extensible object to append the value to.</param> /// <param name="tag">The field identifier; the tag should not be defined as a known data-field for the instance.</param> /// <param name="value">The value to append.</param> public static void AppendValue <TValue>(IExtensible instance, int tag, DataFormat format, TValue value) { ExtensibleUtil.AppendExtendValue <TValue>(instance, tag, format, value); }