Information about a single column
Inheritance: IInflatable, IDeflatable
        /// <summary>
        /// Inflate the token
        /// NOTE: This operation is not continuable and assumes that the entire token is available in the stream
        /// </summary>
        /// <param name="source">Stream to inflate the token from</param>
        /// <returns>TRUE if inflation is complete</returns>
        public override bool Inflate(Stream source)
        {
            // Re-prepare collection
            Columns = new List <TDSColumnProperty>();

            // Read the length of the data
            ushort length = TDSUtilities.ReadUShort(source);

            // Current offset in the stream
            ushort offset = 0;

            // Inflate each property
            while (offset < length)
            {
                // Allocate a new property
                TDSColumnProperty newColumn = new TDSColumnProperty();

                // Inflate
                newColumn.Inflate(source);

                // Register with the collection
                Columns.Add(newColumn);

                // Update offset with the size of the last inflated property
                offset += (ushort)newColumn.InflationSize;
            }

            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// Inflate the token
        /// NOTE: This operation is not continuable and assumes that the entire token is available in the stream
        /// </summary>
        /// <param name="source">Stream to inflate the token from</param>
        /// <returns>TRUE if inflation is complete</returns>
        public override bool Inflate(Stream source)
        {
            // Re-prepare collection
            Columns = new List<TDSColumnProperty>();

            // Read the length of the data
            ushort length = TDSUtilities.ReadUShort(source);

            // Current offset in the stream
            ushort offset = 0;

            // Inflate each property
            while (offset < length)
            {
                // Allocate a new property
                TDSColumnProperty newColumn = new TDSColumnProperty();

                // Inflate
                newColumn.Inflate(source);

                // Register with the collection
                Columns.Add(newColumn);

                // Update offset with the size of the last inflated property
                offset += (ushort)newColumn.InflationSize;
            }

            return true;
        }