public void forceCloseResourceFile(String filename) { CachedResource cachedResource = this[filename]; if (cachedResource != null) { cachedResource.AllowClose = true; closeResource(cachedResource.File); } }
public Stream openFile(string filename) { CachedResource cachedResource = ResourceCache[filename]; if (cachedResource != null) { return(cachedResource.openStream()); } else { return(backingProvider.openFile(filename)); } }
public void addFile(string path, string targetDirectory) { String filename = Path.GetFileName(path); String destinationPath = Path.Combine(targetDirectory, filename); backingProvider.addFile(path, targetDirectory); CachedResource cachedResource = ResourceCache[destinationPath]; if (cachedResource != null) { cachedResource.AllowClose = true; ResourceCache.closeResource(path); } }
public void add(CachedResource resource) { String file = fixPath(resource.File); if (!cachedResources.ContainsKey(file)) { cachedResources.Add(file, resource); } else { cachedResources[file] = resource; } if (CachedResourceAdded != null) { CachedResourceAdded.Invoke(this, resource); } }
public void addCachedResource(CachedResource cachedResource) { resourceProvider.ResourceCache.add(cachedResource); }