private void OnContentModified(object sender, ContentModifiedArgs e) { _requestToResourceNameMap.Clear(); _requestToVirtualTargetMap.Clear(); if (SharedContentModified == null) { return; } string virtualLocation; if (!_resourceNameToVirtualPathMap.TryGetValue(e.ModifiedResourceName, out virtualLocation)) { if (_autoIncludeName != null && e.ModifiedResourceName.ToLower().Contains(_autoIncludeName.ToLower())) { // extra check to force clearing type cache of no _viewStart has been requested until now SharedContentModified(this, new ContentModifiedArgs(e.ModifiedResourceName)); } return; } var modifiedName = _pathBuilder .New() .CombineWith(virtualLocation) .AddOrKeepExtension(_defaultExtension) .GetLastPart(true); if (string.Equals(modifiedName, _autoIncludeName, StringComparison.OrdinalIgnoreCase)) { // If the name equals _autoIncludeName (like _viewStart) notify listeners. Such content is included in all generated source. Normally as a result the whole type cache needs to be cleared. SharedContentModified(this, new ContentModifiedArgs(e.ModifiedResourceName)); } }
private void OnSharedContentModified(object sender, ContentModifiedArgs e) { // clear the whole cache is any shared content has been modified ClearTypeCache(); }
private void OnContentModified(object sender, ContentModifiedArgs e) { CacheBucket value; _compiledTemplateTypeCache.TryRemove(e.ModifiedResourceName, out value); }