コード例 #1
0
        private void ShowMessage(string message, string  caption)
        {
            if (MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                Process.Start("explorer.exe", saveDirectory);

                FileWorkDoneEventArgs props = new FileWorkDoneEventArgs(false, true);
                FileWorkDone(this, props);
                this.Close();
            }
            else
            {
                FileWorkDoneEventArgs props = new FileWorkDoneEventArgs(false, true);
                FileWorkDone(this, props);
                this.Close();
            }
        }
コード例 #2
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            groupBoxSplitProgress.Visible = false; SlideFormUpDown(1);
            DialogResult res = MessageBox.Show("Splitting of Files Done and MetaFile Generated.\n Press \"OK\" to go to the folder where files have been generated.\n Press \"Cancel\" to go to Main Form. ", "SPLITTING DONE!", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (res == System.Windows.Forms.DialogResult.Cancel)
            { FileWorkDoneEventArgs props = new FileWorkDoneEventArgs(true, false);
              FileWorkDone(this, props);
              this.Close();
            }
            else if (res == System.Windows.Forms.DialogResult.OK)
            {
                string path = fileToSplit.FileSavePath;
                Process.Start("explorer.exe", path.Substring(0, path.LastIndexOf('\\')));

                FileWorkDoneEventArgs props = new FileWorkDoneEventArgs(true, false);
                FileWorkDone(this, props);
                this.Close();
            }
        }
コード例 #3
0
        private void backgroundWorkerJoin_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            switch (joinStatus)
            {
                case 1: // Join Operation Cancelled
                    {

                        if (File.Exists(fileToSplit.OrigFileFullSavePath)) File.Delete(fileToSplit.OrigFileFullSavePath);
                        FileWorkDoneEventArgs props = new FileWorkDoneEventArgs(false, true);
                        FileWorkDone(this, props);
                        this.Close();
                        break;
                    }
                case 2: // Hash Check Cancelled
                    {
                        ShowMessage("File Integrity Check Has Been Cancelled. \n\nPress \"Yes\" to go to the folder where the Original File has been created\nand \"No\" to return to the Main Form. ", "Integrity Check Cancelled");
                        break;
                    }
                case 3: // Hash Check Failed
                    {
                        ShowMessage("The File integrity check has failed. The File created may not work correctly.\n\n Press \"Yes\" to go to the folder where the Original File has been generated.\n Press \"No\" to go to Main Form.  ", "Integrity Check Failed");
                        break;
                    }
                case 0: // Success
                    {
                        ShowMessage("File Integrity has been verified. File checksums match.\n\nPress \"Yes\" to go to the folder where the Original File has been created\nand \"No\" to return to the Main Form. ", "Integrity Verified");
                        break;
                    }
                case 4: // Success w/o Hash Check
                    {
                        ShowMessage("Joining of Files Done and Original File Generated.\n\nPress \"Yes\" to go to the folder where the Original File has been created\nand \"No\" to return to the Main Form. ", "Joining Complete");
                        break;
                    }
            }
        }
コード例 #4
0
        private void backgroundWorkerSplit_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (IsSplitCancelled == false)
            {
                if (!IsFolder) { fileToSplit.GenerateMetaFile(); fileToSplit.IsFinished = true; }
                buttonOK.Enabled = true; buttonCancel.Enabled = false;
            }
            else if (IsSplitCancelled == true)
            {
                int i = 0; string ext1, ext2;
                /*DialogResult res = MessageBox.Show("Split Operation Cancelled!\n\nDo you want to delete the partially created split files ?", "OPERATION CANCELLED", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (res == System.Windows.Forms.DialogResult.Yes)
                {   */
                if (!IsFolder) { ext1 = ".vip"; ext2 = ".vipmeta"; } else { ext1 = ".vipf"; ext2 = ".vipfmeta"; }

                    while (File.Exists(fileToSplit.FileSavePath + ext1 + i.ToString())) { File.Delete(fileToSplit.FileSavePath + ext1 + i.ToString()); i++; }
                    if (File.Exists(fileToSplit.FileSavePath + ext2)) { File.Delete(fileToSplit.FileSavePath + ext2); }
                   /* MessageBox.Show("Partially Split Files Deleted!", "Files Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }*/
                FileWorkDoneEventArgs props = new FileWorkDoneEventArgs(false, true);
                FileWorkDone(this, props);
                this.Close();
            }
            IsSplitCancelled = false;
        }
コード例 #5
0
 protected override void OnClosing(CancelEventArgs e)
 {
     if (!IsFolder)
     {
         FileWorkDoneEventArgs props = new FileWorkDoneEventArgs(false, true);
         FileWorkDone(this, props);
     }
     else FolderWorkDone(this, null);
     base.OnClosing(e);
 }