private void FileModifiedEvent(object sender, FileEvent e) { if (e.ChangeType == FileEventChangeType.Changed || e.ChangeType == FileEventChangeType.Renamed) { lock (recentlyModifiedShaders) { recentlyModifiedShaders.Add(Path.GetFileNameWithoutExtension(e.Name)); } } }
/// <summary> /// Called when a file event occured. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The file event.</param> protected virtual void OnModified(object sender, FileEvent e) { var handler = Modified; if (handler != null) handler(sender, e); }
private void directoryWatcher_Modified(object sender, FileEvent e) { // If tracking is not enabled, don't bother to track files on disk if (!EnableTracking) return; // Store only the most recent events lock (fileEvents) { fileEvents.Add(e); } }
/// <summary> /// Called when a file event occurred. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The file event.</param> protected virtual void OnModified(object sender, FileEvent e) { Modified?.Invoke(sender, e); }