private void SaveButton_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(TitleBox.Text)) { MessageBox.Show("Title is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (string.IsNullOrWhiteSpace(PathBox.Text)) { MessageBox.Show("Path is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (PathBox.Text.ToLower().StartsWith("http")) { // do nothing; just avoid checking the path. } else if (PathBox.Text.ToLower().StartsWith("evernote:")) { // do nothing; just avoid checking the path. } else if (!File.Exists(PathBox.Text) && !Directory.Exists(PathBox.Text)) { MessageBox.Show("Path does not exist", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.Tool = new Alternity.Tool { Path = PathBox.Text, Args = ArgsBox.Text, Title = TitleBox.Text }; DialogResult = System.Windows.Forms.DialogResult.OK; }
private void SetToolLink() { using (ToolDetailForm win = new ToolDetailForm(this.Tool, "Set Info Link")) { if (win.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.Tool = win.Tool; Dirty = true; SetToolLinkToolTip(); } } }