Exemplo n.º 1
0
        /// <summary>
        /// Represents this editing operation as a text string.
        /// </summary>
        /// <returns>A string that can be used to save a persistent version of this edit.</returns>
        internal string GetEditString()
        {
            EditSerializer es = new EditSerializer();

            es.WritePersistent <Operation>(DataField.Edit, this);
            return(es.ToSerializedString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Serializes an object as a text string.
        /// </summary>
        /// <typeparam name="T">The type of object being written (as it is known to the instance
        /// that contains it)</typeparam>
        /// <param name="field">The tag that identifies the item.</param>
        /// <param name="value">The object to write (may be null)</param>
        /// <returns>The result of serializing the supplied object</returns>
        internal static string GetSerializedString <T>(DataField field, T value) where T : IPersistent
        {
            EditSerializer es = new EditSerializer();

            es.WritePersistent(field.ToString(), value);
            return(es.ToSerializedString());
        }