Example #1
0
        public IStyleProperty SetStyleProperty(string name, int value)
        {
            if (String.IsNullOrEmpty(name))
            {
                return(null);
            }

            StyleIntegerProperty property = null;

            if (Contains(name))
            {
                property = _styleProperties[name] as StyleIntegerProperty;
                if (property != null && property.IntegerValue != value)
                {
                    property.IntegerValue = value;
                }
            }

            if (property == null)
            {
                property = new StyleIntegerProperty(name, value);
                _styleProperties[name] = property;
            }

            return(property);
        }
Example #2
0
        protected bool LoadStyleIntegerProperty(XmlElement parentElement, string propertyName)
        {
            XmlElement propertyElement = parentElement[propertyName];

            if (propertyElement != null)
            {
                string value = null;
                if (LoadStringFromChildElementInnerText("Value", propertyElement, ref value))
                {
                    StyleIntegerProperty property = new StyleIntegerProperty(propertyName, 0);
                    if (property.SetStringValue(value))
                    {
                        SetStyleProperty(property);
                        return(true);
                    }
                }
            }

            return(false);
        }