예제 #1
0
        /// <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;
        }
예제 #2
0
 /// <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;
 }