Example #1
0
        public static void ApplyDisplay(IStylePropertyReader reader, ref StyleInt property)
        {
            if (reader.IsKeyword(0, StyleValueKeyword.None))
            {
                StyleInt none = new StyleInt((int)DisplayStyle.None)
                {
                    specificity = reader.specificity
                };
                property = none;
                return;
            }

            if (!reader.IsValueType(0, StyleValueType.Enum))
            {
                Debug.LogError("Invalid value for display property " + reader.ReadAsString(0));
                return;
            }

            property = reader.ReadStyleEnum <DisplayStyle>(0);
        }
Example #2
0
        public static void ApplyAlign(IStylePropertyReader reader, ref StyleInt property)
        {
            if (reader.IsKeyword(0, StyleValueKeyword.Auto))
            {
                StyleInt auto = new StyleInt((int)Align.Auto)
                {
                    specificity = reader.specificity
                };
                property = auto;
                return;
            }

            if (!reader.IsValueType(0, StyleValueType.Enum))
            {
                Debug.LogError("Invalid value for align property " + reader.ReadAsString(0));
                return;
            }

            property = reader.ReadStyleEnum <Align>(0);
        }