SharpVectors.Dom.Css.CssStyleDeclaration.GetPropertyValue C# (CSharp) Method

GetPropertyValue() public method

Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block.
public GetPropertyValue ( string propertyName ) : string
propertyName string The name of the CSS property. See the CSS property index.
return string
        public virtual string GetPropertyValue(string propertyName)
        {
            return (styles.ContainsKey(propertyName)) ? ((SharpCssStyle)styles[propertyName]).Value : String.Empty;
        }

Usage Example

示例#1
0
        public void TestNoInherit()
        {
            CssStyleDeclaration csd = getStyles("<a />", "a{foo:bar;runar:'carola';}", "a");

            Assert.AreEqual("bar", csd.GetPropertyValue("foo"));
            Assert.AreEqual("\"carola\"", csd.GetPropertyValue("runar"));
        }
All Usage Examples Of SharpVectors.Dom.Css.CssStyleDeclaration::GetPropertyValue