public BitbucketPullRequestForm([CanBeNull] Settings settings, IGitModule module)
        {
            InitializeComponent();

            // NOTE ddlBranchSource and ddlBranchTarget both have string items so do not need a display member
            ddlRepositorySource.DisplayMember = nameof(Repository.DisplayName);
            ddlRepositoryTarget.DisplayMember = nameof(Repository.DisplayName);

            _settings = settings ?? new Settings();

            Load += delegate
            {
                ReloadPullRequests();
                ReloadRepositories();
            };

            var repoUrl = _NO_TRANSLATE_RepoUrl = string.Format(_NO_TRANSLATE_RepoUrl,
                                                                _settings.BitbucketUrl, _settings.ProjectKey, _settings.RepoSlug);
            var branch = GitCommands.GitRefName.GetFullBranchName(module.GetSelectedBranch());

            _NO_TRANSLATE_lblLinkCreatePull.Text = repoUrl +
                                                   ((branch.IsNullOrEmpty() || branch.Equals(DetachedHeadParser.DetachedBranch)) ?
                                                    _NO_TRANSLATE_LinkCreatePullNoBranch :
                                                    string.Format(_NO_TRANSLATE_LinkCreatePull, branch));
            toolTipLink.SetToolTip(_NO_TRANSLATE_lblLinkCreatePull, _linkLabelToolTip.Text);

            _NO_TRANSLATE_lblLinkViewPull.Text = repoUrl + _NO_TRANSLATE_LinkViewPull;
            toolTipLink.SetToolTip(_NO_TRANSLATE_lblLinkViewPull, _linkLabelToolTip.Text);

            InitializeComplete();
        }
Exemple #2
0
        private void PopulateBranches()
        {
            Branch_ComboBox.Items.Clear();

            var branches = _gitCommands.GetRefs(false);

            string[] branchNames;
            branchNames = branches.Select(b => b.Name).Where(name => name.IsNotNullOrWhitespace()).ToArray();

            Branch_ComboBox.Items.AddRange(branchNames);

            for (int i = 0; i < branches.Count; ++i)
            {
                if (branches[i].Name == _gitCommands.GetSelectedBranch())
                {
                    Branch_ComboBox.SelectedIndex = i;
                }
            }
        }
Exemple #3
0
        public ZipperForm(ZipperPlugin plugin, ISettingsSource settings, GitUIEventArgs gitUiCommands)
        {
            InitializeComponent();
            Translate();

            Text            = _pluginDescription.Text;
            _plugin         = plugin;
            _settings       = settings;
            _gitCommands    = gitUiCommands.GitModule;
            _originalBranch = _gitCommands.GetSelectedBranch();
            _entriesAdded   = 0;
        }