Beispiel #1
0
        /* ================================================================================================== */
        /// <summary>
        /// Создает новый объект с клонированием содержимого с установкой новой длины размерности элемента.
        /// </summary>
        /// <param name="elementSize">Размерность элемента.</param>
        /// <returns></returns>
        public BitOffsetPosition Clone(BytesInElement elementSize)
        {
            BitOffsetPosition result = new BitOffsetPosition(elementSize);

            result.TotalBitOffset = this.TotalBitOffset;
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Клонирует содержимое внешнего объекта в текущий объект.
        /// </summary>
        /// <param name="position"></param>
        public void CloneFrom(BitOffsetPosition position)
        {
            if (position == null)
            {
                throw new ArgumentNullException("Method='CloneFrom', Parameter='position', can not be Null.", "position");
            }

            this.TotalBitOffset = position.TotalBitOffset;
            this.ElementSize    = position.ElementSize;
        }
        /* ================================================================================================== */
        #endregion

        /// Создает новое описание типа на основании значения кода и размера.
        /// </summary>
        /// <param name="code">Значение кода типа данных.</param>
        public TagDataTypeDefinition(UInt16 code)
        {
            this.Code             = code;
            this.ArrayDimension   = new ArrayDefinition();
            this._ElementSize     = 0;
            this.HiddenMemberName = null;

            this.AtomicBitDefinition = null;
            this.StructureDefinition = null;
            this.BitArrayDefinition  = null;
        }
        /* ================================================================================================== */
        /// <summary>
        /// Производит сброс состояния содержимого объекта в первоначальное состояние.
        /// </summary>
        public void Init()
        {
            this.Code         = 0;
            this._ElementSize = 0;
            this._Name        = null;

            this.ArrayDimension.Init();
            this.HiddenMemberName    = null;
            this.AtomicBitDefinition = null;
            this.StructureDefinition = null;
            this.BitArrayDefinition  = null;
        }