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; } } }
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); }
public NoteViewModel() { if (!AutoSaveTimer.IsEnabled) { AutoSaveTimer.Start(); } }
public WidgetViewModel() { if (!AutoSaveTimer.IsEnabled) { AutoSaveTimer.Start(); } }
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(); } }
protected override void OnStart() { base.OnStart(); defaultSiteId = BL.ApplicationDataContext.Instance.LoggedInUser.DefaultSiteId; AllowArchive = false; AutoSaveTimer.Start(); BindData(); txtSupplierCodeFrom.DataBindings.Add(new Binding("EditValue", aorFilters, "SupplierCodeFrom", true, DataSourceUpdateMode.OnPropertyChanged)); txtSupplierCodeTo.DataBindings.Add(new Binding("EditValue", aorFilters, "SupplierCodeTo", true, DataSourceUpdateMode.OnPropertyChanged)); }
public MainForm() { InitializeComponent(); ucGroups.setWordsPanel(ucWords.getWordsPanel()); LoadData(); AutoSaveTimer.Interval = 2 * 60 * 1000; AutoSaveTimer.Tick += AutoSaveTimer_Tick; AutoSaveTimer.Start(); }
private void LoadPartProject(PartProject project) { if (!CloseCurrentProject()) { return; } ProjectManager.SetCurrentProject(project); if (project != null) { AutoSaveTimer.Start(); } }
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); }
private bool LoadPartProject(PartProject project, string tempPath = null) { if (!CloseCurrentProject()) { return(false); } ViewportPanel.ForceRender(); ProjectManager.SetCurrentProject(project, tempPath); if (project != null) { if (!ProjectManager.IsNewProject && string.IsNullOrEmpty(tempPath)) { RebuildRecentFilesMenu(); SettingsManager.AddRecentProject(ProjectManager.GetCurrentProjectInfo(), true); } AutoSaveTimer.Start(); } return(project != null); }