protected void OnExport() { VersionControlItem vcitem = GetItems()[0]; MercurialRepository repo = ((MercurialRepository)vcitem.Repository); FileChooserDialog fsd = new FileChooserDialog(GettextCatalog.GetString("Choose export location"), null, FileChooserAction.Save, "Cancel", ResponseType.Cancel, "Save", ResponseType.Accept); fsd.SetCurrentFolder(vcitem.Path.FullPath.ParentDirectory); try { if ((int)Gtk.ResponseType.Accept == fsd.Run() && !string.IsNullOrEmpty(fsd.Filename)) { MercurialTask worker = new MercurialTask(); worker.Description = string.Format("Exporting to {0}", fsd.Filename); worker.Operation = delegate { repo.Export(vcitem.Path, fsd.Filename, worker.ProgressMonitor); }; worker.Start(); } } finally { fsd.Destroy(); } } // OnExport