Example #1
0
        public void AttachModule <TModule>(TModule module)
            where TModule : ISImplModule
        {
            var configuredModule = GetConfiguredModule <TModule>(module.GetType());

            if (configuredModule is null)
            {
                var moduleContext = new ModuleRuntimeInfo(module);
                moduleContext.SetState(ModuleState.Attached);

                _modulesInfos.Add(moduleContext);
            }
            else
            {
                throw new InvalidConfigurationException($"A module with the type {nameof(TModule)} has already been attached to the stack.");
            }
        }