/// <inheritdoc/>
        public EmbeddedResourceInfo GetResource(string fullPath)
        {
            //Get from cache if exists!
            if (_resourceCache.ContainsKey(fullPath))
            {
                return(_resourceCache[fullPath]);
            }

            var pathInfo = GetPathInfoForFullPath(fullPath);

            using (var stream = pathInfo.Assembly.GetManifestResourceStream(pathInfo.FindManifestName(fullPath)))
            {
                if (stream == null)
                {
                    throw new AbpException("There is no exposed embedded resource for " + fullPath);
                }

                return(_resourceCache[fullPath] = new EmbeddedResourceInfo(stream.GetAllBytes(), pathInfo.Assembly));
            }
        }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public EmbeddedResourceInfo GetResource(string fullPath)
        {
            //Get from cache if exists!
            if (_resourceCache.ContainsKey(fullPath))
            {
                return _resourceCache[fullPath];
            }

            var pathInfo = GetPathInfoForFullPath(fullPath);

            using (var stream = pathInfo.Assembly.GetManifestResourceStream(pathInfo.FindManifestName(fullPath)))
            {
                if (stream == null)
                {
                    throw new AbpException("There is no exposed embedded resource for " + fullPath);
                }

                return _resourceCache[fullPath] = new EmbeddedResourceInfo(stream.GetAllBytes(), pathInfo.Assembly);
            }
        }