Exemple #1
0
        private void SetBinaryDateRecord(byte year, byte month, byte dayOfMonth, byte hour, byte minute, byte second)
        {
            if (BinaryDateRecord == null)
            {
                BinaryDateRecord = new BinaryDateRecord();
            }

            BinaryDateRecord.Year       = year;
            BinaryDateRecord.Month      = month;
            BinaryDateRecord.DayOfMonth = dayOfMonth;
            BinaryDateRecord.Hour       = hour;
            BinaryDateRecord.Minute     = minute;
            BinaryDateRecord.Second     = second;
        }
Exemple #2
0
        private void SetDirectoryRecord(UInt64 extentLocation, UInt64 dataLength, BinaryDateRecord date, sbyte timeZone, byte fileFlags, byte[] fileIdentifier)
        {
            if (m_record == null)
            {
                m_record = new DirectoryRecord();
            }

            m_record.ExtentLocation = extentLocation;
            m_record.DataLength     = dataLength;

            m_record.Date = date;

            m_record.TimeZone  = timeZone;
            m_record.FileFlags = fileFlags;

            m_record.LengthOfFileIdentifier = (byte)fileIdentifier.Length;
            m_record.FileIdentifier         = fileIdentifier;

            m_record.Length = (byte)(m_record.LengthOfFileIdentifier + 33);
            if (m_record.Length % 2 == 1)
            {
                m_record.Length++;
            }

            if (fileIdentifier.Length > 255 ||
                m_record.LengthOfFileIdentifier + 33 > 255)
            {
                throw new Exception("Depasire!");
            }

            if (m_volumeDescriptorType == VolumeType.Suplementary &&
                ((fileFlags & 2) == 0 ||
                 fileIdentifier.Length != 1 || fileIdentifier[0] > 1))
            {
                m_volumeDescriptorType    = VolumeType.Primary;
                this.VolumeDescriptorType = VolumeType.Suplementary;
            }
        }
Exemple #3
0
 public DateWrapper(BinaryDateRecord dateRecord)
 {
     BinaryDateRecord = dateRecord;
     SetAsciiDateRecord(1900 + dateRecord.Year, dateRecord.Month, dateRecord.DayOfMonth, dateRecord.Hour, dateRecord.Minute, dateRecord.Second, 0, 8);
     m_date = new DateTime(1900 + dateRecord.Year, dateRecord.Month, dateRecord.DayOfMonth, dateRecord.Hour, dateRecord.Minute, dateRecord.Second);
 }