Files
VMwareLauncher/VmwareLauncher/ErrorHandler.cs
2019-03-05 20:24:01 +00:00

42 lines
1.3 KiB
C#

using System.Windows.Forms;
namespace VmwareLauncher
{
public partial class ErrorHandler
{
public enum ErrorCode
{
VmwareNotInstalled,
NoAdminRights,
TooManyVMLInstances
}
public static void ShowError (ErrorCode ec)
{
switch (ec)
{
case ErrorCode.VmwareNotInstalled:
MessageBox.Show("Could not find VMware Workstation! Please ensure VMware has been installed correctly.",
"VMware not found",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
break;
case ErrorCode.NoAdminRights:
MessageBox.Show("You must run VMware Launcher as an Administrator!",
"Excecution Error",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
break;
case ErrorCode.TooManyVMLInstances:
MessageBox.Show("Only one instance of VMware Launcher can be open!",
"External Error",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
break;
default:
break;
}
}
}
}