C# Class Nancy.EmbeddedContent.EmbeddedViewLocationProvider

Contains the functionality for locating a view that has been embedded into an assembly resource.
Inheritance: IViewLocationProvider
Show file Open project: jugglingnutcase/Nancy.EmbeddedContent Class Usage Examples

Public Properties

Property Type Description
Ignore IList
RootNamespaces string>.IDictionary

Public Methods

Method Description
EmbeddedViewLocationProvider ( IResourceReader resourceReader, IResourceAssemblyProvider resourceAssemblyProvider ) : Nancy.ViewEngines

Initializes a new instance of the EmbeddedViewLocationProvider class.

GetLocatedViews ( IEnumerable supportedViewExtensions ) : IEnumerable

Returns an ViewLocationResult instance for all the views that could be located by the provider.

If no views could be located, this method should return an empty enumerable, never .

GetLocatedViews ( IEnumerable supportedViewExtensions, string location, string viewName ) : IEnumerable

Returns an ViewLocationResult instance for all the views matching the viewName that could be located by the provider.

If no views could be located, this method should return an empty enumerable, never .

Private Methods

Method Description
CreateSegment ( IEnumerable current, IEnumerable previous ) : IEnumerable
GetExtension ( string resourceName ) : string
GetFileName ( string resourceName ) : string
GetLocation ( ResourceViewInfo resource, string rootNamespace ) : string
GetRootNamespace ( IEnumerable resourceStreams ) : string
GetViewLocations ( Assembly assembly, IEnumerable supportedViewExtensions ) : IEnumerable
IsMatch ( string location, string viewName, Nancy.ViewEngines.ViewLocationResult result ) : bool

Method Details

EmbeddedViewLocationProvider() public method

Initializes a new instance of the EmbeddedViewLocationProvider class.
public EmbeddedViewLocationProvider ( IResourceReader resourceReader, IResourceAssemblyProvider resourceAssemblyProvider ) : Nancy.ViewEngines
resourceReader IResourceReader An instance that should be used when extracting embedded views.
resourceAssemblyProvider IResourceAssemblyProvider An instance that should be used to determine which assemblies to scan for embedded views.
return Nancy.ViewEngines

GetLocatedViews() public method

Returns an ViewLocationResult instance for all the views that could be located by the provider.
If no views could be located, this method should return an empty enumerable, never .
public GetLocatedViews ( IEnumerable supportedViewExtensions ) : IEnumerable
supportedViewExtensions IEnumerable An instance, containing the view engine file extensions that is supported by the running instance of Nancy.
return IEnumerable

GetLocatedViews() public method

Returns an ViewLocationResult instance for all the views matching the viewName that could be located by the provider.
If no views could be located, this method should return an empty enumerable, never .
public GetLocatedViews ( IEnumerable supportedViewExtensions, string location, string viewName ) : IEnumerable
supportedViewExtensions IEnumerable An instance, containing the view engine file extensions that is supported by the running instance of Nancy.
location string The location of the view to try and find
viewName string The name of the view to try and find
return IEnumerable

Property Details

Ignore public static property

A list of assemblies to ignore when scanning for embedded views.
public static IList Ignore
return IList

RootNamespaces public static property

User-configured root namespaces for assemblies.
public static IDictionary RootNamespaces
return string>.IDictionary