Esempio n. 1
0
        public static CommonElement CreateElement(HtmlControl control)
        {
            var element = new CommonElement(control.TagName);

            foreach (string key in control.Attributes.Keys)
            {
                string value = control.Attributes[key];
                element.Attr(key, value);
            }
            return(element);
        }
Esempio n. 2
0
        public static CommonElement CreateElement(WebControl control)
        {
            PropertyInfo property = control.GetType().GetProperty("TagName", BindingFlags.NonPublic);
            string       tagName  = property.GetValue(control).ToString();
            var          element  = new CommonElement(tagName);

            foreach (string key in control.Attributes.Keys)
            {
                string value = control.Attributes[key];
                element.Attr(key, value);
            }
            return(element);
        }