/// <summary> /// Convenience method for checking if the specified element has a design time lock /// </summary> /// <param name="elem"></param> /// <returns></returns> private bool IsElementLocked(Interop.IHTMLElement elem) { object[] attribute = new object[1]; elem.GetAttribute(DesignTimeLockAttribute, 0, attribute); if (attribute[0] == null) { Interop.IHTMLStyle style = elem.GetStyle(); attribute[0] = style.GetAttribute(DesignTimeLockAttribute, 0); } if ((attribute[0] == null) || !(attribute[0] is string)) { return(false); } return(true); }
/// <summary> /// Return style attribute for element. /// </summary> /// <param name="element"></param> /// <param name="styleName"></param> /// <returns></returns> public string GetStyleAttribute(Interop.IHTMLElement element, string styleName) { Interop.IHTMLStyle style = (Interop.IHTMLStyle)element.GetStyle(); object o = style.GetAttribute(styleName.Replace("-", String.Empty), 0); if (o == null) { return(String.Empty); } else { string styleText = o.ToString(); return(styleText); } }