C# 클래스 Masonry.Core.Hosting.EmbeddedFileProvider

Used to provide embedded files (other than views).
Can be used to provide embedded content files such as images, scripts etc.
상속: IVirtualFileProvider
파일 보기 프로젝트 열기: DenisVuyka/Masonry 1 사용 예제들

공개 메소드들

메소드 설명
Add ( Assembly assembly ) : void
Add ( NamespaceMapping mapping ) : void

Add a namespace mapping for embedded resources.

EmbeddedFileProvider ( ) : System
EmbeddedFileProvider ( string siteRoot ) : System

Initializes a new instance of the EmbeddedFileProvider class.

FileExists ( string virtualPath ) : bool

Checks if a file exits

GetCacheDependency ( string virtualPath, IEnumerable dependencies, System.DateTime utcStart ) : System.Web.Caching.CacheDependency

Creates a cache dependency based on the specified virtual paths

GetCacheKey ( string virtualPath ) : string

GetFile ( string virtualPath ) : System.Web.Hosting.VirtualFile

Get the view

GetFileHash ( string virtualPath, IEnumerable dependencies ) : string

Get file hash.

보호된 메소드들

메소드 설명
IsFileAllowed ( string resourceName ) : bool

Determines if the found embedded file might be mapped and provided.

Default implementation uses AllowedFileExtensions to determine which files to servce.

LoadStream ( string virtualPath, MappedResource resource ) : Stream

Resource to load

The default implementation uses resource.Assembly.GetManifestResourceStream(resource.FullResourceName)

Map ( NamespaceMapping mapping ) : void

Create mappings for all resources in a specific namespace (and all sub namespaces).

비공개 메소드들

메소드 설명
GetResource ( string uri ) : MappedResource

Get resource name by scanning all mapped namespaces.

메소드 상세

Add() 공개 메소드

public Add ( Assembly assembly ) : void
assembly System.Reflection.Assembly
리턴 void

Add() 공개 메소드

Add a namespace mapping for embedded resources.
public Add ( NamespaceMapping mapping ) : void
mapping NamespaceMapping Mapping to add
리턴 void

EmbeddedFileProvider() 공개 메소드

public EmbeddedFileProvider ( ) : System
리턴 System

EmbeddedFileProvider() 공개 메소드

Initializes a new instance of the EmbeddedFileProvider class.
public EmbeddedFileProvider ( string siteRoot ) : System
siteRoot string Root directory of the web site
리턴 System

FileExists() 공개 메소드

Checks if a file exits
public FileExists ( string virtualPath ) : bool
virtualPath string Virtual path like "~/Views/Home/Index.cshtml"
리턴 bool

GetCacheDependency() 공개 메소드

Creates a cache dependency based on the specified virtual paths
public GetCacheDependency ( string virtualPath, IEnumerable dependencies, System.DateTime utcStart ) : System.Web.Caching.CacheDependency
virtualPath string Virtual path like "~/Views/Home/Index.cshtml"
dependencies IEnumerable The dependencies.
utcStart System.DateTime The UTC start.
리턴 System.Web.Caching.CacheDependency

GetCacheKey() 공개 메소드

public GetCacheKey ( string virtualPath ) : string
virtualPath string Virtual path like "~/Views/Home/Index.cshtml"
리턴 string

GetFile() 공개 메소드

Get the view
public GetFile ( string virtualPath ) : System.Web.Hosting.VirtualFile
virtualPath string Virtual path like "~/Views/Home/Index.cshtml"
리턴 System.Web.Hosting.VirtualFile

GetFileHash() 공개 메소드

Get file hash.
public GetFileHash ( string virtualPath, IEnumerable dependencies ) : string
virtualPath string Virtual path like "~/Views/Home/Index.cshtml"
dependencies IEnumerable The dependencies.
리턴 string

IsFileAllowed() 보호된 메소드

Determines if the found embedded file might be mapped and provided.
Default implementation uses AllowedFileExtensions to determine which files to servce.
protected IsFileAllowed ( string resourceName ) : bool
resourceName string
리턴 bool

LoadStream() 보호된 메소드

Resource to load
The default implementation uses resource.Assembly.GetManifestResourceStream(resource.FullResourceName)
protected LoadStream ( string virtualPath, MappedResource resource ) : Stream
virtualPath string Requested virtual path
resource MappedResource Identified resource (i.e. the one to load)
리턴 Stream

Map() 보호된 메소드

Create mappings for all resources in a specific namespace (and all sub namespaces).
protected Map ( NamespaceMapping mapping ) : void
mapping NamespaceMapping Mapping to load embedded resources in
리턴 void