Exemple #1
0
        public override string ToString()
        {
            StringBuilder strBuild = new StringBuilder();

            strBuild.AppendLine(base.ToString());
            strBuild.AppendFormat("Car Properties:{0}{1}", Environment.NewLine, Environment.NewLine);
            strBuild.AppendFormat("Car Color:                {0} {1}", r_CarColor.ToString(), Environment.NewLine);
            strBuild.AppendFormat("Number of doors:          {0} {1}", r_CarNumOfDoors, Environment.NewLine);
            return(strBuild.ToString());
        }
Exemple #2
0
 private Color convertToColor(eColors i_Color)
 {
     if (i_Color.ToString().Equals("Green"))
     {
         return(Color.Green);
     }
     if (i_Color.ToString().Equals("Blue"))
     {
         return(Color.Blue);
     }
     if (i_Color.ToString().Equals("Yellow"))
     {
         return(Color.Yellow);
     }
     if (i_Color.ToString().Equals("Brown"))
     {
         return(Color.Brown);
     }
     if (i_Color.ToString().Equals("Green"))
     {
         return(Color.Green);
     }
     if (i_Color.ToString().Equals("Purple"))
     {
         return(Color.Purple);
     }
     if (i_Color.ToString().Equals("Turquoise"))
     {
         return(Color.Turquoise);
     }
     if (i_Color.ToString().Equals("Red"))
     {
         return(Color.Red);
     }
     if (i_Color.ToString().Equals("white"))
     {
         return(Color.White);
     }
     return(Color.Black);
 }
 public System.Windows.Forms.Button getColorButton(eColors color)
 {
     if (color.ToString().Equals("Purple"))
     {
         return(PurpleButton);
     }
     else if (color.ToString().Equals("Blue"))
     {
         return(BlueButton);
     }
     else if (color.ToString().Equals("Red"))
     {
         return(RedButton);
     }
     else if (color.ToString().Equals("Yellow"))
     {
         return(YellowButton);
     }
     else if (color.ToString().Equals("White"))
     {
         return(WhiteButton);
     }
     else if (color.ToString().Equals("Turquoise"))
     {
         return(TurquoiseButton);
     }
     else if (color.ToString().Equals("Brown"))
     {
         return(BrownButton);
     }
     else if (color.ToString().Equals("Green"))
     {
         return(GreenButton);
     }
     return(null);
 }