예제 #1
0
파일: Protocol.cs 프로젝트: RobAmos/osla
        private static List<ProtocolInstruction> ProtocolWithRepsRecurscion(List<ProtocolInstruction> Instructions, LoopInstruction Repeat, int RepeatIndex)
        {
            //this protocol should be called by the one below it to expand out a loop
            List<ProtocolInstruction> ProtToAppend = new List<ProtocolInstruction>();//this will be returned
            for (int j = 0; j < Repeat.TimesToRepeat; j++)
            {
                for (int i = Repeat.StartInstruction - 1; i < RepeatIndex; i++)
                {
                    ProtocolInstruction Item = Instructions[i];
                    if (Item is LoopInstruction)
                    {
                        LoopInstruction NewRepeat = (LoopInstruction)Item;
                        List<ProtocolInstruction> NewListToAdd = ProtocolWithRepsRecurscion(Instructions, NewRepeat, i);
                        ProtToAppend.AddRange(NewListToAdd);
                    }
                    else
                    {
                        ProtToAppend.Add(Item);
                    }

                }
            }
            return ProtToAppend;
        }
예제 #2
0
파일: Protocol.cs 프로젝트: RobAmos/osla
 public ListBoxRepeatItem()
 {
     RepeatInstruction = new LoopInstruction();
 }