本文整理匯總了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))
);
}