protected override void DoAction() { var pattern = ParseStringForVariable(Pattern); FileInfo[] fileInfos = Pwd.GetFiles(pattern, this.Recurse ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly); Variables[DestinationVariable] = fileInfos.Select(fi => fi.FullName).ToList(); }
protected override void DoAction() { foreach (FileInfo file in Pwd.EnumerateFiles(ParseStringForVariable(From))) { file.MoveTo(ParseStringForVariable(To)); } }
protected override void DoAction() { DirectoryInfo newDir = Pwd.CreateSubdirectory(ParseStringForVariable(DirectoryName)); if (NavigateInto) { Pwd = newDir; } }
protected override void DoAction() { foreach (FileInfo file in Pwd.EnumerateFiles(ParseStringForVariable(Filename))) { RecycleOption option = SendToRecyclingBin ? RecycleOption.SendToRecycleBin : RecycleOption.DeletePermanently; FileSystem.DeleteFile(file.FullName, UIOption.AllDialogs, option); } }
protected override void DoAction() { try { Pwd = Pwd.GetDirectories(ParseStringForVariable(DirectoryName)).First(); } catch (DirectoryNotFoundException e) { throw new ActionException(string.Format("Directory not found: {0}", DirectoryName), e, this); } catch (ArgumentException e) { throw new ActionException(string.Format("Bad Path {0}", DirectoryName), e, this); } catch (InvalidOperationException e) { throw new ActionException(string.Format("Bad Path {0}", DirectoryName), e, this); } }