public RepositoryExplorerToolWindow() { Caption = Resources.RepositoryExplorerToolWindowTitle; Control = new RepositoryExplorerControl(); AnkhToolWindow = AnkhToolWindow.RepositoryExplorer; ToolBarId = (AnkhToolBar)AnkhCommandMenu.RepositoryExplorerToolBar; ToolBarLocation = (int)VSTWT_LOCATION.VSTWT_TOP; }
public void OnUpdate(CommandUpdateEventArgs e) { bool enabled = false; RepositoryExplorerControl ctrl = e.Selection.ActiveDialogOrFrameControl as RepositoryExplorerControl; if (ctrl != null) { Uri uri = ctrl.SelectedUri; enabled = uri != null; } e.Enabled = enabled; }
public void OnUpdate(CommandUpdateEventArgs e) { if (_ctrl == null) { _ctrl = e.GetService <RepositoryExplorerControl>(); } if (_ctrl == null) { e.Enabled = e.Visible = false; return; } }
public override void OnExecute(CommandEventArgs e) { IAnkhPackage package = e.Context.GetService <IAnkhPackage>(); AnkhToolWindow toolWindow; switch (e.Command) { case AnkhCommand.ShowPendingChanges: toolWindow = AnkhToolWindow.PendingChanges; break; case AnkhCommand.ShowWorkingCopyExplorer: toolWindow = AnkhToolWindow.WorkingCopyExplorer; break; case AnkhCommand.ShowRepositoryExplorer: toolWindow = AnkhToolWindow.RepositoryExplorer; break; case AnkhCommand.ShowSubversionInfo: toolWindow = AnkhToolWindow.SvnInfo; break; default: return; } package.ShowToolWindow(toolWindow); if (e.Command == AnkhCommand.ShowRepositoryExplorer) { IAnkhSolutionSettings ss = e.GetService <IAnkhSolutionSettings>(); if (ss.ProjectRootUri != null) { RepositoryExplorerControl ctrl = e.Selection.ActiveDialogOrFrameControl as RepositoryExplorerControl; if (ctrl != null) { ctrl.AddRoot(ss.ProjectRootUri); } } } }
public void OnExecute(CommandEventArgs e) { Uri info; if (e.Argument is string) { string arg = (string)e.Argument; info = null; if (SvnItem.IsValidPath(arg, true)) { SvnItem item = e.GetService <ISvnStatusCache>()[arg]; if (item.IsVersioned) { info = item.Uri; if (item.IsFile) { info = new Uri(info, "./"); } } } if (info == null) { info = new Uri((string)e.Argument); } } else if (e.Argument is Uri) { info = (Uri)e.Argument; } else { using (RepositorySelectionWizard wizard = new RepositorySelectionWizard(e.Context)) { if (wizard.ShowDialog(e.Context) != DialogResult.OK) { return; } info = wizard.GetSelectedRepositoryUri(); } } if (info != null) { RepositoryExplorerControl ctrl = e.Selection.ActiveDialogOrFrameControl as RepositoryExplorerControl; if (ctrl == null) { IAnkhPackage pkg = e.GetService <IAnkhPackage>(); pkg.ShowToolWindow(AnkhToolWindow.RepositoryExplorer); } ctrl = e.Selection.ActiveDialogOrFrameControl as RepositoryExplorerControl; if (ctrl != null) { ctrl.AddRoot(info); } } }
public void OnExecute(CommandEventArgs e) { RepositoryExplorerControl ctrl = e.Selection.ActiveDialogOrFrameControl as RepositoryExplorerControl; ctrl.RemoveRootOf(ctrl.SelectedUri); }