Example #1
0
        public int ReadEnum(StyleEnumType enumType, int index)
        {
            string enumString = null;
            var    value      = m_Values[m_CurrentValueIndex + index];
            var    handle     = value.handle;

            if (handle.valueType == StyleValueType.Keyword)
            {
                var keyword = value.sheet.ReadKeyword(handle);
                enumString = keyword.ToUssString();
            }
            else
            {
                enumString = value.sheet.ReadEnum(handle);
            }

            return(StylePropertyUtil.GetEnumIntValue(enumType, enumString));
        }
Example #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));
        }