C# Class MvcContrib.PortableAreas.AssemblyResourceLocator

Lookup to find an embedded resource from an assembly. This class abstract the fact that embedded resource in C# project and those in VB project are not embedded the same way. VB compiler does not prefix embedded resource name with the path of the original file.
显示文件 Open project: atomicobject/mvccontrib Class Usage Examples

Public Methods

Method Description
AssemblyResourceLocator ( string>.Dictionary resources, string namespaceName, string virtualPath ) : System
GetFullyQualifiedTypeFromPath ( string path ) : string

Returns the fully qualified path for an embedded resource from the virtual path recveived The path returned by this method is invalid if the virtual path point towards a VB PortableArea. Unless everything in this VB assembly is at the root.

IsPathResourceStream ( string path ) : bool

Returns true if a virtual path points towards an existing embedded resource. This method looks first for a standard embedded resource (C#) and second for an embedded resource with the same name, but anywhere in the subnamespace structure (VB).

TryGetActualResourceName ( string path, string &resourceName ) : bool

From the virtual path received, look for the associated embedded resource and returns if exists. This method supports both C# and VB embedded resource.

This method looks first for a standard embedded resource (C#) and second for an embedded resource with the same name, but anywhere in the subnamespace structure (VB).

Private Methods

Method Description
GetFileNameOnly ( string fullPath ) : string
GetPartiallyQualifiedTypeFromPath ( string path, int rootLevel, bool &keepGoing ) : string
JoinNamespaces ( ) : Func
JoinNamespaces ( string x, string y ) : string
RemoveIntermediatePathFrom ( string fullPath, int rootLevel, bool &keepGoing ) : string
ResourcesContainsFullyQualifiedType ( string path ) : bool
ResourcesContainsPartiallyQualifiedType ( string path ) : bool
ResourcesContainsType ( string typeString ) : bool
TryGetPartialResourceName ( string path, string &resourceName ) : bool

Method Details

AssemblyResourceLocator() public method

public AssemblyResourceLocator ( string>.Dictionary resources, string namespaceName, string virtualPath ) : System
resources string>.Dictionary
namespaceName string
virtualPath string
return System

GetFullyQualifiedTypeFromPath() public method

Returns the fully qualified path for an embedded resource from the virtual path recveived The path returned by this method is invalid if the virtual path point towards a VB PortableArea. Unless everything in this VB assembly is at the root.
public GetFullyQualifiedTypeFromPath ( string path ) : string
path string
return string

IsPathResourceStream() public method

Returns true if a virtual path points towards an existing embedded resource. This method looks first for a standard embedded resource (C#) and second for an embedded resource with the same name, but anywhere in the subnamespace structure (VB).
public IsPathResourceStream ( string path ) : bool
path string
return bool

TryGetActualResourceName() public method

From the virtual path received, look for the associated embedded resource and returns if exists. This method supports both C# and VB embedded resource.
This method looks first for a standard embedded resource (C#) and second for an embedded resource with the same name, but anywhere in the subnamespace structure (VB).
public TryGetActualResourceName ( string path, string &resourceName ) : bool
path string /// The virtual path of a resource ///
resourceName string /// Returns the real embedded resource name associated to the virtual resource path. ///
return bool