void Checkout_Click(object sender, RoutedEventArgs e) { var dialog = new CheckoutDialog { Owner = this }; dialog.ShowDialog(); }
public override void OnExecute(CommandEventArgs e) { ISvnRepositoryItem selected = EnumTools.GetSingle(e.Selection.GetSelection <ISvnRepositoryItem>()); if (selected == null) { return; } Uri uri = selected.Uri; string name = selected.Origin.Target.FileName; IAnkhSolutionSettings ss = e.GetService <IAnkhSolutionSettings>(); using (CheckoutDialog dlg = new CheckoutDialog()) { dlg.Context = e.Context; dlg.Uri = uri; dlg.RepositoryRoot = selected.Origin.RepositoryRoot; dlg.LocalPath = System.IO.Path.Combine(ss.NewProjectLocation, name); if (dlg.ShowDialog(e.Context) != DialogResult.OK) { return; } e.GetService <IProgressRunner>().RunModal(CommandStrings.CheckingOut, delegate(object sender, ProgressWorkerArgs a) { SvnCheckOutArgs args = new SvnCheckOutArgs(); args.Revision = dlg.Revision; args.Depth = dlg.Recursive ? SvnDepth.Infinity : SvnDepth.Files; args.IgnoreExternals = dlg.IgnoreExternals; a.Client.CheckOut(dlg.Uri, dlg.LocalPath, args); }); } }