public ServerModuleModel[] GetAll()
        {
            var models = new List <ServerModuleModel>(ModuleManager.AllModules.Count());

            foreach (var module in ModuleManager.AllModules)
            {
                var notifications = module.Notifications.ToArray();

                var model = new ServerModuleModel
                {
                    Name             = module.Name,
                    Assembly         = ConvertAssembly(module),
                    HealthState      = module.State,
                    StartBehaviour   = ModuleManager.BehaviourAccess <ModuleStartBehaviour>(module).Behaviour,
                    FailureBehaviour = ModuleManager.BehaviourAccess <FailureBehaviour>(module).Behaviour,
                    Notifications    = notifications.Select(n => new NotificationModel(n)).ToArray()
                };

                var dependencies = ModuleManager.StartDependencies(module);
                foreach (var dependency in dependencies)
                {
                    model.Dependencies.Add(new ServerModuleModel
                    {
                        Name        = dependency.Name,
                        HealthState = dependency.State
                    });
                }
                models.Add(model);
            }
            return(models.ToArray());
        }
        public void Update(string moduleName, ServerModuleModel module)
        {
            var serverModule = GetModuleFromManager(moduleName);

            var startBehaviour = ModuleManager.BehaviourAccess <ModuleStartBehaviour>(serverModule);

            if (startBehaviour.Behaviour != module.StartBehaviour)
            {
                Logger.Log(LogLevel.Info, "Changing start behaviour of {0} to {1}", moduleName, module.StartBehaviour);
                startBehaviour.Behaviour = module.StartBehaviour;
            }

            var failureBehaviour = ModuleManager.BehaviourAccess <FailureBehaviour>(serverModule);

            if (failureBehaviour.Behaviour != module.FailureBehaviour)
            {
                Logger.Log(LogLevel.Info, "Changing failure behaviour of {0} to {1}", moduleName, module.FailureBehaviour);
                failureBehaviour.Behaviour = module.FailureBehaviour;
            }
        }