protected override void RefreshOverride() { var current = default(TResult); var current2 = Source.Current; var flag = false; foreach (var conditionalCase in _conditionalCases) { if (!conditionalCase.Evaluate(current2)) { continue; } current = conditionalCase.Return(current2); flag = true; break; } if (!flag && _defaultCase != null) { current = _defaultCase.Return(current2); } Current = current; }
/// <summary> /// When overridden in a derived class, refreshes the operator. /// </summary> protected override void RefreshOverride() { var result = default(TResult); var source = Source.Current; var caseMatched = false; foreach (var conditionalCase in _conditionalCases) { if (conditionalCase.Evaluate(source)) { result = conditionalCase.Return(source); caseMatched = true; break; } } if (!caseMatched && _defaultCase != null) { result = _defaultCase.Return(source); } Current = result; }