Exemplo n.º 1
0
        public bool ExcecuteAction(SystemInteraction action)
        {
            switch (action)
            {
            case SystemInteraction.Shutdown:
                _appLifetime.StopApplication();
                return(false);

            case SystemInteraction.DisconnectMqtt:
                _connectionProvider.DisconnectClient();
                return(true);

            case SystemInteraction.ConnectMqtt:
                _connectionProvider.ReconnectClient();
                return(true);

            case SystemInteraction.ReloadCustomCommands:
                _customCommandConfigurationService.ReloadConfiguration();
                return(true);

            case SystemInteraction.ReloadUiConfiguration:
                return(false);

            default:
                throw new InvalidOperationException();
            }
        }