private void btnOk_Click(object sender, EventArgs e) { if (!ValidateFields()) { return; } string filename = string.Empty; try { if (txtGroup.Text.Length > 1) { filename = '[' + txtGroup.Text + ']' + ' '; } filename += txtTitle.Text + FileNameFormat.ToFormat(txtStart.Text, txtSeason.Text, fileformat); string fullpath = Path.Combine(dirname, filename.Replace(' ', '_')); file.FileName = fullpath; if (txtEnd.Text.Length > 1) { fullpath = file.FileName.Replace(file.EstimateEpisode(), file.EstimateEpisode() + "-" + txtEnd.Text); } fullpath = Path.ChangeExtension(fullpath, radType_Filler.Checked ? "filler" : "missing"); if (File.Exists(fullpath)) { Error_Handle.TipError("Title Already Exists\n", toolTip, txtTitle); return; } imgWorking.Visible = true; File.CreateText(fullpath); Close(); } catch (Exception ex) { Error_Handle.TipError("Error Creating File : " + ex.Message, toolTip, txtTitle); } }
public FileMarkerDialog(string path, FileNameFormat fn) { InitializeComponent(); MainForm.Main.WindowState = FormWindowState.Normal; this.WindowState = MainForm.Main.WindowState; this.TopMost = MainForm.Main.TopMost; file = fn; fileformat = fn.Format; dirname = path; txtGroup.Text = fn.EstimateGroup(); txtStart.Text = fn.EstimateEpisode(); txtSeason.Text = fn.EstimateSeason(); txtTitle.Text = fn.EstimateTitle(); }
public FileMarkerDialog(string path, FileNameFormat fn) { InitializeComponent(); MainForm.Main.WindowState = FormWindowState.Normal; this.WindowState = MainForm.Main.WindowState; this.TopMost = MainForm.Main.TopMost; file = fn; fileformat = fn.Format; dirname = path; txtGroup.Text = fn.EstimateGroup(); txtStart.Text = fn.EstimateEpisode(); txtSeason.Text = fn.EstimateSeason(); txtTitle.Text = fn.EstimateTitle(); }
private void LoadFormatFields() { if (!showFields || multiRun) { Console.WriteLine("----DENIED"); return; } Console.WriteLine("----FORMATS"); for (int i = 0; i < gvFiles.RowCount; i++) { if (!Directory.Exists(gvFiles.Rows[i].Cells[3].Value.ToString())) { FileNameFormat fn = new FileNameFormat(gvFiles.Rows[i].Cells[2].Value.ToString(), (EPFORMAT)ddFormat.SelectedValue); gvFiles.Rows[i].Cells[4].Value = fn.EstimateGroup(); gvFiles.Rows[i].Cells[5].Value = fn.EstimateSeason(); gvFiles.Rows[i].Cells[6].Value = fn.EstimateEpisode(); gvFiles.Rows[i].Cells[7].Value = fn.EstimateCRC(); } } }
private void LoadFormatFields() { if (!showFields || multiRun) { Console.WriteLine("----DENIED"); return; } Console.WriteLine("----FORMATS"); for (int i = 0; i < gvFiles.RowCount; i++) { if (!Directory.Exists(gvFiles.Rows[i].Cells[3].Value.ToString())) { FileNameFormat fn = new FileNameFormat(gvFiles.Rows[i].Cells[2].Value.ToString(), (EPFORMAT)ddFormat.SelectedValue); gvFiles.Rows[i].Cells[4].Value = fn.EstimateGroup(); gvFiles.Rows[i].Cells[5].Value = fn.EstimateSeason(); gvFiles.Rows[i].Cells[6].Value = fn.EstimateEpisode(); gvFiles.Rows[i].Cells[7].Value = fn.EstimateCRC(); } } }