private void MainForm_Shown(object sender, EventArgs e) { Text = String.Format("{0} Dev. ver: {1}", Text, GetRunningVersion()); ThreadPool.QueueUserWorkItem(f => ConnectSteam()); ThreadPool.QueueUserWorkItem( f => ConnectSaitek()); ThreadPool.QueueUserWorkItem( f => ConnectWarThunder()); ThreadPool.QueueUserWorkItem( f => ConnectNetworkServer()); LoadSettings(); _deviceManager = new DeviceManager(); _deviceManager.OnJoystickList += new EventHandler<EventArgs>(deviceManager_OnJoystickList); _deviceManager.OnKeyboardList += new EventHandler<EventArgs>(deviceManager_OnKeyboardList); _deviceManager.OnMouseList += new EventHandler<EventArgs>(deviceManager_OnMouseList); //var task = new Task(new System.Action( () => TestRuby()), tokenSource.Token,TaskCreationOptions.LongRunning); //task.Start(); //tokenSource.Cancel(); }
void settingsForm_OnReset(object sender, EventArgs e) { _settings.Reset(); _settings.Save(); _settings = Properties.Settings.Default; _settings.CurrentProfile = null; _profileManager = null; _currentProfile = null; LoadSettings(); _deviceManager = new DeviceManager(); }