示例#1
0
 protected AbstractStyleKey(string name, bool inherited)
 {
     Name      = name;
     Inherited = inherited;
     Type      = typeof(T);
     StyleKeys.Add(this);
 }
示例#2
0
        private StyleContainer ToContainer(IStyleRule rule)
        {
            var container = new StyleContainer(rule.SelectorText);

            foreach (var property in rule.Style)
            {
                var propName = StringUtility.ToPascalCase(property.Name);
                if (StyleKeys.TryGetByName(propName, out var styleKey) && context.Converters.TryConvert(property.Value, styleKey.Type, out var propertyValue))
                {
                    styleKey.Set(container, propertyValue);
                }
            }

            return(container);
        }