|
|
@ -10,14 +10,14 @@ namespace DiscordChatExporter.Views
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public partial class ExportSetupDialog
|
|
|
|
public partial class ExportSetupDialog
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
private IExportSetupViewModel ViewModel => (IExportSetupViewModel) DataContext;
|
|
|
|
|
|
|
|
|
|
|
|
public ExportSetupDialog()
|
|
|
|
public ExportSetupDialog()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private IExportSetupViewModel ViewModel => (IExportSetupViewModel) DataContext;
|
|
|
|
private string GetFilter()
|
|
|
|
|
|
|
|
|
|
|
|
private string GetOutputFileFilter()
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var filters = new List<string>();
|
|
|
|
var filters = new List<string>();
|
|
|
|
foreach (var format in ViewModel.AvailableFormats)
|
|
|
|
foreach (var format in ViewModel.AvailableFormats)
|
|
|
@ -29,12 +29,17 @@ namespace DiscordChatExporter.Views
|
|
|
|
return filters.JoinToString("|");
|
|
|
|
return filters.JoinToString("|");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void LocateFilePathButton_Click(object sender, RoutedEventArgs args)
|
|
|
|
public void ExportButton_Click(object sender, RoutedEventArgs args)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DialogHost.CloseDialogCommand.Execute(null, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void BrowseButton_Click(object sender, RoutedEventArgs args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var sfd = new SaveFileDialog
|
|
|
|
var sfd = new SaveFileDialog
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FileName = ViewModel.FilePath,
|
|
|
|
FileName = ViewModel.FilePath,
|
|
|
|
Filter = GetOutputFileFilter(),
|
|
|
|
Filter = GetFilter(),
|
|
|
|
FilterIndex = ViewModel.AvailableFormats.IndexOf(ViewModel.SelectedFormat) + 1,
|
|
|
|
FilterIndex = ViewModel.AvailableFormats.IndexOf(ViewModel.SelectedFormat) + 1,
|
|
|
|
AddExtension = true,
|
|
|
|
AddExtension = true,
|
|
|
|
Title = "Select output file"
|
|
|
|
Title = "Select output file"
|
|
|
@ -46,10 +51,5 @@ namespace DiscordChatExporter.Views
|
|
|
|
ViewModel.SelectedFormat = ViewModel.AvailableFormats[sfd.FilterIndex - 1];
|
|
|
|
ViewModel.SelectedFormat = ViewModel.AvailableFormats[sfd.FilterIndex - 1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ExportButton_Click(object sender, RoutedEventArgs args)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DialogHost.CloseDialogCommand.Execute(null, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|