private void OnFileModified(FileWatchEventArgs e) { FileModified?.Invoke(this, e); }
private static void FileWatchOptions_FileModified(IBundleManager bundleManager, CacheBusterResolver cacheBusterResolver, string bundleName, Bundle bundle, bool debug, FileWatchEventArgs e) { var cacheBuster = cacheBusterResolver.GetCacheBuster(bundle.GetBundleOptions(bundleManager, debug).GetCacheBusterType()); //this file is part of this bundle, so the persisted processed/combined/compressed will need to be // invalidated/deleted/renamed foreach (var compressionType in new[] { CompressionType.deflate, CompressionType.gzip, CompressionType.none }) { var compFilePath = e.FileSystemHelper.GetCurrentCompositeFilePath(cacheBuster, compressionType, bundleName); if (File.Exists(compFilePath)) { File.Delete(compFilePath); } } }
//TODO: Add an event here to be able to subscribe to file changes? public void Changed(FileWatchEventArgs args) { OnFileModified(args); }