Esempio n. 1
0
        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> ();
        }
Esempio n. 2
0
 public virtual void Shutdown(ApplicationShutdownContext context, IRocketModule module)
 {
 }
Esempio n. 3
0
 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);
 }
Esempio n. 6
0
 public void AddModule(IRocketModule module)
 {
     _rocketModules.Add(module);
 }