Beispiel #1
0
        void SetRevision(VisualGitRevisionType rev)
        {
            if (rev == null && _currentRevType == null)
                return;
            else if (rev != null && _currentRevType != null && rev.Equals(_currentRevType))
                return;

            if (_revTypes == null)
                _revTypes = new List<VisualGitRevisionType>();

            if (_currentRevType != null && !_revTypes.Contains(_currentRevType))
                _revTypes.Add(_currentRevType);

            if (rev != null && !_revTypes.Contains(rev))
                _revTypes.Add(rev);

            _currentRevType = rev;

            EnsureList();

            foreach (Control c in versionTypePanel.Controls)
            {
                c.Enabled = c.Visible = false;
            }

            if (rev.HasUI)
            {
                if (rev.CurrentControl == null)
                    rev.InstantiateUIIn(versionTypePanel, EventArgs.Empty);

                rev.CurrentControl.Visible = rev.CurrentControl.Enabled = true;
            }

            typeCombo.SelectedItem = _currentRevType;
        }