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


C# IEvaluator.evaluate方法代码示例

本文整理汇总了C#中IEvaluator.evaluate方法的典型用法代码示例。如果您正苦于以下问题:C# IEvaluator.evaluate方法的具体用法?C# IEvaluator.evaluate怎么用?C# IEvaluator.evaluate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEvaluator的用法示例。


在下文中一共展示了IEvaluator.evaluate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: evaluate

        /// <summary>
        /// Evaluation user-variable with IEvaluator by using unique identification
        /// Evaluated value should be updated for variable.
        /// </summary>
        /// <param name="ident">Unique identificator</param>
        /// <param name="msbuild">IEvaluator objects for evaluating</param>
        /// <param name="resetting">Evaluating from the unevaluated data if true, otherwise evaluation in the chain of others IEvaluator's</param>
        public void evaluate(string ident, IEvaluator evaluator, bool resetting)
        {
            lock(_lock)
            {
                if(!definitions.ContainsKey(ident)) {
                    throw new NotFoundException("Variable '{0}' not found", ident);
                }

                if(evaluator == null) {
                    throw new InvalidArgumentException("evaluation of variable: evaluator is null");
                }

                TUserVariable var = new TUserVariable(definitions[ident]) {
                    status = TUserVariable.StatusType.Started
                };
                definitions[ident] = var;

                if(resetting) {
                    var.evaluated = evaluator.evaluate(var.unevaluated);
                }
                else {
                    var.evaluated = evaluator.evaluate(var.evaluated);
                }
                var.status          = TUserVariable.StatusType.Evaluated;
                definitions[ident]  = var;
                Log.Debug("Completed evaluation of variable with IEvaluator :: '{0}'", ident);
            }
        }
开发者ID:hilbertdu,项目名称:vsSolutionBuildEvent,代码行数:35,代码来源:UserVariable.cs

示例2: evaluate

        /// <summary>
        /// Evaluation user-variable with IEvaluator by using unique identification
        /// Evaluated value should be updated for variable.
        /// </summary>
        /// <param name="ident">Unique identificator</param>
        /// <param name="evaluator">IEvaluator objects for evaluating</param>
        /// <param name="resetting">Evaluating from the unevaluated data if true, otherwise evaluation in the chain of others IEvaluator's</param>
        public void evaluate(string ident, IEvaluator evaluator, bool resetting)
        {
            lock(_lock)
            {
                if(!definitions.ContainsKey(ident)) {
                    throw new NotFoundException("Variable '{0}' is not found.", ident);
                }

                if(evaluator == null) {
                    throw new InvalidArgumentException("Evaluation of variable: evaluator is null");
                }

                TUserVariable var = new TUserVariable(definitions[ident]) {
                    status = TUserVariable.StatusType.Started
                };
                definitions[ident] = var;

                if(resetting) {
                    var.evaluated = evaluator.evaluate(var.unevaluated);
                }
                else {
                    var.evaluated = evaluator.evaluate(var.evaluated);
                }
                var.status          = TUserVariable.StatusType.Evaluated;
                definitions[ident]  = var;
                Log.Trace("IEvaluator '{0}': Evaluation of variable '{1}' is completed.", evaluator.GetType().ToString(), ident);
            }
        }
开发者ID:3F,项目名称:vsCommandEvent,代码行数:35,代码来源:UserVariable.cs


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