Example #1
0
        private static Dictionary <string, Setter> GetSetters(SelectorIndex selectorIndex, SetterContainer setterContainer)
        {
            var key = setterContainer.GetSelector().GetContainerKey(setterContainer);
            Dictionary <string, Setter> result;

            if (selectorIndex.Setters.TryGetValue(key, out result))
            {
                return(result);
            }

            result = new Dictionary <string, Setter>();
            selectorIndex.Setters.Add(key, result);

            return(result);
        }
Example #2
0
        private static void UpdateSetters(SelectorIndex selectorIndex, SetterContainer setterContainer)
        {
            var  setters = GetSetters(selectorIndex, setterContainer);
            bool changed = false;

            foreach (var setter in setterContainer.GetSetters())
            {
                if (UpdateSetter(setters, setter))
                {
                    changed = true;
                }
            }

            if (changed)
            {
                selectorIndex.OnSelectorChange(setterContainer.GetSelector().SelectorKey);
            }
        }