コード例 #1
0
ファイル: VersionSelector.cs プロジェクト: windygu/AnkhSVN
        void SetRevision(AnkhRevisionType rev)
        {
            if (rev == null && _currentRevType == null)
            {
                return;
            }
            else if (rev != null && _currentRevType != null && rev.Equals(_currentRevType))
            {
                return;
            }

            if (_revTypes == null)
            {
                _revTypes = new List <AnkhRevisionType>();
            }

            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;
        }
コード例 #2
0
ファイル: VersionSelector.cs プロジェクト: necora/ank_git
        void SetRevision(AnkhRevisionType rev)
        {
            if (rev == null && _currentRevType == null)
                return;
            else if (rev != null && _currentRevType != null && rev.Equals(_currentRevType))
                return;

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

            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;
        }