Small clenaup

pull/145/head
Oleksii Holub 6 years ago
parent b6fcbac030
commit 659c499bd0

@ -3,10 +3,15 @@ using Stylet;
namespace DiscordChatExporter.Gui.ViewModels.Components namespace DiscordChatExporter.Gui.ViewModels.Components
{ {
public class ChannelViewModel : PropertyChangedBase public partial class ChannelViewModel : PropertyChangedBase
{ {
public Channel Model { get; set; } public Channel Model { get; set; }
public string Category { get; set; } public string Category { get; set; }
} }
public partial class ChannelViewModel
{
public static implicit operator Channel(ChannelViewModel viewModel) => viewModel.Model;
}
} }

@ -4,10 +4,15 @@ using Stylet;
namespace DiscordChatExporter.Gui.ViewModels.Components namespace DiscordChatExporter.Gui.ViewModels.Components
{ {
public class GuildViewModel : PropertyChangedBase public partial class GuildViewModel : PropertyChangedBase
{ {
public Guild Model { get; set; } public Guild Model { get; set; }
public IReadOnlyList<ChannelViewModel> Channels { get; set; } public IReadOnlyList<ChannelViewModel> Channels { get; set; }
} }
public partial class GuildViewModel
{
public static implicit operator Guild(GuildViewModel viewModel) => viewModel.Model;
}
} }

@ -60,7 +60,7 @@ namespace DiscordChatExporter.Gui.ViewModels.Dialogs
To = From; To = From;
// Generate default file name // Generate default file name
var defaultFileName = ExportHelper.GetDefaultExportFileName(SelectedFormat, Guild.Model, Channel.Model, From, To); var defaultFileName = ExportHelper.GetDefaultExportFileName(SelectedFormat, Guild, Channel, From, To);
// Prompt for output file path // Prompt for output file path
var ext = SelectedFormat.GetFileExtension(); var ext = SelectedFormat.GetFileExtension();

@ -260,8 +260,8 @@ namespace DiscordChatExporter.Gui.ViewModels
var progressHandler = new Progress<double>(p => Progress = p); var progressHandler = new Progress<double>(p => Progress = p);
// Get chat log // Get chat log
var chatLog = await _dataService.GetChatLogAsync(token, dialog.Guild.Model, dialog.Channel.Model, var chatLog = await _dataService.GetChatLogAsync(token, dialog.Guild, dialog.Channel, dialog.From,
dialog.From, dialog.To, progressHandler); dialog.To, progressHandler);
// Export // Export
_exportService.ExportChatLog(chatLog, dialog.FilePath, dialog.SelectedFormat, _exportService.ExportChatLog(chatLog, dialog.FilePath, dialog.SelectedFormat,

Loading…
Cancel
Save