예제 #1
0
        /// <summary>
        /// Stream constructor.
        /// </summary>
        /// <param name="stream">The stream that contains the DirectorySectorEntry data.</param>
        public DirectorySectorEntry(Stream stream)
        {
            Debug.Assert(stream.Length >= Constants.DIR_ENTRY_SIZE);
            BinaryReader reader = new BinaryReader(stream);

            _name       = Reader.ReadSimpleUnicodeString(reader, 64);
            _nameLength = reader.ReadUInt16();
            if (_nameLength > 0)
            {
                _nameLength /= 2;
                --_nameLength;
                _name = _name.Substring(0, _nameLength);
            }
            else
            {
                _name = "";
            }

            _type            = (Stgty)reader.ReadByte();
            _color           = (DeColor)reader.ReadByte();
            _leftSibling     = new Sid(reader.ReadUInt32());
            _rightSibling    = new Sid(reader.ReadUInt32());
            _child           = new Sid(reader.ReadUInt32());
            _clsId           = new Guid(reader.ReadBytes(16));
            _userFlags       = reader.ReadUInt32();
            _createTimeStamp = reader.ReadUInt64();
            _modifyTimeStamp = reader.ReadUInt64();
            _sectStart       = new Sect(reader.ReadUInt32());
            _size            = reader.ReadUInt32();
            _propType        = reader.ReadUInt16();
            _padding         = reader.ReadUInt16();
        }
		/* private ushort _padding; */

		/// <summary>
		/// Stream constructor.
		/// </summary>
		/// <param name="stream">The stream that contains the DirectorySectorEntry data.</param>
		public DirectorySectorEntry(Stream stream)
		{
			Debug.Assert(stream.Length >= Constants.DIR_ENTRY_SIZE);
			BinaryReader reader = new BinaryReader(stream);

			_name = Reader.ReadSimpleUnicodeString(reader, 64);
			_nameLength = reader.ReadUInt16();
			if(_nameLength > 0)
			{
				_nameLength /= 2;
				--_nameLength;
				_name = _name.Substring(0, _nameLength);
			}
			else
				_name = "";

			_type = (Stgty)reader.ReadByte();
			_color = (DeColor)reader.ReadByte();
			_leftSibling = new Sid(reader.ReadUInt32());
			_rightSibling = new Sid(reader.ReadUInt32());
			_child = new Sid(reader.ReadUInt32());
			_clsId = new Guid(reader.ReadBytes(16));
			_userFlags = reader.ReadUInt32();
			_createTimeStamp = reader.ReadUInt64();
			_modifyTimeStamp = reader.ReadUInt64();
			_sectStart = new Sect(reader.ReadUInt32());
			_size = reader.ReadUInt32();
			_propType = reader.ReadUInt16();
			/* _padding = */ reader.ReadUInt16();
		}
예제 #3
0
 public Ficha(DeColor nuevoColor)
 {
     Color = nuevoColor;
 }
예제 #4
0
 public Ficha(DeColor nuevoColor, int size)
 {
     Color = nuevoColor;
     Size  = size;
 }