public void AccessIntoStringArray()
 {
     for (EnumColors i = 0; i < max; i++)
     {
         TestPassingEnumValue(i);
     }
 }
 public void AccessViaEnumDescription()
 {
     for (EnumColors i = 0; i < max; i++)
     {
         string desc = i.GetDescription();
         TestPassingString(desc);
     }
 }
    public Color GetRandomColor()
    {
        this.enumColor = BallColor.GetRandomEnumColor <EnumColors>();

        switch (enumColor)
        {
        case EnumColors.Red:
            return(Red);

        case EnumColors.Green:
            return(Green);

        case EnumColors.Blue:
            return(Blue);

        default:
            return(new Color(0, 0, 0));
        }
    }
 public void TestPassingEnumValue(EnumColors color)
 {
     string value = EnumAsStrings.Values[(int)color];
 }
 public Square(double width, double heigth, EnumColors color)
 {
     this.Width  = width;
     this.Heigth = heigth;
     this.Color  = color;
 }
 public Circle(double radius, EnumColors color)
 {
     this.Radius = radius;
     this.Color  = color;
 }
Exemple #7
0
 public Rectangle(double width, double heigth, EnumColors color)
 {
     this.Width  = width;
     this.Heigth = heigth;
     this.Color  = color;
 }