public static void EvaluateIfThenLine(IfThenLine line) { if (EvaluateCondition(line.Condition, out bool result)) { if (line.ElseLine > 0) { int first = result ? line.ElseLine + 1 : line.Number + 1; int last = result ? line.EndLine - 1 : line.ElseLine - 1; Messenger.Default.Send(new InibitIsoLineMessage() { First = first, Last = last }); } else { if (!result) { Messenger.Default.Send(new InibitIsoLineMessage() { First = line.Number + 1, Last = line.EndLine - 1 }); } } } //else //{ // throw new ArgumentException($"The condition \"{line.Condition}\" could not be evaluated!"); //} }
public static void Process(IfThenLine isoLine) => IfThenElseHelper.EvaluateIfThenLine(isoLine);