public override void Evaluate() { String fileName = RegexMatch.Groups[1].Value; File file = SelectedVolume.GetByName(fileName); if (file != null) { ContextRunProgram runContext = new ContextRunProgram(this); Push(runContext); if (file.Count > 0) { runContext.Run(file); State = ExecutionState.WAIT; } else { State = ExecutionState.DONE; } } else { throw new kOSException("File not found '" + fileName + "'."); } }
public kOSException(String message, ExecutionContext context) : this(message) { this.LineNumber = context.Line; this.Context = context; this.Program = context.FindClosestParentOfType<ContextRunProgram>(); }
public override void Evaluate() { String fileName = RegexMatch.Groups[1].Value; File file = SelectedVolume.GetByName(fileName); var parameters = new List <Expression>(); if (RegexMatch.Groups.Count > 1) { String paramString = RegexMatch.Groups[3].Value; foreach (String param in Utils.ProcessParams(paramString)) { Expression subEx = new Expression(param, this); parameters.Add(subEx); } } if (file != null) { ContextRunProgram runContext = new ContextRunProgram(this, parameters, fileName); Push(runContext); if (file.Count > 0) { runContext.Run(file); State = ExecutionState.WAIT; } else { State = ExecutionState.DONE; } } else { throw new kOSException("File not found '" + fileName + "'.", this); } }
public override void Evaluate() { String fileName = RegexMatch.Groups[1].Value; File file = SelectedVolume.GetByName(fileName); var parameters = new List<Expression>(); if (RegexMatch.Groups.Count > 1) { String paramString = RegexMatch.Groups[3].Value; foreach (String param in Utils.ProcessParams(paramString)) { Expression subEx = new Expression(param, this); parameters.Add(subEx); } } if (file != null) { ContextRunProgram runContext = new ContextRunProgram(this, parameters); Push(runContext); if (file.Count > 0) { runContext.Run(file); State = ExecutionState.WAIT; } else { State = ExecutionState.DONE; } } else { throw new kOSException("File not found '" + fileName + "'."); } }
public kOSException(String message, ExecutionContext context) : this (message) { this.LineNumber = context.Line; this.Context = context; this.Program = context.FindClosestParentOfType<ContextRunProgram>(); }