Exemplo n.º 1
0
        void ShowAddUriDialog()
        {
            Uri dirUri;

            /*
             * using (AddRepositoryRootDialog dlg = new AddRepositoryRootDialog())
             * {
             *  if (dlg.ShowDialog(Context) != DialogResult.OK || dlg.Uri == null)
             *      return;
             *
             *  dirUri = dlg.Uri;
             * }
             */
            using (RepositorySelectionWizard dialog = new RepositorySelectionWizard(Context))
            {
                DialogResult result = dialog.ShowDialog(Context);
                if (result != DialogResult.OK)
                {
                    return;
                }
                dirUri = dialog.GetSelectedRepositoryUri();
            }
            AnkhAction action = delegate
            {
                CheckResult(dirUri, true);
            };

            action.BeginInvoke(null, null);
        }
Exemplo n.º 2
0
        private void selectRepositoryButton_Click(object sender, EventArgs e)
        {
            Uri dirUri;

            using (RepositorySelectionWizard dialog = new RepositorySelectionWizard(Context))
            {
                DialogResult result = dialog.ShowDialog(Context);
                if (result != DialogResult.OK)
                {
                    return;
                }
                dirUri = dialog.GetSelectedRepositoryUri();
            }
            if (dirUri != null)
            {
                this.repositoryUrl.Text = dirUri.AbsoluteUri;
                repositoryTree.AddRoot(dirUri);
            }
        }
Exemplo n.º 3
0
        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);
                }
            }
        }