bloxstrap/Bloxstrap/Enums/BootstrapperStyle.cs
pizzaboxer abd56959f2 Fix bug with Bloxstrap not staying open
looks like my dumbass completely forgot why i used application.run to begin with
2023-02-03 21:31:36 +00:00

58 lines
1.4 KiB
C#

using System.Windows.Forms;
using Bloxstrap.Dialogs;
namespace Bloxstrap.Enums
{
public enum BootstrapperStyle
{
VistaDialog,
LegacyDialog2009,
LegacyDialog2011,
ProgressDialog,
}
public static class BootstrapperStyleEx
{
public static void Show(this BootstrapperStyle bootstrapperStyle, Bootstrapper? bootstrapper = null)
{
Form dialog;
switch (bootstrapperStyle)
{
case BootstrapperStyle.VistaDialog:
dialog = new VistaDialog(bootstrapper);
break;
case BootstrapperStyle.LegacyDialog2009:
dialog = new LegacyDialog2009(bootstrapper);
break;
case BootstrapperStyle.LegacyDialog2011:
dialog = new LegacyDialog2011(bootstrapper);
break;
case BootstrapperStyle.ProgressDialog:
default:
dialog = new ProgressDialog(bootstrapper);
break;
}
if (bootstrapper is null)
{
dialog.ShowDialog();
}
else
{
if (App.IsQuiet)
{
dialog.Opacity = 0;
dialog.ShowInTaskbar = false;
}
Application.Run(dialog);
}
}
}
}