本文整理匯總了C#中Spark.Parser.Markup.ElementNode.GetAttributeValue方法的典型用法代碼示例。如果您正苦於以下問題:C# ElementNode.GetAttributeValue方法的具體用法?C# ElementNode.GetAttributeValue怎麽用?C# ElementNode.GetAttributeValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Spark.Parser.Markup.ElementNode
的用法示例。
在下文中一共展示了ElementNode.GetAttributeValue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: DoReplace
public override void DoReplace(ElementNode node, IList<Node> body)
{
IEnumerable<ElementNode> options = GetOptions(body);
foreach (ElementNode option in options)
{
string currentSelectedValue = option.GetAttributeValue("selected");
string propertyValue = option.GetAttributeValue("value");
string propertyExpression = node.GetAttributeValue(ReplacementSpecification.OriginalAttributeName);
Node selectedNode = propertyExpression.GetSelectedSnippet(currentSelectedValue, propertyValue);
option.RemoveAttributesByName("selected");
AddAttribute(option, "selected", selectedNode);
}
}
示例4: SetNodeNameAndValue
private List<Node> SetNodeNameAndValue(ElementNode elementNode, Node valueNode, Node nameNode, IList<Node> body, AttributeNode originalForAttrib)
{
List<Node> result = new List<Node>();
if(elementNode.IsTag("textarea"))
{
if (valueNode != null)
{
elementNode.IsEmptyElement = false;
body.Add(valueNode);
}
}
else
{
string inputType = elementNode.GetAttributeValue("type");
switch (inputType.ToUpper())
{
case "CHECKBOX":
elementNode.Attributes.Add(new AttributeNode("value", "true"));
// DODGY sorry will figure something decent out soon
AddCheckedAttribute(elementNode, originalForAttrib);
break;
default:
if (valueNode != null)
elementNode.Attributes.Add(new AttributeNode("value", new List<Node>()
{
valueNode
}));
break;
}
}
elementNode.Attributes.Add(new AttributeNode("name", new List<Node>()
{
nameNode
}));
return result;
}