public override void Evaluate() { String targetFile = RegexMatch.Groups[1].Value.Trim(); String volumeName = RegexMatch.Groups[4].Value.Trim(); String operation = RegexMatch.Groups[2].Value.Trim().ToUpper(); Volume targetVolume = GetVolume(volumeName); // Will throw if not found File file = null; switch (operation) { case "FROM": file = targetVolume.GetByName(targetFile); if (file == null) { throw new kOSException("File '" + targetFile + "' not found"); } SelectedVolume.SaveFile(new File(file)); break; case "TO": file = SelectedVolume.GetByName(targetFile); if (file == null) { throw new kOSException("File '" + targetFile + "' not found"); } targetVolume.SaveFile(new File(file)); break; } State = ExecutionState.DONE; }