private static void CheckDrivers()
        {
            if (!DriversManager.AreBuiltInDriversInstalled)
            {
                LogWriter.Write("Built-in drivers are not installed, asking user to install them");
                var result = Controls.MessageBox.Show(
                    "It seems that the required built-in drivers are not installed.\r\n" +
                    "Do you want to install them (may require reboot)?\r\n\r\n" +
                    "Selecting \"No\" will quit the application.",
                    ApplicationInfo.AppName + " | Drivers required",
                    MessageBoxButton.YesNo,
                    MessageBoxImage.Question);

                if (result == MessageBoxResult.Yes)
                {
                    DriversManager.InstallBuiltInDrivers();
                }
                else
                {
                    LogWriter.Write(
                        "User has choosen to NOT install the built-in drivers. Exitting");

                    Environment.Exit(0);
                }
            }
        }
Esempio n. 2
0
        public async Task RunBotAsync()
        {
            DriversManager.Init();

            var _config = new DiscordSocketConfig {
                MessageCacheSize = 100
            };

            _client   = new DiscordSocketClient(_config);
            _commands = new CommandService();
            _services = new ServiceCollection()
                        .AddSingleton(_client)
                        .AddSingleton(_commands)
                        .BuildServiceProvider();

            var token = "";

            _client.Log   += _client_Log;
            _client.Ready += OnReady;

            await RegisterCommandsAsync();

            await _client.LoginAsync(TokenType.Bot, token);

            await _client.StartAsync();

            Connection();


            await Task.Delay(-1);
        }
        private void UninstallBuiltInDrivers_Click(object sender, RoutedEventArgs e)
        {
            var result = Controls.MessageBox.Show(
                "Are you sure that you want to remove the built-in drivers?",
                "Confirm uninstall",
                MessageBoxButton.YesNoCancel,
                MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                DriversManager.UninstallBuiltInDrivers();
            }
        }
 public DriversController(UserManager <User> userManager, DriversManager driversManager) : base(userManager)
 {
     _driversManager = driversManager;
 }