コード例 #1
0
        /// <summary>
        /// Writes a miscellaneous value to a storage medium if the item is present as part of this collection.
        /// </summary>
        /// <typeparam name="T">The type of value being written (as it is known to the edit
        /// that contains it)</typeparam>
        /// <param name="editSerializer">The mechanism for storing content.</param>
        /// <param name="field">The tag that identifies the item.</param>
        /// <returns>True if an item was written, false if the item with the specific name is not present
        /// in this collection.</returns>
        internal bool WriteItem <T>(EditSerializer editSerializer, DataField field) where T : IConvertible
        {
            UpdateItem item;

            if (m_Changes.TryGetValue(field, out item))
            {
                editSerializer.WriteValue <T>(field, (T)item.Value);
                return(true);
            }

            return(false);
        }