public static Uri DisplayBrowseDialogAndGetResult(WizardPage page, SvnItem target, Uri baseUri) { IAnkhServiceProvider context = ((MergeWizard)page.Wizard).Context; if (((MergeWizard)page.Wizard).MergeTarget.IsDirectory) { using (RepositoryFolderBrowserDialog dlg = new RepositoryFolderBrowserDialog()) { dlg.SelectedUri = baseUri; if (dlg.ShowDialog(context) == DialogResult.OK) { return dlg.SelectedUri; } } } else { using (RepositoryOpenDialog dlg = new RepositoryOpenDialog()) { string fileName = Path.GetFileName(target.FullPath); dlg.Context = context; dlg.Filter = fileName + "|" + fileName + "|All Files (*.*)|*"; dlg.SelectedUri = baseUri; if (dlg.ShowDialog(context) == DialogResult.OK) return dlg.SelectedUri; } } return null; }
private void toUrlBrowse_Click(object sender, EventArgs e) { using (RepositoryFolderBrowserDialog dlg = new RepositoryFolderBrowserDialog()) { dlg.RootUri = RootUri; dlg.EnableNewFolderButton = true; Uri r; if (Uri.TryCreate(toUrlBox.Text, UriKind.Absolute, out r)) dlg.SelectedUri = r; if (dlg.ShowDialog(Context) == DialogResult.OK) { if (dlg.SelectedUri != null) toUrlBox.Text = dlg.SelectedUri.AbsoluteUri; } } }
private void browseUrl_Click(object sender, EventArgs e) { using (RepositoryFolderBrowserDialog dlg = new RepositoryFolderBrowserDialog()) { dlg.SelectedUri = SwitchToUri; if (dlg.ShowDialog(Context) == DialogResult.OK) { if (dlg.SelectedUri != null) SwitchToUri = dlg.SelectedUri; } } }
private void browseButton_Click(object sender, EventArgs e) { using (RepositoryFolderBrowserDialog dlg = new RepositoryFolderBrowserDialog()) { SvnOrigin from = SelectedTarget; if (from == null) return; dlg.ShowFiles = true; SvnUriTarget ut = from.Target as SvnUriTarget; if (ut != null) dlg.SelectedUri = ut.Uri; else { SvnItem file = GetService<IFileStatusCache>()[((SvnPathTarget)from.Target).FullPath]; if (file.Uri == null) dlg.SelectedUri = from.RepositoryRoot; else dlg.SelectedUri = file.Uri; } if (dlg.ShowDialog(Context) == DialogResult.OK) { Uri selectedUri = dlg.SelectedUri; SvnOrigin o = new SvnOrigin(Context, selectedUri, null); targetBox.Items.Add(o); targetBox.SelectedItem = o; } } }
private void urlBrowse_Click(object sender, EventArgs e) { using (RepositoryFolderBrowserDialog dlg = new RepositoryFolderBrowserDialog()) { dlg.Context = Context; dlg.SelectedUri = Uri; if (dlg.ShowDialog(Context) == DialogResult.OK) Uri = dlg.SelectedUri; } }