static void Connect() { try { if (!XBox.Connected || !XBox.Ping()) { _xbox.Connect(); UpdateConnectionInfo(); } } catch (Exception e) { MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } finally { WaitDialog.Hide(); } LaunchHalo2(); }
static void Reconnect() { string ip = XBox.DebugIP.ToString(); Thread.Sleep(0); try { do { XBox.ConnectToIP(ip); } while (!XBox.Connected && WaitDialog.Visible); UpdateConnectionInfo(); } catch (Exception e) { if (WaitDialog.Visible) { MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } finally { WaitDialog.Hide(); } LaunchHalo2(); }
static void AsyncReconnect(string message) { WaitDialog.Show(message); new Thread(new ThreadStart(Reconnect)).Start(); }
public static void FindXBox() { WaitDialog.Show("Finding XBox..."); new Thread(new ThreadStart(Connect)).Start(); }
public static void FindXBox(string xbox) { WaitDialog.Show("Finding XBox..."); new Thread(new ParameterizedThreadStart(Connect)).Start(xbox); }