/// <summary> /// remove item at path making entry in log /// </summary> /// <param name="path"></param> /// <param name="pos"></param> /// <returns>success</returns> public override bool removeDeleted(string path, changeLog log) { string currentPath = Uri.UnescapeDataString(Path.Combine(path, Name)); bool res = false; foreach (TrackedFile item in contents.Reverse<TrackedFile>()) { res = item.removeDeleted(currentPath, log); } if (!Directory.Exists(currentPath)) { log.add(getRelative(currentPath), WatcherChangeTypes.Deleted, "", true); if (Parent != null) Parent.removeItem(this); return true; } return res; }
/// <summary> /// remove because file was deleted by adding to log /// </summary> /// <param name="path"></param> /// <param name="log"></param> /// <returns></returns> public virtual bool removeDeleted(string path, changeLog log) { string currentPath = Uri.UnescapeDataString(Path.Combine(path, Name)); //string currentPath = path; if (!File.Exists(currentPath)) { log.add(getRelative(currentPath), WatcherChangeTypes.Deleted, snapshot, false); Parent.removeItem(this); return true; } return false; }