Ejemplo n.º 1
0
 ModuleContainer BuildModuleContainer(ModuleContainerBuilder builder, ModuleCollection modules, string topLevelDirectoryNameConvention)
 {
     if (modules.Count == 0)
     {
         // By convention, each subdirectory of topLevelDirectoryNameConvention is a module.
         builder.AddModuleForEachSubdirectoryOf(topLevelDirectoryNameConvention, "");
     }
     else
     {
         AddModulesFromConfig(modules, builder);
     }
     return(builder.Build());
 }
Ejemplo n.º 2
0
 void AddModulesFromConfig(ModuleCollection moduleElements, ModuleContainerBuilder builder)
 {
     foreach (ModuleElement module in moduleElements)
     {
         // "foo/*" implies each sub-directory of "~/foo" is a module.
         if (module.Path.EndsWith("*"))
         {
             var path = module.Path.Substring(0, module.Path.Length - 2);
             builder.AddModuleForEachSubdirectoryOf(path, module.Location);
         }
         else // the given path is the module itself.
         {
             builder.AddModule(module.Path, module.Location);
         }
     }
 }
Ejemplo n.º 3
0
 void AddModulesFromConfig(ModuleCollection moduleElements, ModuleContainerBuilder builder)
 {
     foreach (ModuleElement module in moduleElements)
     {
         // "foo/*" implies each sub-directory of "~/foo" is a module.
         if (module.Path.EndsWith("*"))
         {
             var path = module.Path.Substring(0, module.Path.Length - 2);
             builder.AddModuleForEachSubdirectoryOf(path, module.Location);
         }
         else // the given path is the module itself.
         {
             builder.AddModule(module.Path, module.Location);
         }
     }
 }
Ejemplo n.º 4
0
 ModuleContainer BuildModuleContainer(ModuleContainerBuilder builder, ModuleCollection modules, string topLevelDirectoryNameConvention)
 {
     if (modules.Count == 0)
     {
         // By convention, each subdirectory of topLevelDirectoryNameConvention is a module.
         builder.AddModuleForEachSubdirectoryOf(topLevelDirectoryNameConvention, "");
     }
     else
     {
         AddModulesFromConfig(modules, builder);
     }
     return builder.Build();
 }