private void buttonChangeServer_Click(object sender, EventArgs e) { TV2BlasterPlugin.StopClient(); ServerAddress serverAddress = new ServerAddress(TV2BlasterPlugin.ServerHost); serverAddress.ShowDialog(this); TV2BlasterPlugin.ServerHost = serverAddress.ServerHost; IPAddress serverIP = Client.GetIPFromName(TV2BlasterPlugin.ServerHost); IPEndPoint endPoint = new IPEndPoint(serverIP, Server.DefaultPort); TV2BlasterPlugin.StartClient(endPoint); }
private void SetupForm_Load(object sender, EventArgs e) { if (String.IsNullOrEmpty(TV2BlasterPlugin.ServerHost)) { ServerAddress serverAddress = new ServerAddress(); serverAddress.ShowDialog(this); TV2BlasterPlugin.ServerHost = serverAddress.ServerHost; } IPAddress serverIP = Client.GetIPFromName(TV2BlasterPlugin.ServerHost); IPEndPoint endPoint = new IPEndPoint(serverIP, Server.DefaultPort); if (!TV2BlasterPlugin.StartClient(endPoint)) { MessageBox.Show(this, "Failed to start local comms. IR functions temporarily disabled.", "TV2 Blaster Plugin - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } RefreshIRList(); RefreshMacroList(); TV2BlasterPlugin.HandleMessage += ReceivedMessage; }