本文整理汇总了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";
}
}