/// <summary> /// Edits the value of the selected watch item. /// </summary> protected void EditValueOfSelected() { if (listView.SelectedItems.Count != 1) { return; } ListViewItem l = listView.SelectedItems[0]; var w = l.Tag as WatchItem; if (w == null || !CanEdit) { return; } using (var f = new IntegerInputForm("Edit value", "Enter new value for " + w.Name + ":")) { long val; if (long.TryParse(w.Value, out val)) { f.LongValue = val; } if (f.ShowDialog() == DialogResult.OK) { OnWatchValueEdited(w, f.LongValue); } } }
/// <summary> /// Displays a dialog to enter a line to go to. /// </summary> public override void GoTo() { int lines = Editor.Document.TotalNumberOfLines; IntegerInputForm f = new IntegerInputForm("Go To Line", "Line number (1 - " + lines + "):", 1, lines); f.Value = Editor.ActiveTextAreaControl.Caret.Line + 1; if (f.ShowDialog() == DialogResult.OK) { GoToLine(f.Value - 1); } }
/// <summary> /// Edits the value of the selected watch item. /// </summary> protected void EditValueOfSelected() { if (listView.SelectedItems.Count != 1) return; ListViewItem l = listView.SelectedItems[0]; var w = l.Tag as WatchItem; if (w == null || !CanEdit) return; using (var f = new IntegerInputForm("Edit value", "Enter new value for " + w.Name + ":")) { long val; if (long.TryParse(w.Value, out val)) { f.LongValue = val; } if (f.ShowDialog() == DialogResult.OK) { OnWatchValueEdited(w, f.LongValue); } } }