Esempio n. 1
0
        private void OpenProject(string projectname)
        {
            //TODO: Are there pending changes in the optionally currently opened binary file / project?
            if (Directory.Exists(m_appSettings.ProjectFolder + "\\" + projectname))
            {
                m_appSettings.LastOpenedType = 1;
                Tools.Instance.m_CurrentWorkingProject = projectname;
                Tools.Instance.m_ProjectLog.OpenProjectLog(m_appSettings.ProjectFolder + "\\" + projectname);
                //Load the binary file that comes with this project
                LoadBinaryForProject(projectname);
                //LoadAFRMapsForProject(projectname); // <GS-27072010> TODO: nog bekijken voor T7
                if (Tools.Instance.m_currentfile != string.Empty)
                {
                    // transaction log <GS-15032010>

                    Tools.Instance.m_ProjectTransactionLog = new TransactionLog();
                    if (Tools.Instance.m_ProjectTransactionLog.OpenTransActionLog(m_appSettings.ProjectFolder, projectname))
                    {
                        Tools.Instance.m_ProjectTransactionLog.ReadTransactionFile();
                        if (Tools.Instance.m_ProjectTransactionLog.TransCollection.Count > 2000)
                        {
                            frmProjectTransactionPurge frmPurge = new frmProjectTransactionPurge();
                            frmPurge.SetNumberOfTransactions(Tools.Instance.m_ProjectTransactionLog.TransCollection.Count);
                            if (frmPurge.ShowDialog() == DialogResult.OK)
                            {
                                Tools.Instance.m_ProjectTransactionLog.Purge();
                            }
                        }
                    }
                    // transaction log <GS-15032010>
                    btnCloseProject.Enabled = true;
                    btnAddNoteToProject.Enabled = true;
                    btnEditProject.Enabled = true;
                    btnShowProjectLogbook.Enabled = true;
                    btnProduceLatestBinary.Enabled = true;
                    //btncreateb
                    btnRebuildFile.Enabled = true;
                    CreateProjectBackupFile();
                    UpdateRollbackForwardControls();
                    m_appSettings.Lastprojectname = Tools.Instance.m_CurrentWorkingProject;
                    this.Text = "VAGEDCSuite [Project: " + projectname + "]";
                }
            }
        }