예제 #1
0
파일: Element.cs 프로젝트: teknologika/ITiN
        /// <summary>
        /// This methode can be used if the attribute isn't available as a property of
        /// Element or a subclass of Element.
        /// </summary>
        /// <param name="attributeName">The attribute name. This could be different then named in
        /// the HTML. It should be the name of the property exposed by IE on it's element object.</param>
        /// <returns>The value of the attribute if available; otherwise <c>null</c> is returned.</returns>
        public string GetAttributeValue(string attributeName)
        {
            if (UtilityClass.IsNullOrEmpty(attributeName))
            {
                throw new ArgumentNullException("attributeName", "Null or Empty not allowed.");
            }

            if (string.Compare(attributeName, "style", true) == 0)
            {
                return(htmlElement.style.cssText);
            }

            object attribute = htmlElement.getAttribute(attributeName, 0);

            if (attribute == DBNull.Value || attribute == null)
            {
                return(null);
            }

            return(attribute.ToString());
        }
예제 #2
0
 private static bool IsIEServerWindow(IntPtr hWnd)
 {
     return(UtilityClass.CompareClassNames(hWnd, "Internet Explorer_Server"));
 }
예제 #3
0
 internal static bool IsIETridentDlgFrame(IntPtr hWnd)
 {
     return(UtilityClass.CompareClassNames(hWnd, "Internet Explorer_TridentDlgFrame"));
 }