本文整理汇总了C#中IDomObject.RemoveAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# IDomObject.RemoveAttribute方法的具体用法?C# IDomObject.RemoveAttribute怎么用?C# IDomObject.RemoveAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDomObject
的用法示例。
在下文中一共展示了IDomObject.RemoveAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateJavascriptPath
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;
}
示例2: ApplyStyles
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;
}
示例3: RemoveAttribute
/// <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);
}