You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NDSD_Screwdriver
{
public class FormUtils
{
public static Random r = new Random();
public static Brush TestRamColor()
{
int i = r.Next(0, 4);
if (i == 1)
{
return Brushes.Green;
}
else if (i == 2)
{
return Brushes.Yellow;
}
else return Brushes.Red;
}
public static Brush EnumColorToBrush(LightState lightState)
{
switch (lightState)
{
case LightState.Green:
return Brushes.Green;
case LightState.Yellow:
return Brushes.Yellow;
case LightState.Red:
return Brushes.Red;
default: return Brushes.Transparent;
}
}
}
public enum LightState
{
Green = 0,
Yellow,
Red,
}
}