예제 #1
0
        public void LoadFromClient(GitClient client)
        {
            tagBox.BeginUpdate();
            tagBox.Items.Clear();

            foreach (var @ref in client.GetRefs(RepositoryPath))
            {
                switch (@ref.Type)
                {
                    case GitRefType.Tag:
                        tagBox.Items.Add(@ref.ShortName);
                        break;
                }
            }

            if (tagBox.Items.Count > 0)
                tagBox.SelectedIndex = 0;

            tagBox.EndUpdate();
        }
예제 #2
0
        public void LoadFromClient(GitClient client)
        {
            localBox.BeginUpdate();
            remoteBox.BeginUpdate();

            localBox.Items.Clear();
            remoteBox.Items.Clear();

            var currentBranch = client.GetCurrentBranch(RepositoryPath);

            foreach (var @ref in client.GetRefs(RepositoryPath))
            {
                if (@ref.Type == GitRefType.Branch)
                {
                    remoteBox.Items.Add(@ref.ShortName);
                    localBox.Items.Add(@ref.ShortName);

                    if (@ref == currentBranch)
                    {
                        remoteBox.SelectedIndex = remoteBox.Items.Count - 1;
                        localBox.SelectedIndex = remoteBox.Items.Count - 1;
                    }
                }
            }

            localBox.EndUpdate();
            remoteBox.EndUpdate();
        }