/// <summary> /// Loads a project by double click action /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lbProjects_MouseDoubleClick(object sender, MouseEventArgs e) { int index = lbProjects.IndexFromPoint(e.Location); Log("Index: " + index); if (index != System.Windows.Forms.ListBox.NoMatches) { if (!AllowUnloadProject()) { return; } activeProject = GetProject(); ShowActiveProject(); changed = false; } }
/// <summary> /// Loads a project into the editor /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnLoadProject_Click(object sender, EventArgs e) { if (!AllowUnloadProject()) { return; } activeProject = GetProject(); ShowActiveProject(); changed = false; }
/// <summary> /// Creates a new, empty project /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnNewProject_Click(object sender, EventArgs e) { if (!AllowUnloadProject()) { return; } activeProject = new Project(); activeProject.Title = "New project"; activeProject.Message = "Type your text here"; attach = ""; ShowActiveProject(); }
/// <summary> /// Delete the active project /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDeleteProject_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to delete the project?", "Warning", MessageBoxButtons.OKCancel)==DialogResult.OK) { if (activeProject.Id != 0) { activeProject.Delete(new SQLiteDatabase()); projects.Remove(activeProject); } activeProject = null; ShowActiveProject(); } }