public IEnumerator <KeyValuePair <string, Color> > GetEnumerator() { foreach (KeyValuePair <string, Color> color in _colors) { string resolvedKey = ExpressionResolver.Resolve(color.Key); KeyValuePair <string, Color> keyValuePair = new KeyValuePair <string, Color>(resolvedKey, color.Value); yield return(keyValuePair); } }
private T findColor <T>(string name, Func <Color, T> found, Func <T> notFound) { foreach (KeyValuePair <string, Color> color in _colors) { string resolvedKey = ExpressionResolver.Resolve(color.Key); if (name == resolvedKey) { return(found(color.Value)); } } return(notFound()); }