private TreeNode CreateProjectNode(MOG_Project pProject)
        {
            TreeNode project = CreateNode(pProject.GetProjectName(), "Project", new RemoteSettings());

            // Load all the branches of each project
            ArrayList branches = MOG_DBProjectAPI.GetAllBranchNames(pProject.GetProjectName());

            if (branches != null)
            {
                TreeNode branchNode = CreateNode("Branches", "Branches", new RemoteSettings());
                foreach (MOG_DBBranchInfo branch in branches)
                {
                    branchNode.Nodes.Add(CreateNode(branch.mBranchName, "Branch", new RemoteSettings()));
                }

                project.Nodes.Add(branchNode);
            }

            // Load all the users of the project
            LoadProjectUsers(pProject, project);

            // Load all the tool directories
            // Load misc

            return(project);
        }
        public void LoadFromProject(MOG_Project project)
        {
            this.tbProjectName.Text = project.GetProjectName();
            this.tbProjectNameInSourceControl.Text = project.GetProjectName();
            this.tbProjectKey.Text  = project.GetProjectName();
            this.tbProjectPath.Text = project.GetProjectPath();
            this.tbBuildTool.Text   = "UNKNOWN";

            this.projectsPath = Path.GetDirectoryName(project.GetProjectPath());
        }
        public ConfigureProjectForm(MOG_Project project)
        {
            InitializeComponent();

            this.project = project;

            this.Text = "Project Configuration - Project: " + project.GetProjectName() + "     ( Branch: " + MOG_ControllerProject.GetBranchName() + " )";

            // project info
            this.projectInfoControl1.LoadFromProject(project);

            // platforms
            this.platformEditor.LoadDefaults();
            this.platformEditor.LoadFromProject(project);

            //departments
            departmentManager.LoadFromProject(project);

            // users
            this.userManager.LoadFromProject(project);

            // Privileges
            MOG_ControllerProject.RefreshPrivileges();
            this.MogControl_Privileges.Initialize_Control(MOG_ControllerProject.GetPrivileges());

            // asset classes
            this.assetClassificationConfigControl1.LoadProjectClassifications2(project);
            //this.assetClassificationConfigControl1.LoadProjectClassifications(project);
        }
Exemple #4
0
        private void btnCreate_Click(object sender, System.EventArgs e)
        {
            if (!DuplicateProjectNameCheck(this.projectInfoControl.ProjectName, true))
            {
                this.projectInfoControl.FocusProjectName();
                return;
            }

            if (this.executeCreate)
            {
                MOG_Project proj = CreateProject(true);
                if (proj == null)
                {
                    // If project creation failed, return
                    return;
                }

                MOG_ControllerProject.LoginProject(proj.GetProjectName(), "");

                try
                {
                    Hide();
                    ConfigureProjectWizardForm wiz = new ConfigureProjectWizardForm(proj);
                    wiz.ShowDialog(this);
                }
                catch (Exception ex)
                {
                    MOG_Prompt.PromptResponse("Configure Error", ex.Message, ex.StackTrace, MOGPromptButtons.OK, MOG_ALERT_LEVEL.CRITICAL);
                }
            }

            this.DialogResult = DialogResult.OK;
            Hide();
        }
Exemple #5
0
        public FileImportForm(MOG_Project proj)
        {
            InitializeComponent();

            this.project = proj;

            this.assetImportPlacer.ProjectName = proj.GetProjectName();
            this.assetImportPlacer.Platforms   = new ArrayList(proj.GetPlatformNames());
            this.assetImportPlacer.LoadClassesFromProject(proj);

            // Hook up events
            this.assetImportPlacer.Event_LoadingDirectories     += new EventHandler(assetImportPlacer_Event_LoadingDirectories);
            this.assetImportPlacer.Event_DoneLoadingDirectories += new EventHandler(assetImportPlacer_Event_DoneLoadingDirectories);
        }
Exemple #6
0
        public ConfigureProjectForm(MOG_Project project)
        {
            InitializeComponent();

            this.project = project;

            this.Text = "Project Configuration - " + project.GetProjectName();

            this.Size = new Size(PROJECT_INFO_WIDTH, PROJECT_INFO_HEIGHT);

            // project info
            this.projectInfoControl1.LoadFromProject(project);

            // platforms
            this.platformEditor.LoadDefaults();
            this.platformEditor.LoadFromProject(project);

            // users
            this.userManager.LoadFromProject(project);

            // asset classes
            this.assetClassificationConfigControl1.LoadProjectClassifications2(project);
            //this.assetClassificationConfigControl1.LoadProjectClassifications(project);
        }
Exemple #7
0
        private void CreateProject_Worker(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            MOG_Project project = new MOG_Project();

            try
            {
                MOG_System sys = MOG_ControllerSystem.GetSystem();
                if (sys != null)
                {
                    project = sys.ProjectCreate(this.projectInfoControl.ProjectName);
                    if (project != null)
                    {
                        worker.ReportProgress(0, "Setting project info...");

                        // project info
                        project.SetProjectPath(this.projectInfoControl.ProjectPath);
                        project.SetProjectToolsPath(this.projectInfoControl.ProjectPath + "\\Tools");
                        project.SetProjectUsersPath(this.projectInfoControl.ProjectPath + "\\Users");

                        worker.ReportProgress(0, "Copying tools...");

                        worker.ReportProgress(0, "Saving and logging in...");

                        // create project and login
                        project.Save();

                        MOG_ControllerProject.LoginProject(this.projectInfoControl.ProjectName, "");

                        worker.ReportProgress(0, "Creating current branch...");

                        // create default branch
                        MOG_ControllerProject.BranchCreate("", "Current");

                        worker.ReportProgress(0, "Creating classification tree...");

                        // platforms
                        MOG_Platform pcPlatform = new MOG_Platform();
                        pcPlatform.mPlatformName = "PC";
                        project.PlatformAdd(pcPlatform);

                        // create classifications
                        MogUtil_ClassificationLoader classLoader = new MogUtil_ClassificationLoader();
                        classLoader.ProjectName = this.projectInfoControl.ProjectName;
                        foreach (MOG_Properties props in classLoader.GetClassPropertiesListFromFiles())
                        {
                            if (props.Classification.ToLower() == project.GetProjectName().ToLower())
                            {
                                // create only project name root class node
                                project.ClassificationAdd(props.Classification);
                                MOG_Properties properties = project.GetClassificationProperties(props.Classification);
                                properties.SetImmeadiateMode(true);
                                properties.SetProperties(props.GetPropertyList());
                                break;
                            }
                        }

                        project.Save();
                    }
                    else
                    {
                        throw new Exception("Failed to create the project.");
                    }
                }
                else
                {
                    throw new Exception("System not initialized.");
                }
            }
            catch (Exception ex)
            {
                MOG_Report.ReportMessage("Project Creation Failed", ex.Message, ex.StackTrace, MOG_ALERT_LEVEL.CRITICAL);
            }

            e.Result = project;
        }