public void Combine(FsSenderChange other) { // Change + Rename -> ChangeAndRename if ((IsChange && other.IsRename) || (IsRename && other.IsChange)) { ChangeType = FsChangeType.ChangeAndRename; if (other.IsChange) { NeedToResolve = other.NeedToResolve; LastWriteTime = other.LastWriteTime; IsDirectory = other.IsDirectory; } if (other.IsRename) { OldPath = other.OldPath; } } }
public static FsSenderChange CreateWithPath(FsSenderChange fsChange, string path) { switch (fsChange.ChangeType) { case FsChangeType.Remove: return(CreateRemove(path)); case FsChangeType.Change: return(CreateChange(path)); case FsChangeType.Rename: return(CreateRename(path, fsChange.OldPath)); case FsChangeType.ChangeAndRename: return(CreateChangeAndRename(path, fsChange.OldPath)); default: // not reachable return(null); } }