mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.Logging;
|
|
using Wabbajack.DTOs.Interventions;
|
|
using Wabbajack.Interventions;
|
|
using Wabbajack.Models;
|
|
using Wabbajack.WebAutomation;
|
|
|
|
namespace Wabbajack.UserIntervention;
|
|
|
|
public abstract class WebUserInterventionBase<T>
|
|
where T : IUserIntervention
|
|
{
|
|
protected readonly WebBrowserVM Browser;
|
|
protected readonly ILogger Logger;
|
|
protected T Message;
|
|
protected ViewModel PrevPane;
|
|
protected IWebDriver Driver;
|
|
|
|
protected WebUserInterventionBase(ILogger logger, WebBrowserVM browser, CefService service)
|
|
{
|
|
Logger = logger;
|
|
Browser = browser;
|
|
Driver = new CefSharpWrapper(logger, browser.Browser, service);
|
|
}
|
|
|
|
public void Configure(ViewModel prevPane, T message)
|
|
{
|
|
Message = message;
|
|
PrevPane = prevPane;
|
|
}
|
|
|
|
protected void UpdateStatus(string status)
|
|
{
|
|
Browser.Instructions = status;
|
|
}
|
|
|
|
protected async Task NavigateTo(Uri uri)
|
|
{
|
|
await Driver.NavigateTo(uri, Message.Token);
|
|
}
|
|
|
|
public abstract Task Begin();
|
|
|
|
} |