Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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;
                }
            }
        }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 /// <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); }
 }
Esempio n. 6
0
        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;
            }
        }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
 void Stop_Click(object sender, MVControlEventArgs e)
 {
     AllQuestRedrawTimer.Stop();
     AutoSaveTimer.Stop();
 }