当前位置: 首页>>代码示例>>C#>>正文


C# XPathNavigator.Eval方法代码示例

本文整理汇总了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;
        }
开发者ID:SmarterApp,项目名称:TabulateSmarterTestResults,代码行数:11,代码来源:ToCsvProcessor.cs

示例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;
            }
        }
开发者ID:SmarterApp,项目名称:TabulateSmarterTestResults,代码行数:32,代码来源:ToCsvProcessor.cs

示例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";
     }
 }
开发者ID:SmarterApp,项目名称:TabulateSmarterTestResults,代码行数:17,代码来源:ToCsvProcessor.cs


注:本文中的System.Xml.XPath.XPathNavigator.Eval方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。