/// <summary> /// Saves updated note (also to file) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSave_Click(object sender, EventArgs e) { /* * 1. Collect all info and save to list & save to file * 2. Check if avatar = null? */ note.Color = colorBox.SelectedValue.ToString(); note.Text = noteTextBox.Text.Trim(); note.Tags = tagsTextBox.Text.Trim(); // Convert Avatar to base64 encoded string if (note.Avatar != null) { note.Avatar = NoteHandler.imageToBase64(avatarBox.Image); } // Save Note NoteHandler.saveNote(note); NoteHandler.saveNotesToFile(); NoteHandler.refreshNotesFromFile(); // Update data representation as well as update playerbuttons TableHandler.refreshTableData(note, table); TableHandler.refreshPlayerButtons(table); this.Close(); }
static Dictionary <IntPtr, ScanButton> scanButtonList; // keeps track of all attached ScanButtons /// <summary> /// Initialize all of the above components /// </summary> public SessionHandler() { launchOCREngine(); emuHandler = new EmulatorHandler(GlobalSettings.General.EmulatorRegex); // Only retrieve pointers from windows which match regular expression emulatorList = emuHandler.getEmulatorList(); tableHandler = new TableHandler(engine); NoteHandler.refreshNotesFromFile(); // Load Notes from JSON-Notefile alerterWorker = new AlertWorker(); scanButtonList = new Dictionary <IntPtr, ScanButton>(); }
/// <summary> /// EventHandler - Delete Note from inside NoteWindow /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnDelNote_Click(object sender, EventArgs e) { // Remove vom Note-File NoteHandler.deleteNote(note.Name); NoteHandler.saveNotesToFile(); NoteHandler.refreshNotesFromFile(); // Remove tabledata as well as button TableHandler.refreshTableData(note, table); TableHandler.refreshPlayerButtons(table); this.Close(); }