示例#1
0
            /// <summary>
            /// Creates the module instance to be associated with this <see cref="AssemblyModuleContext"/>.
            /// </summary>
            /// <returns>The created module object instance.</returns>
            protected override Module CreateModule()
            {
                Assembly assembly = Context.LoadFromAssemblyName(assemblyName);

                AssemblyModuleAttribute attribute = assembly.GetCustomAttribute <AssemblyModuleAttribute>();

                if (attribute == null)
                {
                    throw Error.AttributeNotDefined(typeof(AssemblyModuleAttribute), assembly);
                }

                return(ModuleFactory.CreateModule(attribute.ModuleType));
            }
示例#2
0
 /// <summary>
 /// Creates the module instance to be associated with this <see cref="LocalModuleContext"/>.
 /// </summary>
 /// <returns>The created module object instance.</returns>
 protected override Module CreateModule()
 {
     return(ModuleFactory.CreateModule(type));
 }