chore: add IMainWindow, IProtocolHandler

This commit is contained in:
rjindael 2023-07-28 06:19:11 -07:00
parent 80ecbb1212
commit 03769b50e8
No known key found for this signature in database
GPG Key ID: D069369C906CCF31
4 changed files with 56 additions and 11 deletions

View File

@ -3,7 +3,7 @@
namespace Kiseki.Launcher.Windows
{
[System.ComponentModel.DesignerCategory("")]
public class MainWindow : Form
public class MainWindow : Form, IMainWindow
{
private readonly TaskDialogButton CloseButton;
private readonly TaskDialogPage Page;
@ -83,5 +83,20 @@ namespace Kiseki.Launcher.Windows
TaskDialog.ShowDialog(Page);
}
public void Register()
{
throw new NotImplementedException();
}
public void Unregister()
{
throw new NotImplementedException();
}
public void CreateShortcuts()
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,15 @@
namespace Kiseki.Launcher.Windows
{
public class ProtocolHandler : IProtocolHandler
{
public void Register()
{
throw new NotImplementedException();
}
public void Unregister()
{
throw new NotImplementedException();
}
}
}

View File

@ -24,19 +24,19 @@ namespace Kiseki.Launcher
public async void Start()
{
this.OnPageHeadingChange("Connecting to Kiseki...");
OnPageHeadingChange("Connecting to Kiseki...");
bool marquee = true;
await foreach (int progressValue in StreamBackgroundOperationProgressAsync())
{
if (marquee)
{
this.OnPageHeadingChange("Downloading Kiseki...");
this.OnProgressBarStateChanged(ProgressBarState.Normal);
OnPageHeadingChange("Downloading Kiseki...");
OnProgressBarStateChanged(ProgressBarState.Normal);
marquee = false;
}
this.OnProgressBarChange(progressValue);
OnProgressBarChange(progressValue);
}
static async IAsyncEnumerable<int> StreamBackgroundOperationProgressAsync()
@ -50,22 +50,22 @@ namespace Kiseki.Launcher
}
}
this.OnPageHeadingChange("Installing Kiseki...");
this.OnProgressBarStateChanged(ProgressBarState.Marquee);
OnPageHeadingChange("Installing Kiseki...");
OnProgressBarStateChanged(ProgressBarState.Marquee);
await Task.Delay(2200);
this.OnPageHeadingChange("Configuring Kiseki...");
OnPageHeadingChange("Configuring Kiseki...");
await Task.Delay(1200);
this.OnPageHeadingChange("Launching Kiseki...");
OnPageHeadingChange("Launching Kiseki...");
await Task.Delay(3000);
this.OnLaunched();
OnLaunched();
}
public async void Dispose()
{
//
// TODO: This will only be called when the user closes the window OR we're done (i.e. the Launched event is called.)
}
protected virtual void OnPageHeadingChange(string Heading)

View File

@ -0,0 +1,15 @@
namespace Kiseki.Launcher
{
interface IProtocolHandler
{
void Register();
void Unregister();
}
interface IMainWindow
{
void Register();
void Unregister();
void CreateShortcuts();
}
}