chore: add IMainWindow, IProtocolHandler
This commit is contained in:
parent
80ecbb1212
commit
03769b50e8
|
|
@ -3,7 +3,7 @@
|
||||||
namespace Kiseki.Launcher.Windows
|
namespace Kiseki.Launcher.Windows
|
||||||
{
|
{
|
||||||
[System.ComponentModel.DesignerCategory("")]
|
[System.ComponentModel.DesignerCategory("")]
|
||||||
public class MainWindow : Form
|
public class MainWindow : Form, IMainWindow
|
||||||
{
|
{
|
||||||
private readonly TaskDialogButton CloseButton;
|
private readonly TaskDialogButton CloseButton;
|
||||||
private readonly TaskDialogPage Page;
|
private readonly TaskDialogPage Page;
|
||||||
|
|
@ -83,5 +83,20 @@ namespace Kiseki.Launcher.Windows
|
||||||
|
|
||||||
TaskDialog.ShowDialog(Page);
|
TaskDialog.ShowDialog(Page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Register()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Unregister()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateShortcuts()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
namespace Kiseki.Launcher.Windows
|
||||||
|
{
|
||||||
|
public class ProtocolHandler : IProtocolHandler
|
||||||
|
{
|
||||||
|
public void Register()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Unregister()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -24,19 +24,19 @@ namespace Kiseki.Launcher
|
||||||
|
|
||||||
public async void Start()
|
public async void Start()
|
||||||
{
|
{
|
||||||
this.OnPageHeadingChange("Connecting to Kiseki...");
|
OnPageHeadingChange("Connecting to Kiseki...");
|
||||||
|
|
||||||
bool marquee = true;
|
bool marquee = true;
|
||||||
await foreach (int progressValue in StreamBackgroundOperationProgressAsync())
|
await foreach (int progressValue in StreamBackgroundOperationProgressAsync())
|
||||||
{
|
{
|
||||||
if (marquee)
|
if (marquee)
|
||||||
{
|
{
|
||||||
this.OnPageHeadingChange("Downloading Kiseki...");
|
OnPageHeadingChange("Downloading Kiseki...");
|
||||||
this.OnProgressBarStateChanged(ProgressBarState.Normal);
|
OnProgressBarStateChanged(ProgressBarState.Normal);
|
||||||
marquee = false;
|
marquee = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.OnProgressBarChange(progressValue);
|
OnProgressBarChange(progressValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async IAsyncEnumerable<int> StreamBackgroundOperationProgressAsync()
|
static async IAsyncEnumerable<int> StreamBackgroundOperationProgressAsync()
|
||||||
|
|
@ -50,22 +50,22 @@ namespace Kiseki.Launcher
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.OnPageHeadingChange("Installing Kiseki...");
|
OnPageHeadingChange("Installing Kiseki...");
|
||||||
this.OnProgressBarStateChanged(ProgressBarState.Marquee);
|
OnProgressBarStateChanged(ProgressBarState.Marquee);
|
||||||
|
|
||||||
await Task.Delay(2200);
|
await Task.Delay(2200);
|
||||||
this.OnPageHeadingChange("Configuring Kiseki...");
|
OnPageHeadingChange("Configuring Kiseki...");
|
||||||
|
|
||||||
await Task.Delay(1200);
|
await Task.Delay(1200);
|
||||||
this.OnPageHeadingChange("Launching Kiseki...");
|
OnPageHeadingChange("Launching Kiseki...");
|
||||||
|
|
||||||
await Task.Delay(3000);
|
await Task.Delay(3000);
|
||||||
this.OnLaunched();
|
OnLaunched();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void Dispose()
|
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)
|
protected virtual void OnPageHeadingChange(string Heading)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
namespace Kiseki.Launcher
|
||||||
|
{
|
||||||
|
interface IProtocolHandler
|
||||||
|
{
|
||||||
|
void Register();
|
||||||
|
void Unregister();
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IMainWindow
|
||||||
|
{
|
||||||
|
void Register();
|
||||||
|
void Unregister();
|
||||||
|
void CreateShortcuts();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue