Exemple #1
0
        private void toolStripMenuItemNewProject_Click(object sender, EventArgs e)
        {
            _logger.Trace("FormMain.toolStripMenuItemNewProject_Click()");

            try
            {
                SaveAndCloseProject(false);

                FormNewProject form = new FormNewProject();
                form.LoadLocalVariables();

                if (form.ShowDialog() == DialogResult.OK)
                {
                    _activeProject = form.Project;

                    _activeControl                  = new ProjectWorkspace();
                    _activeControl.Dock             = DockStyle.Fill;
                    _activeControl.Project          = _activeProject;
                    _activeControl.OnProjectChange += activeControl_OnProjectChange;
                    _activeControl.LoadLocalVariables();

                    UpdateWindowTitle();
                    UpdateMenuControls();

                    panelMain.Visible = true;
                    panelMain.Controls.Add(_activeControl);
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex, ex.Message);
                MessageBoxHelper.ProcessException(ex);
            }
        }
Exemple #2
0
        private void OpenProject(string projectLocation)
        {
            _logger.Trace("FormMain.OpenProject()");

            _activeProject = ProjectsController.OpenProjectFromLocation(projectLocation, Resources.EncriptionKey);

            if (!_activeProject.IsValid)
            {
                return;
            }

            _activeControl                  = new ProjectWorkspace();
            _activeControl.Dock             = DockStyle.Fill;
            _activeControl.Project          = _activeProject;
            _activeControl.OnProjectChange += activeControl_OnProjectChange;
            _activeControl.LoadLocalVariables();

            UpdateWindowTitle();
            UpdateMenuControls();

            panelMain.Visible = true;
            panelMain.Controls.Add(_activeControl);
        }