コード例 #1
0
        private static void ReadState(StyleSheetCache cache, string baseRuleSelector, GUIStyleState state, string stateId, bool throwIfNotFound)
        {
            var stateRuleSelector = ConverterUtils.GetStateRuleSelectorStr(baseRuleSelector, stateId);
            StyleComplexSelector complexSelector;

            if (cache.selectors.TryGetValue(stateRuleSelector, out complexSelector))
            {
                var rule = complexSelector.rule;
                ReadState(cache, rule, state, throwIfNotFound);
            }
            else
            {
                if (throwIfNotFound)
                {
                    throw new Exception("Cannot find rule with selector: " + stateRuleSelector);
                }
            }
        }