Exemplo n.º 1
0
        public async Task <(Stream, string)> GenerateToStreamAsync(int year, int month, ExportFormat format = ExportFormat.TXT)
        {
            Report report = await CreateReport(year, month);

            if (SupportedExporters.ContainsKey(format) == false)
            {
                // TODO: Необходимо вернуть что-то дружелюбное
                return(null, null);
            }
            IReportExporter exporter = SupportedExporters[format];

            exporter.SetReport(report);
            return(await exporter.ExportAsync(), exporter.Extension);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Exports the asynchronous.
 /// </summary>
 /// <param name="modHashes">The mod hashes.</param>
 /// <param name="path">The path.</param>
 /// <returns>Task&lt;System.Boolean&gt;.</returns>
 public Task <bool> ExportAsync(IEnumerable <IHashReport> modHashes, string path)
 {
     return(reportExporter.ExportAsync(modHashes, path));
 }