Esempio n. 1
0
        /// <summary>
        /// Loads a miscellaneous value back from a storage medium (so long as it comes next in the supplied
        /// deserialization stream).
        /// </summary>
        /// <typeparam name="T">The type of value expected by the caller.</typeparam>
        /// <param name="editDeserializer">The mechanism for reading back content.</param>
        /// <param name="field">The tag that identifies the value.</param>
        /// <returns>True if an item was loaded, false if the next item in the deserialization
        /// stream does not have the specified name.</returns>
        internal bool ReadItem <T>(EditDeserializer editDeserializer, DataField field) where T : IConvertible
        {
            if (editDeserializer.IsNextField(field))
            {
                T result = editDeserializer.ReadValue <T>(field);
                Add(new UpdateItem(field, result));
                return(true);
            }

            return(false);
        }