private void SearchForSubtask() { int i = 0; bool found = false; foreach (char c in Editor_TextBox.Text) { if (c == ':') { string subtaskNum = JSON_Reader.GetSubtaskNum(i, Editor_TextBox.Text); if (subtaskNum.Replace(" ", "").Replace(",", "") == Find_TextBox.Text.Replace(" ", "").Replace(",", "")) { found = true; int startHighlighht = Editor_TextBox.Text.LastIndexOf("\"", i - 2); Editor_TextBox.SelectionStart = i; Editor_TextBox.Select(i, -(i - startHighlighht)); Editor_TextBox.ScrollToCaret(); HideFindButton(); searchSubtask = false; break; } } i++; } if (!found) { ConsoleHandler.append_Force_CanRepeat("That subtask was not found"); } }
private void GetSubtaskNum() { string subtaskNum = JSON_Reader.GetSubtaskNum(CharIndex_UnderMouse, Editor_TextBox.Text); if (subtaskNum != "" && subtaskNum != " " && subtaskNum != null) { ConsoleHandler.append_Force_CanRepeat("Subtask: [" + subtaskNum + " ]"); } else { ConsoleHandler.append_Force("Unable to detect subtask. Please try clicking somewhere else..."); } }
private void GetSubtaskNum() { if (jsonError == false) { string subtaskNum = JSON_Reader.GetSubtaskNum(CharIndex_UnderMouse, Editor_TextBox.Text); if (subtaskNum != "" && subtaskNum != " " && subtaskNum != null) { ConsoleHandler.append_Force_CanRepeat("Subtask: [" + subtaskNum + " ]"); } else { ConsoleHandler.append_Force_CanRepeat("Unable to detect subtask. Please try clicking somewhere else..."); this.Focus(); } } else { ConsoleHandler.append_Force("JSON error detected... You need to fix the JSON error before you can get the subtask"); } }