Ejemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // start torrent engine
            TorrentEngine.init();

            // check if first-run
            if (!Settings.Default.SettingsShown) {

                // run setup for requirements
                runSetup();

                SettingsWindow settings = new SettingsWindow();
                settings.ShowDialog();
                Settings.Default.SettingsShown = true;
            }

            // create directories (if not exists)
            Directory.CreateDirectory(Settings.Default.Directory);
            Directory.CreateDirectory(Settings.Default.downloadPath);
            Directory.CreateDirectory(Settings.Default.installPath);
            Directory.CreateDirectory(Settings.Default.torrentPath);
            Directory.CreateDirectory(Path.Combine(Settings.Default.Directory,"icons"));

            // start asynchrone thread to load initial gamelist
            Thread loadGamelistThread = new Thread(new ThreadStart(loadGamelist_t));
            loadGamelistThread.Start();

            // thread to update the total speed
            Thread updateNetwork = new Thread(updateNetwork_t);
            updateNetwork.IsBackground = true;
            updateNetwork.Start();

            // start thread that updates the gamelist every 5 minutes
            Thread statusThread = new Thread(new ThreadStart(updateGamelist_t));
            statusThread.Start();
        }
Ejemplo n.º 2
0
        private void btnSettings_Click(object sender, RoutedEventArgs e)
        {
            SettingsWindow settings = new SettingsWindow();
            settings.ShowDialog();

            // start asynchrone thread to load initial gamelist

            Thread loadGamelistThread = new Thread(new ThreadStart(loadGamelist_t));
            loadGamelistThread.Start();
        }