/// <summary> /// Export the provided parsed changelists to the provided file name in the provided format /// </summary> /// <param name="InExportFormat">Format to export to</param> /// <param name="InExportChangelists">Changelists to export</param> /// <param name="InExportFileName">Filename to export to</param> public static void Export(EExportFormats InExportFormat, List <P4ParsedChangelist> InExportChangelists, String InExportFileName) { switch (InExportFormat) { case EExportFormats.EF_Xml: ExportXml(InExportChangelists, InExportFileName); break; case EExportFormats.EF_Html: ExportHtml(InExportChangelists, InExportFileName); break; case EExportFormats.EF_PlainText: { // Generate plain text output var ReportSettings = new OutputFormatter.ReportSettings(); { ReportSettings.Format = InExportFormat; } string ReportString; OutputFormatter.GenerateReportFromChanges(ReportSettings, InExportChangelists, out ReportString); // Save the report to disk { StreamWriter FileStreamWriter = null; try { FileStreamWriter = new StreamWriter(InExportFileName); FileStreamWriter.Write(ReportString); } catch (IOException E) { Console.WriteLine("IO error while attempting to export to file {0}", E.Message); } finally { FileStreamWriter.Close(); } } } break; } }
/// <summary> /// Export the provided parsed changelists to the provided file name in the provided format /// </summary> /// <param name="InExportFormat">Format to export to</param> /// <param name="InExportChangelists">Changelists to export</param> /// <param name="InExportFileName">Filename to export to</param> public static void Export(EExportFormats InExportFormat, List<P4ParsedChangelist> InExportChangelists, String InExportFileName) { switch( InExportFormat ) { case EExportFormats.EF_Xml: ExportXml( InExportChangelists, InExportFileName ); break; case EExportFormats.EF_Html: ExportHtml( InExportChangelists, InExportFileName ); break; case EExportFormats.EF_PlainText: { // Generate plain text output var ReportSettings = new OutputFormatter.ReportSettings(); { ReportSettings.Format = InExportFormat; } string ReportString; OutputFormatter.GenerateReportFromChanges( ReportSettings, InExportChangelists, out ReportString ); // Save the report to disk { StreamWriter FileStreamWriter = null; try { FileStreamWriter = new StreamWriter( InExportFileName ); FileStreamWriter.Write( ReportString ); } catch( IOException E ) { Console.WriteLine( "IO error while attempting to export to file {0}", E.Message ); } finally { FileStreamWriter.Close(); } } } break; } }