public bool MoveNext() { zCheckBreakOrSkip(); if (m_PendingBranch != null) { m_Branches.Add(m_PendingBranch); m_CurrentBranch = m_PendingBranch; m_PendingBranch = null; m_CurrentPosition++; return(true); } ExecutionBranch.MoveInfo moveInfo; while (!(moveInfo = m_CurrentBranch.MoveNext()).Success) { zOnBranchEnded(new BranchEndedEventArgs(m_CurrentBranch)); if (m_Branches.Count == 1) { return(false); } m_CurrentBranch.Steps = null; m_CurrentBranch.Dispose(); m_Branches.Remove(m_CurrentBranch); m_CurrentBranch = m_Branches[m_Branches.Count - 1]; } m_CurrentPosition++; if (moveInfo.CausedIteration) { m_CurrentPosition -= m_CurrentBranch.RecursiveStepCount(); } return(true); }
private void zClearPendingBranch() { if (m_PendingBranch != null) { m_PendingBranch.Dispose(); m_PendingBranch = null; } }
public StepScope(string scopeName, string className, string cacheKey, ExecutionBranch rootBranch) { this.ScopeName = scopeName; this.ClassName = className; this.CacheKey = cacheKey; this.RootBranch = rootBranch; this.VariableList = new List <StateVariableInfo>(); }
public void Reset() { m_BreakBranch = false; m_SkipIteration = false; zClear(true); m_CurrentBranch = m_Branches[0]; m_CurrentBranch.Reset(); m_CurrentPosition = 0; }
private void zClear(bool forReset) { int numberOfBranchesToLeave = forReset ? 1 : 0; while (m_Branches.Count > numberOfBranchesToLeave) { ExecutionBranch branch = m_Branches[m_Branches.Count - 1]; branch.Dispose(); m_Branches.Remove(branch); } m_CurrentBranch = null; zClearPendingBranch(); }
public void SetNewBranch(List <Step> branch, IIterator iterator) { if (m_PendingBranch != null) { throw new InvalidOperationException("Cannot set new branch because there is already a branch pending. Call MoveNext first."); } if (branch.Count == 0) { throw new InvalidOperationException("Cannot set new branch without any steps."); } m_PendingBranch = new ExecutionBranch(branch); if (iterator != null) { m_PendingBranch.SetIterator(iterator); } }
public BranchEndedEventArgs(ExecutionBranch branch) { this.Branch = branch; }