mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-22 02:21:27 -07:00
42 lines
1.2 KiB
C#
42 lines
1.2 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)
|
|
{
|
|
IBootstrapperDialog dialog = bootstrapperStyle switch
|
|
{
|
|
BootstrapperStyle.VistaDialog => new VistaDialog(bootstrapper),
|
|
BootstrapperStyle.LegacyDialog2009 => new LegacyDialog2009(bootstrapper),
|
|
BootstrapperStyle.LegacyDialog2011 => new LegacyDialog2011(bootstrapper),
|
|
BootstrapperStyle.ProgressDialog => new ProgressDialog(bootstrapper),
|
|
_ => new ProgressDialog(bootstrapper)
|
|
};
|
|
|
|
if (bootstrapper is null)
|
|
{
|
|
dialog.ShowAsPreview();
|
|
}
|
|
else
|
|
{
|
|
if (App.IsQuiet)
|
|
dialog.HideBootstrapper();
|
|
|
|
dialog.ShowAsBootstrapper();
|
|
}
|
|
}
|
|
}
|
|
}
|