Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
        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());
        }