public virtual void UpdateColors(ShadingStyle style) { IEnumerable <Renderable> renderables = MapObjects.GetAllRenderables(); foreach (Renderable r in renderables) { if (r.Selected) { r.SetColor(r.Colors[style].selected); } else { if (r.Tint != null) { r.SetColor(r.Tint.Value); } else { r.SetColor(r.Colors[style].deselected); } } } }
public static Dictionary <ShadingStyle, ShadingStyle> Capped(this Dictionary <ShadingStyle, ShadingStyle> dict, ShadingStyle max) { foreach (ShadingStyle style in (ShadingStyle[])Enum.GetValues(typeof(ShadingStyle))) { dict.Add(style, style > max ? max : style); } return(dict); }