Beispiel #1
0
        public override Stream Open()
        {
            AssemblyNameResolution assemblyNameResolution;

            if (_embeddedResourceNameResolver.TryResolve(_pathInfo, out assemblyNameResolution))
            {
                var result = _streamFetcher.Fetch(assemblyNameResolution.Assembly, assemblyNameResolution.Name);
                return(result);
            }
            throw new Exception("Unable to open virtual file");
        }
Beispiel #2
0
        bool IsEmbeddedResourcePath(string virtualPath)
        {
            //if path is serving a file... need to fail resolve and pass to httpHandler
            //todo: figure out all extensions that should go here (fonts, images, etc)
            if (virtualPath.EndsWith(".js", StringComparison.InvariantCultureIgnoreCase) || virtualPath.EndsWith(".css", StringComparison.InvariantCultureIgnoreCase))
            {
                return(false);
            }
            AssemblyNameResolution result;
            var pathInfo = new EmbeddedResourcePathInfo(virtualPath);

            return(_embeddedResourceNameResolver.TryResolve(pathInfo, out result));
        }