private MirrorAction GetDirectoryActionFromClient(FileOrDirectory directory, MirrorSituation situation, MirrorAction action) { var args = new MirrorEventArgs(directory.Path, situation, action); EventHandler <MirrorEventArgs> handler = StartingDirectory; if (handler != null) { handler(this, args); } if (args.PendingAction == MirrorAction.Skip || args.PendingAction == MirrorAction.Delete) { _skippedOrRemovedDirectories.Add(directory.Path); } return(args.PendingAction); }
private MirrorAction GetFileActionFromClient(string path, MirrorSituation situation, MirrorAction action) { //note... this is needed only because we don't currently have a //hierarchical list of things to walk, such that we trim in a more //effecient way if (_skippedOrRemovedDirectories.Any(d => path.StartsWith(d))) { return(MirrorAction.Skip); } var args = new MirrorEventArgs(path, situation, action); EventHandler <MirrorEventArgs> handler = StartingFile; if (handler != null) { handler(this, args); } return(args.PendingAction); }
public MirrorEventArgs(string path, MirrorSituation situation, MirrorAction defaultAction) { Situation = situation; Path = path; PendingAction = defaultAction; }