public bool CloseCurrentProject() { if (ProjectManager.IsProjectOpen) { AutoSaveTimer.Stop(); if (ProjectManager.IsModified || ProjectManager.IsNewProject) { var messageText = ProjectManager.IsNewProject ? Messages.Message_SaveNewProject : Messages.Message_SaveChanges; var result = MessageBox.Show(messageText, Messages.Caption_SaveBeforeClose, MessageBoxButtons.YesNoCancel); if (result == DialogResult.Yes) { SaveProject(CurrentProject); } else if (result == DialogResult.Cancel) { AutoSaveTimer.Start(); return(false); } } ProjectManager.CloseCurrentProject(); } return(true); }
private void Settings_button_Click(object sender, EventArgs e) { SettingsForm SettingsForm = new SettingsForm(); DialogResult SettingsDialogResult = new DialogResult(); SettingsDialogResult = SettingsForm.ShowDialog(this); if (SettingsDialogResult == DialogResult.OK) // ok - other settings where changed. { if (Properties.Settings.Default.AutoSaving) { AutoSaveTimer.Start(); } else { AutoSaveTimer.Stop(); } } if (SettingsDialogResult == DialogResult.Yes) // yes - authentification values where changed. { // reconnect to server. if (BuisinessLogicClass.Connect() == 2) { Properties.Settings.Default.Connection = true; OldCommits(); BuisinessLogicClass.Update(); Search_others_button.Enabled = true; } } }
private void Commit_button_Click(object sender, EventArgs e) { CurrentIssueTimer.Stop(); CurrentIssueTimerTicking = false; AutoSaveTimer.Stop(); SaveTimeTicked(NewTicksAfterAutoSave); if (NewIssueSelectionAvailability) { BuisinessLogicClass.SuperIssueId = Convert.ToInt32(Issue_list_GridView.SelectedRows[0].Cells[0].Value); } else { BuisinessLogicClass.SuperIssueId = CurrentIssueId; } CommitForm CommitWindow = new CommitForm(); if (CommitWindow.ShowDialog() == DialogResult.OK) { Timer_label.Text = "00:00:00"; Start_timer_button.Text = "Start"; NewTicksAfterAutoSave = 0; TimerTicks = 0; NewIssueSelectionAvailability = true; Commit_button.Enabled = false; ModifyGridViewData(); } else { CurrentIssueTimer.Start(); CurrentIssueTimerTicking = true; AutoSaveTimer.Start(); } }
private void ExitApplication() { CurrentIssueTimer.Stop(); CurrentIssueTimerTicking = false; AutoSaveTimer.Stop(); SaveTimeTicked(NewTicksAfterAutoSave); BuisinessLogicClass.CleanUpIssuesFile(); // move all time to comments and empty time in main file. notifyIcon.Visible = false; }
/// <summary> /// This is called when the plugin is shut down. This happens only once. /// </summary> protected override void Shutdown() { try { //Destroy the view. MVWireupHelper.WireupEnd(this); AllQuestRedrawTimer.Stop(); AutoSaveTimer.Stop(); SaveState(); } catch (Exception ex) { Util.LogError(ex); } }
private void Start_timer_button_Click(object sender, EventArgs e) { if (NewIssueSelectionAvailability) { CurrentIssueId = Convert.ToInt32(Convert.ToString(Issue_list_GridView .Rows[Issue_list_GridView.SelectedRows[0].Index].Cells[0].Value)); BuisinessLogicClass.SuperIssueId = CurrentIssueId; CurrentIssueName = Convert.ToString(Issue_list_GridView .Rows[Issue_list_GridView.SelectedRows[0].Index].Cells[1].Value); if (CurrentIssueName.Length > 50) { Text = "RC: " + CurrentIssueName.Substring(0, 50); } else { Text = "RC: " + CurrentIssueName; } Issue_list_GridView.BackgroundColor = Color.WhiteSmoke; for (int i = 0; i < 5; i++) { Issue_list_GridView.Rows[CurrentIssueDataGridRowId].Cells[i].Style.BackColor = Color.DarkGray; } } if (Start_timer_button.Text == "Start") { NewIssueSelectionAvailability = true; } if (CurrentIssueTimerTicking) { CurrentIssueTimer.Stop(); CurrentIssueTimerTicking = false; AutoSaveTimer.Stop(); Start_timer_button.Text = "Continue"; } else { CurrentIssueTimer.Start(); CurrentIssueTimerTicking = true; AutoSaveTimer.Start(); Start_timer_button.Text = "Pause"; Commit_button.Enabled = true; NewIssueSelectionAvailability = false; } }
public bool CloseCurrentProject() { if (ProjectManager.IsProjectOpen) { AutoSaveTimer.Stop(); if (ProjectManager.IsModified || ProjectManager.IsNewProject) { var messageText = ProjectManager.IsNewProject ? Messages.Message_SaveNewProject : Messages.Message_SaveChanges; var result = MessageBox.Show(messageText, Messages.Caption_SaveBeforeClose, MessageBoxButtons.YesNoCancel); if (result == DialogResult.Yes) { SaveProject(CurrentProject); } else if (result == DialogResult.Cancel) { AutoSaveTimer.Start(); return(false); } } string workingDirPath = CurrentProject?.ProjectWorkingDir; if (!string.IsNullOrEmpty(workingDirPath) && Directory.Exists(workingDirPath)) { Task.Factory.StartNew(() => FileHelper.DeleteFileOrFolder(workingDirPath, true, true)); } SettingsManager.Current.LastOpenProject = null; SettingsManager.SaveSettings(); ProjectManager.CloseCurrentProject(); } return(true); }
void Stop_Click(object sender, MVControlEventArgs e) { AllQuestRedrawTimer.Stop(); AutoSaveTimer.Stop(); }