Beispiel #1
0
 /// <summary>
 ///   Performs the actions for a given iteration, when available.
 /// </summary>
 /// <param name = "currentIteration">The current iteration to do actions for.</param>
 public void DoActions(LoopIteration currentIteration)
 {
     foreach (var hookedOperation in _hookedOperation.Where(o => o.Condition(_iterationList, currentIteration)))
     {
         hookedOperation.HookOperation();
     }
 }
Beispiel #2
0
        public void EndInsideLoop(int id)
        {
            LoopIteration iter = this.operations.Pop() as LoopIteration;

            if (iter == null)
            {
                throw new InvalidOperationException();
            }

            AddOperation(iter);

            this.iteration++;

            foreach (var kvp in this.values.Where(kvp => kvp.Value.Count != this.iteration))
            {
                kvp.Value.Add(Skipped);
            }

            if (IsLoggingInifiniteLoop())
            {
                EndLoop(id);

                /*MethodCall call = this.operations.Pop() as MethodCall;
                 * if (call != null)
                 *      AddOperation (call);*/

                throw new OperationCanceledException("Infinite loop detected", CancelToken);
            }
        }
Beispiel #3
0
        private void OnIterationChanged(object sender, IterationChangedEventArgs args)
        {
            LoopIteration iteration = args.PreviousIteration;

            if (iteration != null)
            {
                HashSet <int> removes = new HashSet <int>();
                foreach (Operation op in iteration.Operations)
                {
                    if (removes.Contains(op.Id))
                    {
                        continue;
                    }

                    ViewCache   cache     = this.views[op.GetType()];
                    InstantView opAdorner = cache.GetView(op.Id);
                    if (opAdorner != null)
                    {
                        this.layer.RemoveAdornment(opAdorner);
                    }
                }
            }

            AdornCode(this.view.TextSnapshot, GetCancelSource(current: true).Token);

            //ITextSnapshot s = this.view.TextSnapshot;

            //var map = this.context.LineMap ?? await LineMap.ConstructAsync (this.view.TextSnapshot, this.context.Span.GetText (s), GetCancelSource (current: true).Token);
            //AdornOperationContainer (args.NewIteration, s, map, GetCancelSource (current: true).Token);
        }
			/// <summary>
			///   Performs the actions for a given iteration, when available.
			/// </summary>
			/// <param name = "currentIteration">The current iteration to do actions for.</param>
			public void DoActions( LoopIteration currentIteration )
			{
				foreach ( var hookedOperation in _hookedOperation.Where( o => o.Condition( _iterationList, currentIteration ) ) )
				{
					hookedOperation.HookOperation();
				}
			}
Beispiel #5
0
 public IterationChangedEventArgs(LoopIteration oldValue, LoopIteration newValue)
 {
     PreviousIteration = oldValue;
     NewIteration      = newValue;
 }
Beispiel #6
0
 protected override bool HasMoreElements(int enumeratedAlready, LoopIteration previous)
 {
     return(enumeratedAlready < _enumerateIterations.Count);
 }
Beispiel #7
0
 protected override LoopIteration GetNext(int enumeratedAlready, LoopIteration previous)
 {
     return(_enumerateIterations[enumeratedAlready]);
 }
Beispiel #8
0
 public IterationChangedEventArgs(LoopIteration oldValue, LoopIteration newValue)
 {
     PreviousIteration = oldValue;
     NewIteration = newValue;
 }