Exemplo n.º 1
0
            /// <summary>
            /// Thread of execution to perform a task
            /// </summary>
            private void PerformTask()
            {
                lock (this._lock)
                {
                    while (this._bufferQueue.Count != 0)
                    {
                        // Perform task
                        BufferedTask task = this._bufferQueue.Dequeue();
                        this._owner = task.Owner;
                        Compression7z cmp = new Compression7z();
                        cmp.OnComplete += new Compression7z.ProcessEventHandler(cmp_OnComplete);
                        if (task.Compress)
                        {
                            cmp.CompressFiles(true, task.Files[0], Compression7z.Type._7z, Compression7z.Compression.Ultra, task.Files, null, this._fileSecurityPassword);
                        }
                        else
                        {
                            cmp.ExtractFile(true, task.Files[0], Compression7z.Type._7z, Compression7z.Compression.Ultra, this._fileSecurityPassword);
                        }

                        // Dispose directory
                        task.Directory.Dispose();
                    }
                }
            }
Exemplo n.º 2
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         Compression7z cmp7z = new Compression7z();
         cmp7z.OnComplete += new Compression7z.ProcessEventHandler(cmp7z_OnComplete);
         if (this._ddir != null)
         {
             this._ddir.Dispose();
             this._ddir = null;
         }
         this._ddir = new DisposableDirectory();
         this.progressBarLoading.Visible = true;
         cmp7z.ExtractFile(false, this.openFileDialog1.FileName, this._ddir.DirectoryPath, Compression7z.Type._7z, Compression7z.Compression.Ultra, null);
     }
 }
Exemplo n.º 3
0
            private void PerformTask()
            {
                lock (this._lock)
                {
                    while (this._bufferQueue.Count != 0)
                    {
                        BufferedTask task = this._bufferQueue.Dequeue();
                        this._owner = task.Owner;
                        Compression7z cmp = new Compression7z(true);
                        cmp.OnComplete += new Compression7z.ProcessEventHandler(cmp_OnComplete);
                        if(task.Compress)
                            cmp.CompressFiles(true, task.Files[0], Compression7z.Type._7z, Compression7z.Compression.Ultra, task.Files, null, "h4x0r");
                        else
                            cmp.ExtractFile(true, task.Files[0], Compression7z.Type._7z, Compression7z.Compression.Ultra, "h4x0r");

                        task.Directory.Dispose();
                    }
                }
            }
Exemplo n.º 4
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         Compression7z cmp7z = new Compression7z();
         cmp7z.OnComplete += new Compression7z.ProcessEventHandler(cmp7z_OnComplete);
         if (this._ddir != null)
         {
             this._ddir.Dispose();
             this._ddir = null;
         }
         this._ddir = new DisposableDirectory();
         this.progressBarLoading.Visible = true;
         cmp7z.ExtractFile(false, this.openFileDialog1.FileName, this._ddir.DirectoryPath, Compression7z.Type._7z, Compression7z.Compression.Ultra, null);
     }
 }