Пример #1
0
        private void RemoveAttribute(IDomObject tag, KeyValuePair <string, string> attribute)
        {
            var e = new RemovingAttributeEventArgs {
                Attribute = attribute
            };

            OnRemovingAttribute(e);
            if (!e.Cancel)
            {
                tag.RemoveAttribute(attribute.Key);
            }
        }
Пример #2
0
 private bool UpdateJavascriptPath(bool foundFirstScript, IDomObject element)
 {
     if (foundFirstScript == false)
     {
         element.SetAttribute("src", Globals.FullPath(_scriptBundle.Path));
     }
     else
     {
         //Just make this local, cost of removing from dom is expensive
         element.RemoveAttribute("src");
         //element.Remove();
     }
     return(true);
 }
 private bool UpdateJavascriptPath(bool foundFirstScript, IDomObject element)
 {
     if (foundFirstScript == false)
     {
         element.SetAttribute("src", Globals.FullPath(_scriptBundle.Path));
     }
     else
     {
         //Just make this local, cost of removing from dom is expensive
         element.RemoveAttribute("src");
         //element.Remove();
     }
     return true;
 }
        private static IDomObject ApplyStyles(IDomObject domElement, StyleClass clazz)
        {
            var styles = CssElementStyleResolver.GetAllStyles(domElement, clazz);

            foreach (var attributeToCss in styles)
            {
                PrepareAttribute(domElement, attributeToCss);
                //domElement.SetAttribute(attributeToCss.AttributeName, attributeToCss.CssValue);
            }

	        if (string.IsNullOrEmpty(domElement.Attributes["style"]))
		        domElement.RemoveAttribute("style");

            return domElement;
        }
Пример #5
0
        private static IDomObject ApplyStyles(IDomObject domElement, StyleClass clazz)
        {
            var styles = CssElementStyleResolver.GetAllStyles(domElement, clazz);

            foreach (var attributeToCss in styles)
            {
                PrepareAttribute(domElement, attributeToCss);
                //domElement.SetAttribute(attributeToCss.AttributeName, attributeToCss.CssValue);
            }

            if (string.IsNullOrEmpty(domElement.Attributes["style"]))
            {
                domElement.RemoveAttribute("style");
            }

            return(domElement);
        }
Пример #6
0
 /// <summary>
 /// Remove an attribute from the document.
 /// </summary>
 /// <param name="tag">tag where the attribute to belongs</param>
 /// <param name="attribute">to be removed</param>
 private void RemoveAttribute(IDomObject tag, KeyValuePair<string, string> attribute)
 {
     var e = new RemovingAttributeEventArgs { Attribute = attribute };
     OnRemovingAttribute(e);
     if (!e.Cancel) tag.RemoveAttribute(attribute.Key);
 }