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


C# Engine.ClearShouldContinue方法代码示例

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


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

示例1: OnExecuteFrame

 protected override void OnExecuteFrame(Engine engine)
 {
     engine.SetBreakFrame();
     while (TypeHelper.ConvertToBool(Condition.Get(engine)))
     {
         Body.Execute(engine);
         engine.ClearShouldContinue();
         if (engine.ShouldInterrupt) break;
     }
 }
开发者ID:ricksladkey,项目名称:Markup-Programming,代码行数:10,代码来源:WhileNode.cs

示例2: OnExecuteFrame

 protected override void OnExecuteFrame(Engine engine)
 {
     engine.SetBreakFrame();
     foreach (var item in Collection.Get(engine) as IEnumerable)
     {
         engine.DefineVariable(VariableName, item);
         Body.Execute(engine);
         engine.ClearShouldContinue();
         if (engine.ShouldInterrupt) break;
     }
 }
开发者ID:ricksladkey,项目名称:Markup-Programming,代码行数:11,代码来源:ForEachNode.cs

示例3: OnExecuteFrame

 protected override void OnExecuteFrame(Engine engine)
 {
     engine.SetBreakFrame();
     Initial.Execute(engine);
     while (Condition != null ? TypeHelper.ConvertToBool(Condition.Get(engine)) : true)
     {
         Body.Execute(engine);
         engine.ClearShouldContinue();
         if (engine.ShouldInterrupt) break;
         if (Next != null) Next.Get(engine);
     }
 }
开发者ID:ricksladkey,项目名称:Markup-Programming,代码行数:12,代码来源:ForNode.cs

示例4: OnExecute

 protected override void OnExecute(Engine engine)
 {
     var type = engine.GetType(TypeProperty, TypePath, TypeCodeTree);
     var value = engine.Get(ValueProperty, Path, CodeTree) as IEnumerable;
     var name = engine.GetVariable(Var, VarCodeTree);
     foreach (object item in value)
     {
         engine.DefineVariable(name, TypeHelper.Convert(item, type));
         Body.Execute(engine);
         engine.ClearShouldContinue();
         if (engine.ShouldInterrupt) break;
     }
 }
开发者ID:ricksladkey,项目名称:Markup-Programming,代码行数:13,代码来源:ForEach.cs

示例5: OnExecute

        protected override void OnExecute(Engine engine)
        {
            // Use the same name and type for the whole loop.
            var name = engine.GetVariable(Var, VarCodeTree);
            var type = engine.GetType(TypeProperty, TypePath, TypeCodeTree);
            if (type == null && (UpperLimit != null || Increment != null)) type = typeof(int);

            // If no name is specified then forever.
            if (name == null)
            {
                engine.SetBreakFrame();
                while (true)
                {
                    Body.Execute(engine);
                    engine.ClearShouldContinue();
                    if (engine.ShouldInterrupt) break;
                }
                return;
            }

            // Normal loop processing.
            SetLoopValue(name, engine.Get(ValueProperty, Path, CodeTree, type), type, engine);
            engine.SetBreakFrame();
            while (true)
            {
                if (While != null)
                {
                    if (!(bool)engine.Get(WhileProperty, WhilePath, WhileCodeTree, typeof(bool))) break;
                }
                else if (UpperLimit != null)
                {
                    var limit = engine.Get(UpperLimitProperty, UpperLimitPath, UpperLimitCodeTree, type);
                    if (!(bool)engine.Operator(Op.LessThan, GetLoopValue(name, type, engine), limit)) break;
                }
                Body.Execute(engine);
                engine.ClearShouldContinue();
                if (engine.ShouldInterrupt) break;
                if (Next.Count != 0)
                    Next.Execute(engine);
                else if (Increment != null)
                {
                    var increment = engine.Get(IncrementProperty, IncrementPath, IncrementCodeTree, type);
                    SetLoopValue(name, engine.Operator(Op.Plus, GetLoopValue(name, type, engine), increment), type, engine);
                }
            }
        }
开发者ID:ricksladkey,项目名称:Markup-Programming,代码行数:46,代码来源:For.cs


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