Пример #1
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;
        }
        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();
        }