2022-01-20 08:34:38 +00:00
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using Microsoft.WindowsAPICodePack.Dialogs;
|
|
|
|
|
using Wabbajack.App.Blazor.State;
|
|
|
|
|
using Wabbajack.Common;
|
|
|
|
|
using Wabbajack.Paths;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.App.Blazor.Pages;
|
|
|
|
|
|
2022-01-27 07:55:07 +00:00
|
|
|
|
public partial class Select
|
2022-01-20 08:34:38 +00:00
|
|
|
|
{
|
2022-01-21 13:41:37 +00:00
|
|
|
|
[Inject] private NavigationManager NavigationManager { get; set; } = default!;
|
|
|
|
|
[Inject] private IStateContainer StateContainer { get; set; } = default!;
|
2022-01-20 08:34:38 +00:00
|
|
|
|
|
|
|
|
|
private void SelectFile()
|
|
|
|
|
{
|
|
|
|
|
using (var dialog = new CommonOpenFileDialog())
|
|
|
|
|
{
|
|
|
|
|
dialog.Multiselect = false;
|
|
|
|
|
dialog.Filters.Add(new CommonFileDialogFilter("Wabbajack File", "*" + Ext.Wabbajack));
|
|
|
|
|
if (dialog.ShowDialog() != CommonFileDialogResult.Ok) return;
|
2022-01-21 13:41:37 +00:00
|
|
|
|
StateContainer.ModlistPath = dialog.FileName.ToAbsolutePath();
|
2022-01-20 08:34:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-01-21 13:41:37 +00:00
|
|
|
|
NavigationManager.NavigateTo(Configure.Route);
|
2022-01-20 08:34:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|