DosTimeToDateTime() static private méthode

static private DosTimeToDateTime ( uint dateTime ) : DateTime
dateTime uint
Résultat DateTime
Exemple #1
0
 internal ZipArchiveEntry(ZipArchive archive, ZipCentralDirectoryFileHeader cd)
 {
     this._archive                      = archive;
     this._originallyInArchive          = true;
     this._diskNumberStart              = cd.DiskNumberStart;
     this._versionToExtract             = (ZipVersionNeededValues)cd.VersionNeededToExtract;
     this._generalPurposeBitFlag        = (ZipArchiveEntry.BitFlagValues)cd.GeneralPurposeBitFlag;
     this.CompressionMethod             = (ZipArchiveEntry.CompressionMethodValues)cd.CompressionMethod;
     this._lastModified                 = new DateTimeOffset(ZipHelper.DosTimeToDateTime(cd.LastModified));
     this._compressedSize               = cd.CompressedSize;
     this._uncompressedSize             = cd.UncompressedSize;
     this._externalFileAttr             = cd.ExternalFileAttributes;
     this._offsetOfLocalHeader          = cd.RelativeOffsetOfLocalHeader;
     this._storedOffsetOfCompressedData = null;
     this._crc32                  = cd.Crc32;
     this._compressedBytes        = null;
     this._storedUncompressedData = null;
     this._currentlyOpenForWrite  = false;
     this._everOpenedForWrite     = false;
     this._outstandingWriteStream = null;
     this.FullName                = this.DecodeEntryName(cd.Filename);
     this._lhUnknownExtraFields   = null;
     this._cdUnknownExtraFields   = cd.ExtraFields;
     this._fileComment            = cd.FileComment;
     this._compressionLevel       = null;
 }
Exemple #2
0
        // Initializes, attaches it to archive
        internal ZipArchiveEntry(ZipArchive archive, ZipCentralDirectoryFileHeader cd)
        {
            _archive = archive;

            _originallyInArchive = true;

            _diskNumberStart            = cd.DiskNumberStart;
            _versionMadeByPlatform      = (ZipVersionMadeByPlatform)cd.VersionMadeByCompatibility;
            _versionMadeBySpecification = (ZipVersionNeededValues)cd.VersionMadeBySpecification;
            _versionToExtract           = (ZipVersionNeededValues)cd.VersionNeededToExtract;
            _generalPurposeBitFlag      = (BitFlagValues)cd.GeneralPurposeBitFlag;
            CompressionMethod           = (CompressionMethodValues)cd.CompressionMethod;
            _lastModified        = new DateTimeOffset(ZipHelper.DosTimeToDateTime(cd.LastModified));
            _compressedSize      = cd.CompressedSize;
            _uncompressedSize    = cd.UncompressedSize;
            _externalFileAttr    = cd.ExternalFileAttributes;
            _offsetOfLocalHeader = cd.RelativeOffsetOfLocalHeader;
            // we don't know this yet: should be _offsetOfLocalHeader + 30 + _storedEntryNameBytes.Length + extrafieldlength
            // but entryname/extra length could be different in LH
            _storedOffsetOfCompressedData = null;
            _crc32 = cd.Crc32;

            _compressedBytes        = null;
            _storedUncompressedData = null;
            _currentlyOpenForWrite  = false;
            _everOpenedForWrite     = false;
            _outstandingWriteStream = null;

            FullName = DecodeEntryName(cd.Filename);

            _lhUnknownExtraFields = null;
            // the cd should have these as null if we aren't in Update mode
            _cdUnknownExtraFields = cd.ExtraFields;
            _fileComment          = cd.FileComment;

            _compressionLevel = null;
        }