public RocketModuleDescriptor( [NotNull] Type type, [NotNull] IRocketModule instance, bool isLoadedAsPlugIn) { Check.NotNull(type, nameof(type)); Check.NotNull(instance, nameof(instance)); if (!type.GetTypeInfo().IsAssignableFrom(instance.GetType())) { throw new ArgumentException($"Given module instance ({instance.GetType().AssemblyQualifiedName}) is not an instance of given module type: {type.AssemblyQualifiedName}"); } Type = type; Assembly = type.Assembly; Instance = instance; IsLoadedAsPlugIn = isLoadedAsPlugIn; _dependencies = new List <IRocketModuleDescriptor> (); }
public virtual void Shutdown(ApplicationShutdownContext context, IRocketModule module) { }
public virtual void Initialize(ApplicationInitializationContext context, IRocketModule module) { }
public override void Shutdown(ApplicationShutdownContext context, IRocketModule module) { (module as IOnApplicationShutdown)?.OnApplicationShutdown(context); }
public override void Initialize(ApplicationInitializationContext context, IRocketModule module) { (module as IOnPostApplicationInitialization)?.OnPostApplicationInitialization(context); }
public void AddModule(IRocketModule module) { _rocketModules.Add(module); }