本文整理汇总了C#中System.Xml.XmlNode.GetSubNodesByPrefix方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.GetSubNodesByPrefix方法的具体用法?C# XmlNode.GetSubNodesByPrefix怎么用?C# XmlNode.GetSubNodesByPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlNode
的用法示例。
在下文中一共展示了XmlNode.GetSubNodesByPrefix方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnalyzeSubnode
private ExpressionInfo AnalyzeSubnode(XmlNode node)
{
switch (node.LocalName)
{
case AstConstants.Subnodes.Cond:
return Subnode_Cond(node);
case AstConstants.Subnodes.Else:
case AstConstants.Subnodes.Var:
return Subnode_WithNode(node);
case AstConstants.Subnodes.ValueVar:
case AstConstants.Subnodes.KeyVar:
case AstConstants.Subnodes.Expr:
case AstConstants.Subnodes.If:
return Subnode_WithNodeOrScalar(node);
case AstConstants.Subnodes.Exprs:
return Subnode_Exprs(node);
case AstConstants.Subnodes.Value:
return Subnode_Value(node);
case AstConstants.Subnodes.Key:
return Subnode_Key(node);
case AstConstants.Subnodes.Loop:
case AstConstants.Subnodes.Init:
return Subnode_Init(node);
case AstConstants.Subnodes.Left:
case AstConstants.Subnodes.Right:
return Analyze(node.GetSubNodesByPrefix(AstConstants.Node).Single());
case AstConstants.Subnodes.Adaptions:
case AstConstants.Subnodes.Args:
case AstConstants.Subnodes.ByRef:
case AstConstants.Subnodes.Cases:
case AstConstants.Subnodes.Catches:
case AstConstants.Subnodes.Class:
case AstConstants.Subnodes.Consts:
case AstConstants.Subnodes.Declares:
case AstConstants.Subnodes.Default:
case AstConstants.Subnodes.Dim:
case AstConstants.Subnodes.Extends:
case AstConstants.Subnodes.FinallyStmts:
case AstConstants.Subnodes.Implements:
case AstConstants.Subnodes.InsteadOf:
case AstConstants.Subnodes.Items:
case AstConstants.Subnodes.Method:
case AstConstants.Subnodes.Name:
case AstConstants.Subnodes.NewModifier:
case AstConstants.Subnodes.NewName:
case AstConstants.Subnodes.Num:
case AstConstants.Subnodes.Params:
case AstConstants.Subnodes.Parts:
case AstConstants.Subnodes.Props:
case AstConstants.Subnodes.Remaining:
case AstConstants.Subnodes.ReturnType:
case AstConstants.Subnodes.Static:
case AstConstants.Subnodes.Stmts:
case AstConstants.Subnodes.Trait:
case AstConstants.Subnodes.Traits:
case AstConstants.Subnodes.Type:
case AstConstants.Subnodes.Unpack:
case AstConstants.Subnodes.Uses:
case AstConstants.Subnodes.Variadic:
case AstConstants.Subnodes.Vars:
throw new NotImplementedException("Unknown AST subnode. Was " + node.LocalName);
default:
throw new NotImplementedException("Unknown AST subnode. Was " + node.LocalName);
}
}
示例2: Subnode_WithNode
private ExpressionInfo Subnode_WithNode(XmlNode node)
{
return Analyze(node.GetSubNodesByPrefix(AstConstants.Node).Single());
}
示例3: Subnode_WithNodeOrScalar
private ExpressionInfo Subnode_WithNodeOrScalar(XmlNode node)
{
var subnodes = node.GetSubNodesByPrefix(AstConstants.Node);
if (subnodes.Any())
{
return Analyze(subnodes.Single());
}
// Expr can contain a <scalar:null> rather than an expression.
// in that case, there is no taint.
return new ExpressionInfo();
}
示例4: Subnode_Key
private ExpressionInfo Subnode_Key(XmlNode node)
{
var subNode = node.GetSubNodesByPrefix(AstConstants.Node);
if (subNode.Any())
{
return AnalyzeNode(subNode.Single());
}
return new ExpressionInfo();
}
示例5: Subnode_Cond
private ExpressionInfo Subnode_Cond(XmlNode node)
{
var subNodes = node.GetSubNodesByPrefix(AstConstants.Node);
return subNodes.Any() ? Analyze(subNodes.Single()) : new ExpressionInfo();
}
示例6: GetVariable
private VariableResolveResult GetVariable(XmlNode node)
{
switch (node.Name)
{
case AstConstants.Node + ":" + AstConstants.Nodes.Expr_Variable:
return Node_Expr_Variable(node);
case AstConstants.Node + ":" + AstConstants.Nodes.Expr_StaticPropertyFetch:
return Node_Expr_StaticPropertyFetch(node);
case AstConstants.Node + ":" + AstConstants.Nodes.Expr_PropertyFetch:
return Node_Expr_PropertyFetch(node);
case AstConstants.Node + ":" + AstConstants.Nodes.Expr_ArrayDimFetch:
return Node_Expr_ArrayDimFetch(node);
// Subnodes
case AstConstants.Subnode + ":" + AstConstants.Subnodes.Var:
return GetVariable(node.GetSubNodesByPrefix(AstConstants.Node).Single());
}
return new VariableResolveResult(new Variable("$UNKNOWN$", VariableScope.Unknown), true);
}
示例7: Node_Cond
private TaintSets Node_Cond(XmlNode node)
{
isConditional = true;
_variables.Add(EdgeType.False, _variables[EdgeType.Normal].AssignmentClone());
_variables.Add(EdgeType.True, _variables[EdgeType.Normal].AssignmentClone());
_variables.Remove(EdgeType.Normal);
var subnodes = node.GetSubNodesByPrefix(AstConstants.Node);
return subnodes.Any() ? AnalyzeNode(subnodes.Single()) : new TaintSets().ClearTaint();
}
示例8: AnalyzeSubnode
private TaintSets AnalyzeSubnode(XmlNode node)
{
switch (node.LocalName)
{
case AstConstants.Subnodes.Cond:
return Node_Cond(node);
default:
var subNodes = node.GetSubNodesByPrefix(AstConstants.Node);
if (subNodes.Any())
{
return AnalyzeNode(subNodes.Single());
}
return new TaintSets().ClearTaint();
}
}