Beispiel #1
0
 private void PauseWorkOnProject(bool stopWorkOnProject = false)
 {
     if (currentProject == null)
     {
         throw new Exception("No project selected");
     }
     if (state == MainFormState.WorkingOnProjectState)
     {
         ProjectLog log = new ProjectLog();
         log.ProjectId = currentProject.ProjectId;
         log.StartDate = lastTimeStarted;
         log.EndDate   = DateTime.Now;
         ResetTimer();
         log.UserId      = loggedInUserId;
         log.Description = descriptionTextBox.Text;
         projectLogRepository.Save(log);
         currentProject.EndDate = log.EndDate;
         SaveScreenShots(log);
     }
     currentProject.IsInProgress = !stopWorkOnProject;
     projectRepository.Save(currentProject);
     state = MainFormState.ProjectPausedState;
     ResetProjectsGrid();
     ResetTimer();
     screenShots.Clear();
 }
Beispiel #2
0
 private void SelectProjectForWork(Project project)
 {
     currentProject              = project;
     projectNameTextBox.Text     = currentProject.Name;
     projectNameTextBox.ReadOnly = true;
     state = MainFormState.ProjectPausedState;
     SetEnabledForProjectButtons(true, false, true);
     ResetProjectsGrid();
 }
Beispiel #3
0
 private void EnterAddingNewProjectState()
 {
     currentProject              = null;
     state                       = MainFormState.CreatingProjectState;
     projectNameTextBox.Text     = "";
     projectNameTextBox.ReadOnly = false;
     descriptionTextBox.Text     = "";
     SetEnabledForProjectButtons(true, false, false);
 }
Beispiel #4
0
 public void SetMainFormState(MainFormState type)
 {
     if (Visible)
     {
         Invoke(new DelegateCall(this, new SetFormStateDelegate(SetMainFormUnsafe), type));
     }
     else
     {
         FormState = type;
     }
 }
Beispiel #5
0
 private void EnterWorkingOnProjectState(string description = "")
 {
     screenShots.Clear();
     if (currentProject == null)
     {
         throw new Exception("No project selected");
     }
     SetEnabledForProjectButtons(false, true, true);
     descriptionTextBox.Text = description;
     state = MainFormState.WorkingOnProjectState;
     ResetTimer();
     timer1.Enabled = true;
     currentProject.IsInProgress = true;
 }
Beispiel #6
0
        void formStateChanged(MainFormState obj)
        {
            switch (obj)
            {
            case MainFormState.PackageExecuting:
                buttonBrowse.Enabled = false;
                linkLabel1.Enabled   = true;
                break;

            case MainFormState.Idle:
                buttonBrowse.Enabled = true;
                linkLabel1.Enabled   = false;
                break;

            default:
                buttonBrowse.Enabled = true;
                linkLabel1.Enabled   = true;
                break;
            }
        }
Beispiel #7
0
        /**
         * NONE - ставит фулл  чек кнопку и включает старт кнопку
         * CHECKING - ставит кенсел кнопку, и отключает старт кнопку
         */

        private void SetMainFormUnsafe(MainFormState s)
        {
            switch (s)
            {
            case MainFormState.NONE:
                _fullCheck.Info      = ImageHolder.Instance()[PictureName.FULLCHECK];
                _fullCheck.Enabled   = true;
                _startButton.Enabled = true;
                break;

            case MainFormState.CHECKING:
                _fullCheck.Info      = ImageHolder.Instance()[PictureName.CANCEL];
                _startButton.Enabled = false;
                _fullCheck.Enabled   = true;
                break;
            }

            _tabbedPane.IsSelectionDisabled = (s != MainFormState.NONE);
            FormState = s;
        }
Beispiel #8
0
        private void SetStateUnsafe(MainFormState s)
        {
            switch (s)
            {
            case MainFormState.NONE:
                _checkButton.Text = LanguageHolder.Instance()[WordEnum.CHECK];
                _updateBtn.Text   = LanguageHolder.Instance()[WordEnum.UPDATE];
                break;

            case MainFormState.CHECKING:
                _checkButton.Text  = LanguageHolder.Instance()[WordEnum.CANCEL];
                _updateBtn.Enabled = false;
                break;

            case MainFormState.DONE:
                _updateBtn.Enabled = true;
                _updateBtn.Text    = LanguageHolder.Instance()[WordEnum.RESTART];
                break;
            }

            MainForm.Instance.SetMainFormState(s == MainFormState.DONE ? MainFormState.NONE : s);

            FState = s;
        }
Beispiel #9
0
        private void SetStateUnsafe(MainFormState s)
        {
            switch (s)
            {
                case MainFormState.NONE:
                    _checkButton.Text = LanguageHolder.Instance()[WordEnum.CHECK];
                    _updateBtn.Text = LanguageHolder.Instance()[WordEnum.UPDATE];  
                    break;
                case MainFormState.CHECKING:
                    _checkButton.Text = LanguageHolder.Instance()[WordEnum.CANCEL];  
                    _updateBtn.Enabled = false;
                    break;
                case MainFormState.DONE:
                    _updateBtn.Enabled = true;
                    _updateBtn.Text = LanguageHolder.Instance()[WordEnum.RESTART];  
                    break;
            }

            MainForm.Instance.SetMainFormState(s == MainFormState.DONE ? MainFormState.NONE : s);

            FState = s;
        }
Beispiel #10
0
 public void SetState(MainFormState type)
 {
     if (Visible)
     {
         Invoke(new DelegateCall(this, new MainForm.SetFormStateDelegate(SetStateUnsafe), type));
     }
     else
     {
         FState = type;
     }
 }
Beispiel #11
0
 private void ToggleFullScreen(bool visible)
 {
     if (UpdatingUINow) return;
       if (visible)
       {
     formState = new MainFormState();
     formState.EnterFullScreenMode(this);
       }
       else
       {
     formState.ExitFullScreenMode(this);
     formState = null;
       }
       UpdateUI();
 }
Beispiel #12
0
 void formStateChanged(MainFormState obj)
 {
     switch (obj)
     {
         case MainFormState.PackageExecuting:
             buttonBrowse.Enabled = false;
             linkLabel1.Enabled = true;
             break;
         case MainFormState.Idle:
             buttonBrowse.Enabled = true;
             linkLabel1.Enabled = false;
             break;
         default:
             buttonBrowse.Enabled = true;
             linkLabel1.Enabled = true;
             break;
     }
 }
Beispiel #13
0
        /**
         * NONE - ставит фулл  чек кнопку и включает старт кнопку
         * CHECKING - ставит кенсел кнопку, и отключает старт кнопку
         */

        private void SetMainFormUnsafe(MainFormState s)
        {
            switch (s)
            {
                case MainFormState.NONE:
                    _fullCheck.Info = ImageHolder.Instance()[PictureName.FULLCHECK];
                    _fullCheck.Enabled = true;
                    _startButton.Enabled = true;
                    break;
                case MainFormState.CHECKING:
                    _fullCheck.Info = ImageHolder.Instance()[PictureName.CANCEL];
                    _startButton.Enabled = false;
                    _fullCheck.Enabled = true;
                    break;
            }

            _tabbedPane.IsSelectionDisabled = (s != MainFormState.NONE);
            FormState = s;
        }