src/Foundation/Net/Gimela.Net.Http/Resources/EmbeddedResourceLoader.cs
/// <summary>
/// Add resources in a specific path (will not work with sub folders)
/// </summary>
/// <param name="path">Path (Uri) requested by clients</param>
/// <param name="assembly">Assembly that the resources exist in</param>
/// <param name="rootNameSpace">Name space to root folder under which all name spaces exists in,</param>
/// <returns><c>true</c> if any files was found; otherwise <c>false</c>.</returns>
/// <remarks>
/// <para>
/// Adds all views in the specified folder. Sub folders are not supported since it's hard to determine
/// with parts are the path and witch parts are the filename. Use <see cref="AddPath"/> to get support
/// for sub folders.
/// </para>
/// </remarks>
/// <example>
/// <code>
/// Add("/user/", typeof(MyController).Assembly, "YourProject.Users.Views");
/// </code>
/// </example>
Add resources in a specific path (will not work with sub folders)
Add resources in a specific path ( will not work with sub folders )
public bool AddFilesInFolder(string path, Assembly assembly, string rootNameSpace)
    {
      rootNameSpace = rootNameSpace.ToLower();
      bool foundFiles = false;
      foreach (string resourceName in assembly.GetManifestResourceNames())
      {
        if (!resourceName.ToLower().StartsWith(rootNameSpace))
          continue;
        string fileName = resourceName.Remove(0, rootNameSpace.Length + 1); 
        if (AddFile(path + fileName, assembly, resourceName))
          foundFiles = true;
      }
      return foundFiles;
    }
public bool AddFilesInFolder ( string path , Assembly assembly , string rootNameSpace ) { rootNameSpace = rootNameSpace . ToLower ( ) ; bool foundFiles = false ; foreach ( string resourceName in assembly . GetManifestResourceNames ( ) ) { if ( ! resourceName . ToLower ( ) . StartsWith ( rootNameSpace ) ) continue ; string fileName = resourceName . Remove ( 0 , rootNameSpace . Length + 1 ) ; if ( AddFile ( path + fileName , assembly , resourceName ) ) foundFiles = true ; } return foundFiles ; }
Add resources in a specific path (will not work with sub folders)
Add resources in a specific path ( will not work with sub folders )
//include last dot
None
path
string
Path (Uri) requested by clients
Path ( Uri ) requested by clients
assembly
Assembly
Assembly that the resources exist in
Assembly that the resources exist in
rootNameSpace
string
Name space to root folder under which all name spaces exists in.
Name space to root folder under which all name spaces exists in .
remarks
Adds all views in the specified folder. Sub folders are not supported since it's hard to determine
with parts are the path and witch parts are the filename. Use  to get support
for sub folders.
Adds all views in the specified folder . Sub folders are not supported since it ' s hard to determine with parts are the path and witch parts are the filename . Use to get support for sub folders .
example
Add("/user/", typeof(MyController).Assembly, "YourProject.Users.Views").
Add ( " / user / " typeof ( MyController ) . Assembly " YourProject . Users . Views " ) .