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


C# Loop类代码示例

本文整理汇总了C#中Loop的典型用法代码示例。如果您正苦于以下问题:C# Loop类的具体用法?C# Loop怎么用?C# Loop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: EdiMapping

 private EdiMapping(XDocument xml)
 {
     if (xml.Root == null)
         throw new Exception("XML is missing a root element.");
     Errors = new List<string>();
     _root = ReadLoop(xml.Root);
 }
开发者ID:inPulseWorks,项目名称:editools,代码行数:7,代码来源:EdiMapping.cs

示例2: Compile

        public override void Compile(ByteCode bc)
        {
            var L = new Loop
            {
                Scope = m_StackFrame
            };

            bc.PushSourceRef(m_Repeat);

            bc.LoopTracker.Loops.Push(L);

            var start = bc.GetJumpPointForNextInstruction();

            bc.Emit_Enter(m_StackFrame);
            m_Block.Compile(bc);

            bc.PopSourceRef();
            bc.PushSourceRef(m_Until);
            bc.Emit_Debug("..end");

            m_Condition.Compile(bc);
            bc.Emit_Leave(m_StackFrame);
            bc.Emit_Jump(OpCode.Jf, start);

            bc.LoopTracker.Loops.Pop();

            var exitpoint = bc.GetJumpPointForNextInstruction();

            foreach (var i in L.BreakJumps)
                i.NumVal = exitpoint;

            bc.PopSourceRef();
        }
开发者ID:eddy5641,项目名称:moonsharp,代码行数:33,代码来源:RepeatStatement.cs

示例3: BlockingPipeListener

		BlockingPipeListener(Loop loop)
			: base(loop)
		{
			PipeListener = new PipeListener(loop);
			Listener = PipeListener as Listener;
			Handle = PipeListener;
		}
开发者ID:txdv,项目名称:LibuvSharp.Blocking,代码行数:7,代码来源:BlockingPipeListener.cs

示例4: Dispose_should_throw_if_child_loops_not_disposed

 public void Dispose_should_throw_if_child_loops_not_disposed()
 {
     using (var loop = new Loop(Times.Once()))
     {
         loop.CreateLoop(Times.Exactly(2));
     }
 }
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:7,代码来源:StepTest.cs

示例5: PrepareWatcher

        public PrepareWatcher(Loop loop, Action<PrepareWatcher, EventTypes> callback)
            : base(loop)
        {
            this.callback = callback;

            watcher_ptr = manos_prepare_watcher_create (unmanaged_callback, GCHandle.ToIntPtr (gc_handle));
        }
开发者ID:vbatz258,项目名称:manos,代码行数:7,代码来源:PrepareWatcher.cs

示例6: Routine

    public IEnumerator Routine(Loop loop,float loopTime)
    {
        if (loop.actionDictionary.Count > 0)
        {
            List<Action> actionList = new List<Action>();
            actionList.AddRange(loop.actionDictionary.Values);

            while (runningLoop)
            {

                foreach (Action action in actionList)
                switch (action.actionType)
                {
                    case Action.ActionTypes.Move:

                        Move move = (Move)action;
                        move.ExecuteAction(this.gameObject);
                        break;

                    default:

                        CodeInputHandler.abortPlay("type failed ! check your action type  - 66 action.cs ");
                            runningLoop = false;
                        break;

                }
                yield return new WaitForSeconds(loopTime);
            }
        }
        else
        {
            yield return new WaitForSeconds(loopTime);
        }
    }
开发者ID:weawesomeyo,项目名称:GEJ,代码行数:34,代码来源:SingleObject.cs

示例7: BlockingTcpListener

		BlockingTcpListener(Loop loop)
			: base(loop)
		{
			TcpListener = new TcpListener(loop);
			Listener = TcpListener as Listener;
			Handle = TcpListener;
		}
开发者ID:txdv,项目名称:LibuvSharp.Blocking,代码行数:7,代码来源:BlockingTcpListener.cs

示例8: Dispose_should_do_nothing_if_called_multiple_times

 public void Dispose_should_do_nothing_if_called_multiple_times()
 {
     using (var loop = new Loop(Times.Once()))
     {
         loop.Dispose();
         loop.Dispose();
     }
 }
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:8,代码来源:LoopTest.cs

示例9: A_new_step_should_be_added_directly_if_it_contains_no_child_loops

        public void A_new_step_should_be_added_directly_if_it_contains_no_child_loops()
        {
            using (var loop = new Loop(Times.Once()))
            {
                var step = loop.CreateStep("", Times.Once());

                Assert.That(loop.Steps.Contains(step));
            }
        }
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:9,代码来源:LoopTest.cs

示例10: MicroThread

		public MicroThread(Loop loop, Action callback)
		{
			Loop = loop;

			State = MicroThreadState.NotStarted;
			Loop.GetMicroThreadCollection().Add(this);

			cb = callback;
		}
开发者ID:txdv,项目名称:LibuvSharp.Blocking,代码行数:9,代码来源:MicroThread.cs

示例11: FlatLoop

        public FlatLoop(Loop sourceLoop, FlatFace flatFace)
        {
            this.sourceLoop = sourceLoop;
            this.flatFace = flatFace;

            fins = new List<FlatFin>();
            foreach (Fin fin in sourceLoop.Fins)
                fins.Add(new FlatFin(this, fin));
        }
开发者ID:bcourter,项目名称:SpaceClaim-AddIns,代码行数:9,代码来源:FlatLoop.cs

示例12: A_new_loop_should_be_added_directly_if_it_contains_no_child_loops

 public void A_new_loop_should_be_added_directly_if_it_contains_no_child_loops()
 {
     using (var loop = new Loop(Times.Once()))
     {
         using (var child = loop.CreateLoop(Times.Once()))
         {
             Assert.That(loop.Steps.Contains(child));
         }
     }
 }
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:10,代码来源:LoopTest.cs

示例13: Compute

 public static void Compute(Loop loop, string file)
 {
     var @in = new UVFileStream(loop);
     @in.Open(file, UVFileAccess.Read, (ex) => {
         HashStream.ComputeString(SHA1Managed.Create(), @in, (str) => {
             Console.WriteLine ("{0} {1}", str, file);
         });
         @in.Resume();
     });
 }
开发者ID:oskarwkarlsson,项目名称:LibuvSharp,代码行数:10,代码来源:HashStream.cs

示例14: InvalidRange

        public void InvalidRange()
        {
            var stringlit = new StringLiteral("foo", 0);
            var range = new Range(stringlit, stringlit, 0);
            var variabledecl = new VariableDeclaration("foo", "int", 0);
            var variable = new VariableReference("foo", 0);
            var loop = new Loop(variable, range, new List<Statement>(), 0);
            statementlist.Add(variabledecl);
            statementlist.Add(loop);
            var parsetree = new Program(statementlist);

            Assert.Throws<SemanticError>(() => symbolTableBuilder.BuildSymbolTableAndTypeCheck(parsetree));
        }
开发者ID:Lateks,项目名称:Mini-PL-Interpreter,代码行数:13,代码来源:SemanticAnalysisTest.cs

示例15: visit

            public void visit(Loop node)
            {
                if (symboltable.resolve(node.VarName).Type != "int")
                    throw new SemanticError("Loop variable " + node.VarName +
                        " on row " + node.Row + " is not an int.");

                for (int i = 0; i < 2; i++)
                { // Check twice to prevent variable declarations inside the loop body
                    // (would cause problems because of singular scope).
                    foreach (Statement statement in node.LoopBody)
                        statement.accept(this);
                }
            }
开发者ID:Lateks,项目名称:Mini-PL-Interpreter,代码行数:13,代码来源:SemanticAnalysis.cs


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