示例#1
0
        /// <summary>
        /// The file exists.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool FileExists(string virtualPath)
        {
            if (!virtualPath.EndsWith(EmbeddedResource.FILE_EXTENSION, StringComparison.InvariantCultureIgnoreCase))
            {
                return(false);
            }

            string resourceName = EmbeddedResourceHelper.GetResourceNameFromPath(virtualPath);

            return(EmbeddedResourceHelper.ResourceExists(resourceName));
        }
        /// <summary>
        /// When overridden in a derived class, returns a read-only stream to the virtual resource.
        /// </summary>
        /// <returns>
        /// A read-only stream to the virtual file.
        /// </returns>
        public Stream Open()
        {
            string resourceName = EmbeddedResourceHelper.GetResourceNameFromPath(this.virtualPath);

            return(EmbeddedResourceHelper.GetResource(resourceName));
        }