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; }
private void Save() { statusAnimstring = SelectedVolume.SaveFile(file) ? "SAVED." : "CAN'T SAVE - DISK FULL."; statusAnimActive = true; statusAnimProg = 0; }
private void Save() { if (SelectedVolume.SaveFile(File)) { StatusAnimString = "SAVED."; } else { StatusAnimString = "CAN'T SAVE - DISK FULL."; } StatusAnimActive = true; StatusAnimProg = 0; }
public override void Evaluate() { var targetFile = RegexMatch.Groups[1].Value.Trim(); var volumeName = RegexMatch.Groups[4].Value.Trim(); var operation = RegexMatch.Groups[2].Value.Trim().ToUpper(); var targetVolume = GetVolume(volumeName); // Will throw if not found Persistance.File file; switch (operation) { case "FROM": file = targetVolume.GetByName(targetFile); if (file == null) { throw new KOSException("File '" + targetFile + "' not found", this); } if (!SelectedVolume.SaveFile(new Persistance.File(file))) { throw new KOSException("File copy failed", this); } break; case "TO": file = SelectedVolume.GetByName(targetFile); if (file == null) { throw new KOSException("File '" + targetFile + "' not found", this); } if (!targetVolume.SaveFile(new Persistance.File(file))) { throw new KOSException("File copy failed", this); } break; } State = ExecutionState.DONE; }