本文整理汇总了C#中System.Xml.Xsl.Qil.QilList.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# QilList.Clear方法的具体用法?C# QilList.Clear怎么用?C# QilList.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.Qil.QilList
的用法示例。
在下文中一共展示了QilList.Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillupInvokeArgs
// Fills invokeArgs with values from actualArgs in order given by formalArgs
// Returns true if formalArgs maps 1:1 with actual args.
// Formaly this is n*n algorithm. We can optimize it by calculationg "signature"
// of the function as sum of all hashes of its args names.
private bool FillupInvokeArgs(IList<QilNode> formalArgs, IList<XslNode> actualArgs, QilList invokeArgs)
{
if (actualArgs.Count != formalArgs.Count)
{
return false;
}
invokeArgs.Clear();
for (int invArg = 0; invArg < formalArgs.Count; invArg++)
{
QilName formalArgName = ((QilParameter)formalArgs[invArg]).Name;
XmlQueryType paramType = formalArgs[invArg].XmlType;
QilNode arg = null;
{
for (int actArg = 0; actArg < actualArgs.Count; actArg++)
{
Debug.Assert(actualArgs[actArg].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()");
VarPar withParam = (VarPar)actualArgs[actArg];
if (formalArgName.Equals(withParam.Name))
{
QilNode value = withParam.Value;
XmlQueryType valueType = value.XmlType;
if (valueType != paramType)
{
if (valueType.IsNode && paramType.IsNode && valueType.IsSubtypeOf(paramType))
{
// We can pass it
}
else
{
// Formal argument has the same name but a different type
return false;
}
}
arg = value;
break;
}
}
}
if (arg == null)
{
// Formal argument has not been found among actual arguments
return false;
}
invokeArgs.Add(arg);
}
// All arguments have been found
return true;
}