本文整理汇总了C#中Spark.Parser.Markup.ElementNode.RemoveAttributesByName方法的典型用法代码示例。如果您正苦于以下问题:C# ElementNode.RemoveAttributesByName方法的具体用法?C# ElementNode.RemoveAttributesByName怎么用?C# ElementNode.RemoveAttributesByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spark.Parser.Markup.ElementNode
的用法示例。
在下文中一共展示了ElementNode.RemoveAttributesByName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoReplace
public void DoReplace(ElementNode node, IList<Node> body)
{
string propertyExpression = node.GetAttributeValue("for");
Node checkedSnippet = propertyExpression.GetCheckedSnippet();
node.RemoveAttributesByName("checked");
node.Attributes.Add(new AttributeNode("checked", new List<Node>(){checkedSnippet}));
}
示例2: RemoteAndEvalUriSnippet
private Node RemoteAndEvalUriSnippet(ElementNode elementNode)
{
string attribValue = elementNode.GetAttributeValue(replacementSpecification.OriginalAttributeName);
elementNode.RemoveAttributesByName(replacementSpecification.OriginalAttributeName);
return
attribValue.GetCreateUriSnippet(
IsTypeReplacement());
}
示例3: AddAttribute
protected static void AddAttribute(ElementNode elementNode, string attributeName, Node childNode)
{
elementNode.RemoveAttributesByName(attributeName);
elementNode.Attributes.Add(new AttributeNode(attributeName, new List<Node>
{
childNode
}));
}
示例4: RemoveReplacedAttribute
private void RemoveReplacedAttribute(ElementNode elementNode)
{
elementNode.RemoveAttributesByName(replacementSpecification.NewAttributeName);
}
示例5: Transform
private void Transform(ElementNode node, IList<Node> body)
{
AttributeNode forAttribute = node.GetAttribute("for");
AttributeNode forType = node.GetAttribute("fortype");
AttributeNode forProperty = node.GetAttribute("forproperty");
if(forAttribute!=null)
{
// put in as content property
node.Attributes.Remove(forAttribute);
node.RemoveAttributesByName("name");
node.RemoveAttributesByName("value");
var nameNode = new ExpressionNode(forAttribute.Value.GetPropertyNameSnippet());
var valueNode = new ConditionNode("resource!=null")
{
Nodes = new List<Node>()
{
new ExpressionNode(forAttribute.Value)
}
};
SetNodeNameAndValue(node, valueNode, nameNode, body, forAttribute);
}
else if(forType!=null)
{
if(forProperty==null)
{
throw new Exception("Must have both a forProperty attribute if using the forType attribute.");
}
node.Attributes.Remove(forType);
node.Attributes.Remove(forProperty);
node.RemoveAttributesByName("name");
SetNodeNameAndValue(node, null, new TextNode(string.Concat(forType.Value, ".", forProperty.Value)), body, forAttribute);
}
}
示例6: DoReplace
public override void DoReplace(ElementNode node, IList<Node> body)
{
node.RemoveAttributesByName(ReplacementSpecification.OriginalAttributeName);
}