public static ModuleInfoGroup AddModule(
     this ModuleInfoGroup moduleInfoGroup,
     Type moduleType,
     params string[] dependsOn)
 {
     if (moduleType == null)
     {
         throw new ArgumentNullException("moduleType");
     }
     return(AddModule(moduleInfoGroup, moduleType.Name, moduleType, dependsOn));
 }
Example #2
0
        public virtual ModuleCatalog AddGroup(InitializationMode initializationMode, string refValue, params ModuleInfo[] moduleInfos)
        {
            if (moduleInfos == null)
            {
                throw new System.ArgumentNullException("moduleInfos");
            }
            ModuleInfoGroup newGroup = new ModuleInfoGroup();

            newGroup.InitializationMode = initializationMode;
            newGroup.Ref = refValue;
            foreach (ModuleInfo info in moduleInfos)
            {
                newGroup.Add(info);
            }
            this.items.Add(newGroup);
            return(this);
        }
        public static ModuleInfoGroup AddModule(
            this ModuleInfoGroup moduleInfoGroup,
            string moduleName,
            Type moduleType,
            params string[] dependsOn)
        {
            if (moduleType == null)
            {
                throw new ArgumentNullException("moduleType");
            }
            if (moduleInfoGroup == null)
            {
                throw new ArgumentNullException("moduleInfoGroup");
            }
            ModuleInfo moduleInfo = new ModuleInfo(moduleName, moduleType.AssemblyQualifiedName);

            moduleInfo.DependsOn.AddRange(dependsOn);
            moduleInfoGroup.Add(moduleInfo);
            return(moduleInfoGroup);
        }