public FilterSeqs(string fpath, int sMin, SNPfreq_form formObject) { folderPath = fpath; filePath = fpath + "\\snpTaggedSeqs.txt"; snpMin = sMin; formObj = formObject; }
/// <summary> /// This method verifies if a file exists already. If it does, it asks the user /// if it should be overwritten. If not, it gives the user an opportunity to rename the old file. /// </summary> /// <param name="pathToFile">Path to the file</param> /// <param name="fileDescriptor">The type of file (masked sequence, filtered, result, gene list)</param> /// <param name="outputFolder">Output folder path</param> /// <param name="formObject">Form object</param> public int verifyFileExistence(string pathToFile, string fileDescriptor, string outputFolder, SNPfreq_form formObject) { if (File.Exists(pathToFile)) { DialogResult result; result = MessageBox.Show("The " + fileDescriptor + " " + pathToFile + " already exists. Would you like to overwrite it?" + " If not, please click 'No', rename the file, and run this step again", "Warning - " + fileDescriptor + " Exists", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { File.Delete(pathToFile); return(1); } else { formObject.outputFolderTextBox.Focus(); return(2); } } else { return(1); } }