public SourceControlWindow(IManager manager) { InitializeComponent(); mManager = manager; if (mManager.Project.VCS != null) { mVCS = (IVersionController)mManager.Project.VCS.Clone(); } propertyGrid.SelectedObject = mVCS; comboBoxVCSType.Items.Add(new VCSInfo(null)); if (mVCS == null) { comboBoxVCSType.SelectedIndex = 0; } foreach (Type type in mManager.GetPluginImplementations(typeof(IVersionController))) { VCSInfo info = new VCSInfo(type); comboBoxVCSType.Items.Add(info); if (mVCS != null && mVCS.GetType() == type) { comboBoxVCSType.SelectedItem = info; } } UpdateControls(); }
private void UpdateControls() { VCSInfo info = (VCSInfo)comboBoxVCSType.SelectedItem; if (info.Type == null) { mVCS = null; } else { mVCS = (IVersionController)Activator.CreateInstance(info.Type, new object[] { }); } propertyGrid.SelectedObject = mVCS; if (mVCS == null) { labelVCSInfo.Text = ""; labelVCSInfo.Visible = false; propertyGrid.Visible = false; } else { labelVCSInfo.Text = mVCS.ConfigurationMessage; labelVCSInfo.Visible = true; propertyGrid.Visible = true; } }
public SourceControlWindow(IManager manager) { InitializeComponent(); mManager = manager; if(mManager.Project.VCS != null) mVCS = (IVersionController) mManager.Project.VCS.Clone(); propertyGrid.SelectedObject = mVCS; comboBoxVCSType.Items.Add(new VCSInfo(null)); if (mVCS == null) comboBoxVCSType.SelectedIndex = 0; foreach (Type type in mManager.GetPluginImplementations(typeof(IVersionController))) { VCSInfo info = new VCSInfo(type); comboBoxVCSType.Items.Add(info); if (mVCS != null && mVCS.GetType() == type) comboBoxVCSType.SelectedItem = info; } UpdateControls(); }