private bool ExportToFile(RegKey key, RegExportFormat format, Stream output) { bool success = true; using (output) { DisableControls(); try { using (new BusyCursor(this)) { using (StreamWriter writer = new StreamWriter(output)) { RegExporter.Export(key, ExportProvider.Create(format, writer)); } } } catch { success = false; } EnableControls(); } return(success); }