Ejemplo n.º 1
0
        /// <summary>
        /// Alters the queue on detection of a Renamed event
        /// </summary>
        /// <param name="sender">the Sender of the event</param>
        /// <param name="renamedEventArgs">the event arguments from the Renamed Event</param>
        private void FolderWatcherRenamed(object sender, RenamedEventArgs renamedEventArgs)
        {
            var oldItem = new FolderWatcherQueueItem {
                Path = renamedEventArgs.OldFullPath
            };

            _queue.DequeueEnqueueMultiple(new[] { oldItem }, AddParent(renamedEventArgs.FullPath));
        }
Ejemplo n.º 2
0
        private IEnumerable <FolderWatcherQueueItem> AddParent(string path)
        {
            var queue = new FolderWatcherQueueItem[2];

            queue[0] = new FolderWatcherQueueItem {
                Path = path, Time = DateTime.Now
            };
            if (_addParentFolder && File.Exists(path))
            {
                queue[1] = new FolderWatcherQueueItem {
                    Path = Path.GetDirectoryName(path), Time = DateTime.Now
                };
            }

            return(queue);
        }