public void CleanAndSync(bool recursive) { //Synchronizes the tree with the FS. //Remove Deleted files and clears the tree state List <FsItem> removed = new List <FsItem>(); foreach (FsItem item in Children) { if (item.FsItemState == FsItemState.Removed) { removed.Add(item); } item.CleanAndSync(true); } foreach (FsItem r in removed) { RemoveChild(r); } //Update modified time. if (NewModifyTime != null) { LastModifyTime = NewModifyTime.Value; NewModifyTime = null; } //Reset the state. FsItemState = FsItemState.None; }
public bool UpdateFolderContentsChanged() { //Update folder branches where files have been changed bool bRet = false; foreach (FsItem c in Children) { if (c.FsItemState != FsItemState.None) { bRet = true; } bRet = bRet || c.UpdateFolderContentsChanged(); } if (IsFolder() && bRet) { FsItemState = FsItemState.FolderContentsChanged; } return(bRet); }