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


C# IScriptContext.IsContinue方法代码示例

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


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

示例1: Evaluate

    //TODO: Refactor
    public override void Evaluate(IScriptContext context)
    {
      if (ChildNodes.Count == 0) return;

      //Create local scope
      if (ShouldCreateScope)
      {
        IScriptScope scope = RuntimeHost.ScopeFactory.Create(ScopeTypes.Local, context.Scope);
        context.CreateScope(scope);
      }

      try
      {
        int index = 0;
        while (index < ChildNodes.Count)
        {
          var node = (ScriptAst)ChildNodes[index];
          node.Evaluate(context);

          if (context.IsBreak() || context.IsReturn() || context.IsContinue())
          {
            break;
          }

          index++;
        }
      }
      finally
      {
        if (ShouldCreateScope)
          context.RemoveLocalScope();
      }
    }
开发者ID:eightrivers,项目名称:SSharp,代码行数:34,代码来源:ScriptCompoundStatement.cs

示例2: Evaluate

        public override void Evaluate(IScriptContext context)
        {
            bool condBool;
              object result = RuntimeHost.NullValue;

              init.Evaluate(context);
              cond.Evaluate(context);
              condBool = context.Result == null ? true : (bool)context.Result;

              while (condBool)
              {
            statement.Evaluate(context);
            result = context.Result;

            if (context.IsBreak() || context.IsReturn())
            {
              context.SetBreak(false);
              break;
            }

            if (context.IsContinue())
            {
              context.SetContinue(false);
            }

            next.Evaluate(context);
            cond.Evaluate(context);
            condBool = context.Result == null ? true : (bool)context.Result;
              }

              context.Result = result;
        }
开发者ID:Zepheus,项目名称:Fiesta_Utils,代码行数:32,代码来源:ScriptForStatement.cs

示例3: Evaluate

        public override void Evaluate(IScriptContext context)
        {
            condition.Evaluate(context);
              object lastResult = RuntimeHost.NullValue;

              while ((bool)context.Result)
              {
            statement.Evaluate(context);
            lastResult = context.Result;

            if (context.IsBreak() || context.IsReturn())
            {
              context.SetBreak(false);
              break;
            }

            if (context.IsContinue())
            {
              context.SetContinue(false);
            }

            condition.Evaluate(context);
              }

              context.Result = lastResult;
        }
开发者ID:Zepheus,项目名称:Fiesta_Utils,代码行数:26,代码来源:ScriptWhileStatement.cs

示例4: Evaluate

    //TODO: Refactor
    public override void Evaluate(IScriptContext context)
    {
      if (ChildNodes.Count == 0) return;
     
      int index = 0;
      while (index < ChildNodes.Count)
      {
        ScriptAst node = (ScriptAst)ChildNodes[index];
        node.Evaluate(context);

        if (context.IsBreak() || context.IsReturn() || context.IsContinue())
        {
          break;
        }

        index++;
      }
    }
开发者ID:PantsIsTaken,项目名称:MapleShark,代码行数:19,代码来源:ScriptCompoundStatement.cs

示例5: Evaluate

    public override void Evaluate(IScriptContext context)
    {
      var result = RuntimeHost.NullValue;

      //Create local scope
      var scope = RuntimeHost.ScopeFactory.Create(ScopeTypes.Local, context.Scope);
      context.CreateScope(scope);

      try
      {
        _init.Evaluate(context);
        _cond.Evaluate(context);
        bool condBool = context.Result == null ? true : (bool)context.Result;

        while (condBool)
        {
          _statement.Evaluate(context);
          result = context.Result;

          if (context.IsBreak() || context.IsReturn())
          {
            context.SetBreak(false);
            break;
          }

          if (context.IsContinue())
          {
            context.SetContinue(false);
          }


          _next.Evaluate(context);
          _cond.Evaluate(context);
          condBool = context.Result == null ? true : (bool)context.Result;
        }

        context.Result = result;
      }
      finally
      {
        context.RemoveLocalScope();
      }
    }
开发者ID:eightrivers,项目名称:SSharp,代码行数:43,代码来源:ScriptForStatement.cs

示例6: Evaluate

        public override void Evaluate(IScriptContext context)
        {
            expr.Evaluate(context);

              IEnumerable enumeration = context.Result as IEnumerable;
              IEnumerator enumerator = null;

              if (enumeration != null)
              {
            enumerator = enumeration.GetEnumerator();
              }
              else
              {
            IObjectBind bind = RuntimeHost.Binder.BindToMethod(context.Result, "GetEnumerator",new Type[0], new object[0]);
            if (bind != null)
              enumerator = bind.Invoke(context, null) as IEnumerator;
              }

              if (enumerator == null)
            throw new ScriptException("GetEnumerator() method did not found in object: " + context.Result.ToString());

              enumerator.Reset();

              while(enumerator.MoveNext())
              {
            context.SetItem(name.Text, enumerator.Current);
            statement.Evaluate(context);
            if (context.IsBreak() || context.IsReturn())
            {
              context.SetBreak(false);
              break;
            }
            if (context.IsContinue())
            {
              context.SetContinue(false);
            }
              }
        }
开发者ID:2yangk23,项目名称:MapleShark,代码行数:38,代码来源:ScriptForEachStatement.cs

示例7: Evaluate

    public override void Evaluate(IScriptContext context)
    {
      _expr.Evaluate(context);

      if (context.Result == null) throw new NullReferenceException(string.Format(Strings.NullReferenceInCode, Code(context)));

      var enumeration = context.Result as IEnumerable;
      IEnumerator enumerator = null;

      if (enumeration != null)
      {
        enumerator = enumeration.GetEnumerator();
      }
      else
      {
        IBinding bind = RuntimeHost.Binder.BindToMethod(context.Result, "GetEnumerator", new Type[0], new object[0]);
        if (bind != null)
          enumerator = bind.Invoke(context, null) as IEnumerator;
      }

      if (enumerator == null)
        throw new ScriptExecutionException(string.Format(Strings.ForEachMethodNotFound, context.Result));

      enumerator.Reset();

      while (enumerator.MoveNext())
      {
        context.SetItem(_name.Text, enumerator.Current);
        _statement.Evaluate(context);
        if (context.IsBreak() || context.IsReturn())
        {
          context.SetBreak(false);
          break;
        }
        if (context.IsContinue())
        {
          context.SetContinue(false);
        }
      }

    }
开发者ID:eightrivers,项目名称:SSharp,代码行数:41,代码来源:ScriptForEachStatement.cs


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