2022-03-13 22:47:30 +00:00
|
|
|
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;
|
2022-03-13 23:08:27 +00:00
|
|
|
//Driver = new CefSharpWrapper(logger, browser.Browser, service);
|
2022-03-13 22:47:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
}
|