Beispiel #1
0
 /// <summary>
 /// Sets the ForeColor of the supplied TextBox based on the Effect Type. 
 /// Offensive = Red. 
 /// Restorative = Blue. 
 /// Others = Black.
 /// </summary>
 /// <param name="txt">TextBox to manipulate</param>
 /// <param name="type">Effect Type to use as a condition</param>
 private void setForeColor( TextBox txt, Effect.Types type )
 {
     switch( type ) {
         default:
             txt.ForeColor = Color.Black;
             break;
         case Effect.Types.Offensive:
             txt.ForeColor = Color.Red;
             break;
         case Effect.Types.Restorative:
             txt.ForeColor = Color.Blue;
             break;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Gets a list of Ingredients that have a matching effect to the supplied Effect, lees the supplied Ingredient
 /// </summary>
 /// <param name="ingredient">Ingredient to exclude from the search results</param>
 /// <param name="effect">Effect to match</param>
 /// <returns>A List of matching Ingredients</returns>
 private List<Ingredient> GetMatchingIngredients( Ingredient ingredient, Effect effect )
 {
     List<Ingredient> ingredients = ( from i in _skyDB.Ingredients
                                      where i != ingredient &&
                                      ( i.Effect1 == effect ||
                                      i.Effect2 == effect ||
                                      i.Effect3 == effect ||
                                      i.Effect4 == effect )
                                      orderby i.Name
                                      select i ).ToList();
     return ingredients;
 }