Example #1
0
        /// <summary>
        ///     Record change event.
        /// </summary>
        /// <param name="change">The change.</param>
        internal void RecordChangeEvent(BuildFileChange change)
        {
            lock (_syncLock)
            {
                if (change.ChangeType == WatcherChangeTypes.Deleted && BuildArtefacts.Contains(change.FullPath))
                {
                    BuildArtefacts.Remove(change.FullPath);
                }

                if (change.ChangeType == WatcherChangeTypes.Renamed && BuildArtefacts.Contains(change.OldFullPath))
                {
                    BuildArtefacts.Remove(change.OldFullPath);
                }

                if ((change.ChangeType == WatcherChangeTypes.Created || change.ChangeType == WatcherChangeTypes.Renamed) &&
                    BuildArtefacts.Contains(change.FullPath) == false)
                {
                    BuildArtefacts.Add(change.FullPath);
                }
            }
        }
Example #2
0
 /// <summary>
 /// Event handler. Called by watcher for deleted events.
 /// </summary>
 /// <param name="sender">Source of the event.</param>
 /// <param name="e">     File system event information.</param>
 internal void watcher_Deleted(object sender, FileSystemEventArgs e)
 {
     var change = new BuildFileChange(e);
     RecordChangeEvent(change);
 }
Example #3
0
 /// <summary>
 /// Event handler. Called by watcher for renamed events.
 /// </summary>
 /// <param name="sender">Source of the event.</param>
 /// <param name="e">     Renamed event information.</param>
 internal void watcher_Renamed(object sender, RenamedEventArgs e)
 {
     var change = new BuildFileChange(e);
     RecordChangeEvent(change);
 }