From 16ac87d9ceea159b84555fdd716641b611338b38 Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Thu, 13 Jul 2017 20:34:16 +0300 Subject: [PATCH] Refactor --- DiscordChatExporter/Models/MessageGroup.cs | 22 +++++++++++++++++++ DiscordChatExporter/Services/ExportService.cs | 19 +--------------- 2 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 DiscordChatExporter/Models/MessageGroup.cs diff --git a/DiscordChatExporter/Models/MessageGroup.cs b/DiscordChatExporter/Models/MessageGroup.cs new file mode 100644 index 00000000..e1ec0f9d --- /dev/null +++ b/DiscordChatExporter/Models/MessageGroup.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace DiscordChatExporter.Models +{ + public class MessageGroup + { + public MessageGroup(User author, DateTime firstTimeStamp, IEnumerable messages) + { + Author = author; + FirstTimeStamp = firstTimeStamp; + Messages = messages.ToArray(); + } + + public User Author { get; } + + public DateTime FirstTimeStamp { get; } + + public IReadOnlyList Messages { get; } + } +} \ No newline at end of file diff --git a/DiscordChatExporter/Services/ExportService.cs b/DiscordChatExporter/Services/ExportService.cs index a798e6c1..d4ac7e58 100644 --- a/DiscordChatExporter/Services/ExportService.cs +++ b/DiscordChatExporter/Services/ExportService.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text.RegularExpressions; @@ -11,22 +10,6 @@ namespace DiscordChatExporter.Services { public class ExportService { - private class MessageGroup - { - public User Author { get; } - - public DateTime FirstTimeStamp { get; } - - public IReadOnlyList Messages { get; } - - public MessageGroup(User author, DateTime firstTimeStamp, IEnumerable messages) - { - Author = author; - FirstTimeStamp = firstTimeStamp; - Messages = messages.ToArray(); - } - } - private HtmlDocument GetTemplate() { const string templateName = "DiscordChatExporter.Services.ExportTemplate.html";