Exemplo n.º 1
0
        internal static ExtractProgressEventArgs ExtractAllCompleted(string archiveName, string extractLocation)
        {
            var x = new ExtractProgressEventArgs(archiveName, ZipProgressEventType.Extracting_AfterExtractAll);

            x._target = extractLocation;
            return(x);
        }
Exemplo n.º 2
0
        internal static ExtractProgressEventArgs ByteUpdate(string archiveName, ZipEntry entry, Int64 bytesWritten, Int64 totalBytes)
        {
            var x = new ExtractProgressEventArgs(archiveName, ZipProgressEventType.Extracting_EntryBytesWritten);

            x.ArchiveName          = archiveName;
            x.CurrentEntry         = entry;
            x.BytesTransferred     = bytesWritten;
            x.TotalBytesToTransfer = totalBytes;
            return(x);
        }
Exemplo n.º 3
0
        internal static ExtractProgressEventArgs AfterExtractEntry(string archiveName, ZipEntry entry, string extractLocation)
        {
            var x = new ExtractProgressEventArgs
            {
                ArchiveName  = archiveName,
                EventType    = ZipProgressEventType.Extracting_AfterExtractEntry,
                CurrentEntry = entry,
                _target      = extractLocation,
            };

            return(x);
        }
Exemplo n.º 4
0
 private void OnExtractAllStarted(string path)
 {
     if (ExtractProgress != null)
     {
         lock (LOCK)
         {
             var e = ExtractProgressEventArgs.ExtractAllStarted(ArchiveNameForEvent,
                                                                path);
             ExtractProgress(this, e);
         }
     }
 }
Exemplo n.º 5
0
        internal static ExtractProgressEventArgs ExtractExisting(string archiveName, ZipEntry entry, string extractLocation)
        {
            var x = new ExtractProgressEventArgs
            {
                ArchiveName  = archiveName,
                EventType    = ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite,
                CurrentEntry = entry,
                _target      = extractLocation,
            };

            return(x);
        }
Exemplo n.º 6
0
 private void OnExtractEntry(int current, bool before, ZipEntry currentEntry, string path)
 {
     if (ExtractProgress != null)
     {
         lock (LOCK)
         {
             var e = new ExtractProgressEventArgs(ArchiveNameForEvent, before, _entries.Count, current, currentEntry, path);
             ExtractProgress(this, e);
             if (e.Cancel)
             {
                 _extractOperationCanceled = true;
             }
         }
     }
 }
Exemplo n.º 7
0
 internal bool OnExtractExisting(ZipEntry entry, string path)
 {
     if (ExtractProgress != null)
     {
         lock (LOCK)
         {
             var e = ExtractProgressEventArgs.ExtractExisting(ArchiveNameForEvent, entry, path);
             ExtractProgress(this, e);
             if (e.Cancel)
             {
                 _extractOperationCanceled = true;
             }
         }
     }
     return(_extractOperationCanceled);
 }
Exemplo n.º 8
0
 // Can be called from within ZipEntry._ExtractOne.
 internal bool OnExtractBlock(ZipEntry entry, Int64 bytesWritten, Int64 totalBytesToWrite)
 {
     if (ExtractProgress != null)
     {
         lock (LOCK)
         {
             var e = ExtractProgressEventArgs.ByteUpdate(ArchiveNameForEvent, entry,
                                                         bytesWritten, totalBytesToWrite);
             ExtractProgress(this, e);
             if (e.Cancel)
             {
                 _extractOperationCanceled = true;
             }
         }
     }
     return(_extractOperationCanceled);
 }
Exemplo n.º 9
0
 // Can be called from within ZipEntry.InternalExtract.
 internal bool OnSingleEntryExtract(ZipEntry entry, string path, bool before)
 {
     if (ExtractProgress != null)
     {
         lock (LOCK)
         {
             var e = (before)
     ? ExtractProgressEventArgs.BeforeExtractEntry(ArchiveNameForEvent, entry, path)
     : ExtractProgressEventArgs.AfterExtractEntry(ArchiveNameForEvent, entry, path);
             ExtractProgress(this, e);
             if (e.Cancel)
             {
                 _extractOperationCanceled = true;
             }
         }
     }
     return(_extractOperationCanceled);
 }
Exemplo n.º 10
0
 internal static ExtractProgressEventArgs ExtractExisting(string archiveName, ZipEntry entry, string extractLocation)
 {
     var x = new ExtractProgressEventArgs
         {
             ArchiveName = archiveName,
             EventType = ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite,
             CurrentEntry = entry,
             _target = extractLocation,
         };
     return x;
 }
Exemplo n.º 11
0
 internal static ExtractProgressEventArgs ExtractAllStarted(string archiveName, string extractLocation)
 {
     var x = new ExtractProgressEventArgs(archiveName, ZipProgressEventType.Extracting_BeforeExtractAll);
     x._target = extractLocation;
     return x;
 }
Exemplo n.º 12
0
 internal static ExtractProgressEventArgs ByteUpdate(string archiveName, ZipEntry entry, Int64 bytesWritten, Int64 totalBytes)
 {
     var x = new ExtractProgressEventArgs(archiveName, ZipProgressEventType.Extracting_EntryBytesWritten);
     x.ArchiveName = archiveName;
     x.CurrentEntry = entry;
     x.BytesTransferred = bytesWritten;
     x.TotalBytesToTransfer = totalBytes;
     return x;
 }
Exemplo n.º 13
0
 internal static ExtractProgressEventArgs BeforeExtractEntry(string archiveName, ZipEntry entry, string extractLocation)
 {
     var x = new ExtractProgressEventArgs
         {
             ArchiveName = archiveName,
             EventType = ZipProgressEventType.Extracting_BeforeExtractEntry,
             CurrentEntry = entry,
             _target = extractLocation,
         };
     return x;
 }
Exemplo n.º 14
0
 private void OnExtractEntry(int current, bool before, ZipEntry currentEntry, string path)
 {
     if (ExtractProgress != null)
     {
         lock (LOCK)
         {
             var e = new ExtractProgressEventArgs(ArchiveNameForEvent, before, _entries.Count, current, currentEntry, path);
             ExtractProgress(this, e);
             if (e.Cancel)
                 _extractOperationCanceled = true;
         }
     }
 }