private static Type GetModuleMetadataType(INancyModule module) { var metadataName = module.GetType().Name.Replace("Module", "Metadata"); Type type; if (ModuleTypes.TryGetValue(metadataName, out type)) { return(type); } type = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(x => x.GetTypes()) .FirstOrDefault(x => x.Name == metadataName); ModuleTypes.Add(metadataName, type); return(typeof(ModuleMetadata).IsAssignableFrom(type) ? type : null); }
public override void InitializeModulePool() { ModuleTypes.Add(typeof(TheButtonModule)); ModuleTypes.Add(typeof(SimonSaysModule)); }