本文整理匯總了C#中System.Xml.XPath.XPathNavigator.Eval方法的典型用法代碼示例。如果您正苦於以下問題:C# XPathNavigator.Eval方法的具體用法?C# XPathNavigator.Eval怎麽用?C# XPathNavigator.Eval使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XPath.XPathNavigator
的用法示例。
在下文中一共展示了XPathNavigator.Eval方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ProcessScoresAll
static void ProcessScoresAll(XPathNavigator nav, XPathExpression xp_ScaleScore, XPathExpression xp_StdErr,
XPathExpression xp_PerfLvl, string[] fields, int index)
{
string scaleScore = nav.Eval(xp_ScaleScore);
string stdErr = nav.Eval(xp_StdErr);
string perfLvl = nav.Eval(xp_PerfLvl);
fields[index] = scaleScore;
fields[index + 1] = stdErr;
fields[index + 2] = perfLvl;
}
示例2: ProcessScoresDw
static void ProcessScoresDw(XPathNavigator nav, XPathExpression xp_ScaleScore, XPathExpression xp_StdErr,
XPathExpression xp_PerfLvl, string[] fields, int index)
{
// We round fractional scale scores down to the lower whole number. This is because
// the performance level has already been calculated on the fractional number. If
// we rounded to the nearest whole number then half the time the number would be
// rounded up. And if the fractional number was just below the performance level
// cut score, a round up could show a whole number score that doesn't correspond
// to the performance level.
string scaleScore = Round(nav.Eval(xp_ScaleScore));
string stdErr = Round(nav.Eval(xp_StdErr));
string perfLvl = nav.Eval(xp_PerfLvl);
fields[index] = scaleScore;
fields[index + 3] = perfLvl;
int scaleScoreN;
int stdErrN;
if (int.TryParse(scaleScore, out scaleScoreN) && int.TryParse(stdErr, out stdErrN))
{
// MinimumValue
fields[index + 1] = (scaleScoreN - stdErrN).ToString("d", System.Globalization.CultureInfo.InvariantCulture);
// MaximumValue
fields[index + 2] = (scaleScoreN + stdErrN).ToString("d", System.Globalization.CultureInfo.InvariantCulture);
}
else
{
fields[index + 1] = string.Empty;
fields[index + 2] = string.Empty;
}
}
示例3: CalcResponseDuration
static string CalcResponseDuration(XPathNavigator navDoc, XPathNavigator navItem)
{
string pageNum = navItem.Eval(sXp_PageNumber);
string pageTime = navItem.Eval(sXp_PageTime);
long milliseconds;
if (!string.IsNullOrEmpty(pageNum) &&
long.TryParse(pageTime, NumberStyles.AllowDecimalPoint|NumberStyles.AllowLeadingWhite|NumberStyles.AllowTrailingWhite, CultureInfo.InvariantCulture, out milliseconds))
{
int itemCount = CountItemsOnPage(navDoc, pageNum);
if (itemCount < 1) itemCount = 1;
return ((milliseconds / 1000.0) / (long)itemCount).ToString("F3", CultureInfo.InvariantCulture);
}
else
{
return "0";
}
}