protected static Brush GetBrushForCivilizations(ReadOnlyCivilizationCollection civilizations)
 {
     if (civilizations.Count == 1)
     {
         return(new SolidColorBrush(_civilizationDictionary[civilizations[0]]));
     }
     else if (civilizations.Count == 2)
     {
         List <Color> brushes = new List <Color>();
         foreach (Civilization civilization in civilizations)
         {
             brushes.Add(_civilizationDictionary[civilization]);
         }
         return(new LinearGradientBrush(brushes[0], brushes[1], 45));
     }
     else
     {
         throw new Exception();
     }
 }
Esempio n. 2
0
 private void UpdateCivilizations(ReadOnlyCivilizationCollection civilizations)
 {
     RectangleColorFrame.Fill = GetBrushForCivilizations(civilizations);
 }