public IEnumerable <EmbeddedResourceItem> GetResources(string fullPath) { var encodedPath = EmbeddedResourcePathHelper.EncodeAsResourcesPath(fullPath); if (encodedPath.Length > 0 && !encodedPath.EndsWith(".")) { encodedPath = encodedPath + "."; } return(_resources.Value.Where(k => k.Key.StartsWith(encodedPath)).Select(d => d.Value)); }
internal void AddResources(Dictionary <string, EmbeddedResourceItem> resources) { foreach (var resourceName in Assembly.GetManifestResourceNames()) { if (!resourceName.StartsWith(ResourceNamespace)) { continue; } using (var stream = Assembly.GetManifestResourceStream(resourceName)) { var relativePath = ConvertToRelativePath(resourceName); var filePath = EmbeddedResourcePathHelper.NormalizePath(RootPath) + relativePath; resources[filePath] = new EmbeddedResourceItem( filePath, stream.GetAllBytes(), Assembly ); } } }
public EmbeddedResourceItem GetResource(string fullPath) { var encodedPath = EmbeddedResourcePathHelper.EncodeAsResourcesPath(fullPath); return(_resources.Value.GetOrDefault(encodedPath)); }