Exemplo n.º 1
0
        private SelectorIndex GetSelectorIndex(Selector selector)
        {
            SelectorIndex result;

            if (_selectors.TryGetValue(selector.SelectorKey, out result))
            {
                return(result);
            }

            result = new SelectorIndex(selector);
            _selectors.Add(selector.SelectorKey, result);

            return(result);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
            }
        }