コード例 #1
0
        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);
        }
コード例 #2
0
        private void UpdateNewWorkspaceBranchComboBox()
        {
            NewWorkspaceBranchComboBox.BackColor = Color.Tomato;

            // Check if the selected text matches one of our branches?
            foreach (string branch in NewWorkspaceBranchComboBox.Items)
            {
                // Check for a match
                if (string.Compare(branch, NewWorkspaceBranchComboBox.Text, true) == 0)
                {
                    // Looks like this is a valid branch
                    NewWorkspaceBranchComboBox.BackColor = Color.PaleGreen;

                    // Reload the available platforms for this branch
                    ArrayList platforms = MOG_DBProjectAPI.GetPlatformsInBranch(branch);
                    NewWorkspacePlatformsComboBox.Items.Clear();
                    NewWorkspacePlatformsComboBox.Items.AddRange(platforms.ToArray());
                    NewWorkspacePlatformsComboBox.SelectedIndex = 0;

                    // Update the platform ComboBox
                    UpdateNewWorkspacePlatformsComboBox();
                }
            }

            // Check if the user can continue?
            NewWorkspaceWizard.NextEnabled = (NewWorkspaceBranchComboBox.BackColor == Color.Tomato) ? false : true;
        }
コード例 #3
0
        private void PopulateTags()
        {
            GetLatestTagsToolStripMenuItem.DropDownItems.Clear();

            ArrayList Branches = MOG_DBProjectAPI.GetAllBranchNames();

            if (Branches != null)
            {
                // Get the last set active tag
                string active = "";
                if (GetLatestTagsToolStripMenuItem.Tag is string)
                {
                    active = GetLatestTagsToolStripMenuItem.Tag as string;
                    AddTagItem(active, "None");
                }
                else
                {
                    AddTagItem("None", "None");
                }

                foreach (MOG_DBBranchInfo branch in Branches)
                {
                    if (branch.mTag)
                    {
                        AddTagItem(active, branch.mBranchName);
                    }
                }
            }
        }
コード例 #4
0
        private void UpdateLocalBranchComboBox()
        {
            NewLocalBranchComboBox.BackColor = Color.Tomato;

            // Check if the selected text matches one of our branches?
            foreach (string branch in NewLocalBranchComboBox.Items)
            {
                // Check for a match
                if (string.Compare(branch, NewLocalBranchComboBox.Text, true) == 0)
                {
                    // Looks like this is a valid branch
                    NewLocalBranchComboBox.BackColor = Color.PaleGreen;

                    // Reload the available platforms for this branch
                    ArrayList platforms = MOG_DBProjectAPI.GetPlatformsInBranch(branch);
                    NewLocalPlaformComboBox.Items.Clear();
                    NewLocalPlaformComboBox.Items.AddRange(platforms.ToArray());
                    NewLocalPlaformComboBox.SelectedIndex = 0;
                    // Update the platform ComboBox
                    UpdateLocalPlaformComboBox();
                }
            }

            UpdateOkButton();
        }
コード例 #5
0
        private void InitializeTags()
        {
            TagsListView.Items.Clear();

            ArrayList Branches = MOG_DBProjectAPI.GetAllBranchNames();

            if (Branches != null)
            {
                string activeTag = "";
                if (MOG_ControllerProject.GetProject().GetConfigFile().KeyExist("Project", "ActiveTag"))
                {
                    activeTag = MOG_ControllerProject.GetProject().GetConfigFile().GetString("Project", "ActiveTag");
                }

                foreach (MOG_DBBranchInfo branch in Branches)
                {
                    // Is this a tag?  or
                    // Is this 'Current'?
                    if (branch.mTag ||
                        string.Compare(branch.mBranchName, "Current", true) == 0)
                    {
                        AddTagListViewItem(branch, (string.Compare(branch.mBranchName, activeTag, true) == 0));
                    }
                }
            }
        }
コード例 #6
0
        private void AddBranch()
        {
            MOG_Privileges privs = MOG_ControllerProject.GetPrivileges();

            if (privs.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.CreateBranch))
            {
                CreateBranchForm newBranch = new CreateBranchForm();
                newBranch.BranchSourceTextBox.Text = MOG_ControllerProject.GetBranchName();

                if (newBranch.ShowDialog() == DialogResult.OK)
                {
                    // Create the branch
                    if (MOG_ControllerProject.BranchCreate(MOG_ControllerProject.GetBranchName(), newBranch.BranchNameTextBox.Text))
                    {
                        MOG_DBBranchInfo branch = MOG_DBProjectAPI.GetBranch(newBranch.BranchNameTextBox.Text);

                        AddBranchListViewItem(branch);

                        MOG_Prompt.PromptMessage("Create Branch", "New branch successfully created.\n" +
                                                 "BRANCH: " + newBranch.BranchNameTextBox.Text);
                    }
                }
            }
            else
            {
                MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to create branches.");
            }
        }
コード例 #7
0
        private void InitializeBranches()
        {
            BranchesListView.Items.Clear();

            ArrayList Branches = MOG_DBProjectAPI.GetAllBranchNames();

            if (Branches != null)
            {
                foreach (MOG_DBBranchInfo branch in Branches)
                {
                    if (!branch.mTag)
                    {
                        AddBranchListViewItem(branch);
                    }
                }
            }
        }
コード例 #8
0
ファイル: guiStartup.cs プロジェクト: MOGwareSupport/MOG
        static public List <string> GetBranches(string projectname)
        {
            List <string> branches = new List <string>();

            ArrayList branchNames = MOG_DBProjectAPI.GetAllBranchNames(projectname);

            if (branches != null)
            {
                foreach (MOG_DBBranchInfo branchName in branchNames)
                {
                    // Ignore tags
                    if (!branchName.mTag)
                    {
                        branches.Add(branchName.mBranchName);
                    }
                }
            }

            return(branches);
        }
コード例 #9
0
        static public void MOGGlobalBranchesInit(bool force)
        {
            // Add all valid login projects
            if (mainForm.branchesToolStripMenuItem.DropDownItems.Count == 0 || force)
            {
                mainForm.branchesToolStripMenuItem.DropDownItems.Clear();

                ArrayList Branches = MOG_DBProjectAPI.GetActiveBranchNames();

                if (Branches != null)
                {
                    foreach (MOG_DBBranchInfo branch in Branches)
                    {
                        // Only show branches, not TAGS
                        if (!branch.mTag)
                        {
                            ToolStripMenuItem Item = new ToolStripMenuItem(branch.mBranchName);
                            Item.Click += new System.EventHandler(MainMenuProjectsClass.MOGGlobalBranches_Click);

                            // Check if this is our currently selected branch
                            if (string.Compare(branch.mBranchName, MOG_ControllerProject.GetBranchName(), true) == 0)
                            {
                                Item.Checked = true;
                            }

                            // Set light version control
                            MogUtil_VersionInfo.SetLightVersionControl(Item);

                            mainForm.branchesToolStripMenuItem.DropDownItems.Add(Item);
                        }
                    }
                }

                mainForm.branchesToolStripMenuItem.Enabled = true;
            }
        }
コード例 #10
0
        /// <summary>
        /// Populate the assign to comboBox
        /// </summary>
        private void PopulateAssignTo()
        {
            ArrayList departments = MOG_DBProjectAPI.GetDepartments();

            if (departments != null)
            {
                foreach (string departmentId in departments)
                {
                    // Add the department
                    TaskUsersComboBox.Items.Add("Department{" + departmentId + "}");

                    ArrayList users = MOG_DBProjectAPI.GetDepartmentUsers(departmentId);

                    if (users != null)
                    {
                        foreach (string user in users)
                        {
                            // Add the user
                            TaskUsersComboBox.Items.Add(user);
                        }
                    }
                }
            }
        }