Exemple #1
0
        /// <summary>
        /// Reads information directly into instanced object <paramref name="value"/> through <see cref="VersionedReaders"/>.
        /// </summary>
        public void ReadT <T>(T value)
        {
            Type type = typeof(T);

            if (VersionedReaders == null)
            {
                throw ExceptionHelper.Invalid(nameof(VersionedReaders), InvalidType.isNull);
            }
            if (TypeMapper != null && VersionedReaders.ReadType(type))
            {
                type = ReadType();
            }

            VersionedReaders.Read(type, this, value);
        }
Exemple #2
0
        /// <summary>
        /// Reads information to create an object of type <typeparamref name="T"/> through <see cref="VersionedReaders"/>.
        /// </summary>
        public T ReadT <T>()
        {
            Type type = typeof(T);

            if (VersionedReaders == null)
            {
                throw ExceptionHelper.Invalid(nameof(VersionedReaders), InvalidType.isNull);
            }
            if (TypeMapper != null && VersionedReaders.ReadType(type))
            {
                type = ReadType();
            }

            return((T)VersionedReaders.Read(type, this));
        }