本文整理汇总了C#中System.Xml.XPath.XPathExpression.AddSort方法的典型用法代码示例。如果您正苦于以下问题:C# XPathExpression.AddSort方法的具体用法?C# XPathExpression.AddSort怎么用?C# XPathExpression.AddSort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XPath.XPathExpression
的用法示例。
在下文中一共展示了XPathExpression.AddSort方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareSort
private static void PrepareSort(XPathExpression expression, XPathNavigator source,
object sortExpression, IComparer comparer, XmlNamespaceManager context)
{
XPathExpression se;
if (sortExpression is string)
{
se = GetCompiledExpression((string)sortExpression, source);
}
else if (sortExpression is XPathExpression)
{
se = (XPathExpression)sortExpression;
}
else
{
throw new XPathException(Monobjc.Tools.Sdp.Properties.Resources.XPathCache_BadSortObject, null);
}
se.SetContext(context);
expression.AddSort(se, comparer);
}
示例2: PrepareIdNavigator
/// <summary>
/// Prepares the Xpath navigator to improve performance for GetNextId().
/// </summary>
private void PrepareIdNavigator()
{
m_navigator = m_dictionary.CreateNavigator();
m_expression = m_navigator.Compile(m_basePath);
m_expression.AddSort(m_XPathId, XmlSortOrder.Descending, XmlCaseOrder.None, String.Empty, XmlDataType.Number);
}
示例3: PrepareSort
private static void PrepareSort(XPathExpression expression, XPathNavigator source, object sortExpression,
XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType,
XmlNamespaceManager context)
{
XPathExpression se;
if (sortExpression is string)
{
se = GetCompiledExpression((string)sortExpression, source);
}
else if (sortExpression is XPathExpression)
{
se = (XPathExpression)sortExpression;
}
else
{
throw new XPathException(Properties.Resources.XPathCache_BadSortObject, null);
}
se.SetContext(context);
expression.AddSort(se, order, caseOrder, lang, dataType);
}
示例4: AddToExpr
public void AddToExpr (XPathExpression e, XslTransformProcessor p)
{
e.AddSort (
expr,
orderAvt == null ? order : ParseOrder (orderAvt.Evaluate (p)),
caseOrderAvt == null ? caseOrder: ParseCaseOrder (caseOrderAvt.Evaluate (p)),
langAvt == null ? lang : ParseLang (langAvt.Evaluate (p)),
dataTypeAvt == null ? dataType : ParseDataType (dataTypeAvt.Evaluate (p))
);
}