protected override bool MatchKeyword(string keyword)
        {
            StylePropertyValue current = this.current;
            bool flag = current.handle.valueType == StyleValueType.Keyword;
            bool result;

            if (flag)
            {
                StyleValueKeyword valueIndex = (StyleValueKeyword)current.handle.valueIndex;
                result = (valueIndex.ToUssString() == keyword.ToLower());
            }
            else
            {
                bool flag2 = current.handle.valueType == StyleValueType.Enum;
                if (flag2)
                {
                    string a = current.sheet.ReadEnum(current.handle);
                    result = (a == keyword.ToLower());
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
示例#2
0
        public StyleInt ReadStyleEnum(StyleEnumType enumType, int index)
        {
            StylePropertyValue stylePropertyValue = this.m_Values[this.m_CurrentValueIndex + index];
            StyleValueHandle   handle             = stylePropertyValue.handle;
            bool   flag = handle.valueType == StyleValueType.Keyword;
            string value;

            if (flag)
            {
                StyleValueKeyword svk = stylePropertyValue.sheet.ReadKeyword(handle);
                value = svk.ToUssString();
            }
            else
            {
                value = stylePropertyValue.sheet.ReadEnum(handle);
            }
            int enumIntValue = StylePropertyUtil.GetEnumIntValue(enumType, value);

            return(new StyleInt(enumIntValue));
        }