Beispiel #1
0
        /// <summary>
        /// Loads the data bytes for this element from the file
        /// </summary>
        public void LoadData()
        {
            if (_data != null || _dataSize == 0) return;

            _hfa.Fp.Seek(_dataPos, SeekOrigin.Begin);
            _hfa.Fp.Read(_data, 0, (int)_dataSize);
            _type = _hfa.Dictionary[TypeName];
        }
Beispiel #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dict"></param>
        public void CompleteDefn(HfaDictionary dict)
        {
            // Get a reference to the type object if we have a type name
            // for this field (not a build in).
            if (_itemObjectTypeString != null)
            {
                _itemObjectType = dict[_itemObjectTypeString];
            }
            // Figure out the size
            if (_pointer == 'p')
            {
                _numBytes = -1;
            }
            else if (_itemObjectType != null)
            {
                _itemObjectType.CompleteDefn(dict);
                if (_itemObjectType.NumBytes == -1)
                {
                    _numBytes = -1;
                }
                else
                {
                    _numBytes = (short)(_itemObjectType.NumBytes * _itemCount);
                }
                if (_pointer == '*' && _numBytes != -1) _numBytes += 8;
            }
            else
            {
                _numBytes = (short)(HfaDictionary.GetItemSize(_itemType) * _itemCount);
            }


        }