private static bool Export(string[] args) { // validate arguments if (args.Length < 3) { Console.WriteLine("ERROR - Invalid number of arguments."); Console.WriteLine(); return(false); } // get export parameters string appName = args[1]; string fileName = args[2]; // export the SSO application configuration file try { SSOManager.ExportApplication(appName, fileName); Console.WriteLine("SSO application successfully exported."); return(true); } catch (Exception ex) { Console.WriteLine("ERROR - An error has occurred exporting the SSO application."); Console.WriteLine(""); Console.WriteLine(ex); return(false); } }
protected void Export(string appName) { using (SaveFileDialog saveFileDialog = new SaveFileDialog()) { saveFileDialog.CheckPathExists = true; saveFileDialog.Filter = "SSO Application Config files (*.xml)|*.xml|All files (*.*)|*.*"; saveFileDialog.DefaultExt = "*.xml"; saveFileDialog.FileName = appName + ".xml"; saveFileDialog.Title = "Export SSO Application Configuration"; if (this.SnapIn.Console.ShowDialog(saveFileDialog) == DialogResult.OK) { SSOManager.ExportApplication(appName, saveFileDialog.FileName); } } }