Exemplo n.º 1
0
        /// <summary>Deserializes any kind of reference type collection through call-backs
        /// using the default <see cref="Field{T, F}"/> instance registered for that type.</summary>
        /// <typeparam name="T">Type of sequence elements - must be reference type.</typeparam>
        /// <param name="initSequence">Call-back delegate to instantiate/initialize collection.
        /// Returns another delegate to add sequence elements to the collection.</param>
        /// <param name="entry"><see cref="DbEntry"/> instance containing the serialized data.</param>
        public void ObjectsFromDbEntry <T>(InitSequence <T> initSequence, ref DbEntry entry)
            where T : class
        {
            ReferenceField <T, Formatter> field = (ReferenceField <T, Formatter>)GetField <T>();

            ObjectsFromDbEntry(initSequence, ref entry, field);
        }
Exemplo n.º 2
0
        /// <summary>Deserializes any kind of nullable value type collection through call-backs
        /// using the default <see cref="Field{T, F}"/> instance registered for that type.</summary>
        /// <typeparam name="T">Type of sequence elements - must be value type.</typeparam>
        /// <param name="initSequence">Call-back delegate to instantiate/initialize collection.
        /// Returns another delegate to add sequence elements to the collection.</param>
        /// <param name="entry"><see cref="DbEntry"/> instance containing the serialized data.</param>
        public void ValuesFromDbEntry <T>(InitSequence <T?> initSequence, ref DbEntry entry)
            where T : struct
        {
            ValueField <T, Formatter> field = (ValueField <T, Formatter>)GetField <T>();

            ValuesFromDbEntry(initSequence, ref entry, field);
        }
Exemplo n.º 3
0
        /// <summary>Deserializes any kind of reference type collection through call-backs
        /// using a specific <see cref="Field{T, F}"/> instance.</summary>
        /// <typeparam name="T">Type of sequence elements - must be reference type.</typeparam>
        /// <param name="initSequence">Call-back delegate to instantiate/initialize collection.
        /// Returns another delegate to add sequence elements to the collection.</param>
        /// <param name="entry"><see cref="DbEntry"/> instance containing the serialized data.</param>
        /// <param name="field"><see cref="ReferenceField{T, Formatter}"/> instance that
        /// deserializes the <c>entry</c>argument.</param>
        public void ObjectsFromDbEntry <T>(InitSequence <T> initSequence, ref DbEntry entry, ReferenceField <T, Formatter> field)
            where T : class
        {
            int index = entry.Start;

            InitDeserialization(entry.Buffer, index);
            DeserializeObjects(initSequence, field);
            index = FinishDeserialization();
        }
Exemplo n.º 4
0
        /// <summary>Deserializes any kind of nullable value type collection through call-backs
        /// using a specific <see cref="Field{T, F}"/> instance.</summary>
        /// <typeparam name="T">Type of sequence elements - must be value type.</typeparam>
        /// <param name="initSequence">Call-back delegate to instantiate/initialize collection.
        /// Returns another delegate to add sequence elements to the collection.</param>
        /// <param name="entry"><see cref="DbEntry"/> instance containing the serialized data.</param>
        /// <param name="field"><see cref="ValueField{T, Formatter}"/> instance that
        /// deserializes the <c>entry</c>argument.</param>
        public void ValuesFromDbEntry <T>(InitSequence <T?> initSequence, ref DbEntry entry, ValueField <T, Formatter> field)
            where T : struct
        {
            int index = entry.Start;

            InitDeserialization(entry.Buffer, index);
            DeserializeValues(initSequence, field);
            index = FinishDeserialization();
        }