private static void AddToList(Style style, string stylePath) { if (!styles.ContainsKey(stylePath)) { styles.Add(stylePath, style); } else // Replace the old style { styles.Remove(stylePath); styles.Add(stylePath, style); } }