public override void OnSectionActivated() { Log.Info("TV3BlasterPlugin: Configuration activated"); TV3BlasterPlugin.InConfiguration = true; TvBusinessLayer layer = new TvBusinessLayer(); TV3BlasterPlugin.ServerHost = layer.GetSetting("TV3BlasterPlugin_ServerHost", "localhost").Value; IPAddress serverIP = Network.GetIPFromName(TV3BlasterPlugin.ServerHost); IPEndPoint endPoint = new IPEndPoint(serverIP, Server.DefaultPort); if (!TV3BlasterPlugin.StartClient(endPoint)) { MessageBox.Show(this, "Failed to start local comms. IR functions temporarily disabled.", "TV3 Blaster Plugin - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } TV3BlasterPlugin.LoadExternalConfigs(); RefreshIRList(); RefreshMacroList(); TV3BlasterPlugin.HandleMessage += ReceivedMessage; base.OnSectionActivated(); }
private void buttonHostSetup_Click(object sender, EventArgs e) { TV3BlasterPlugin.StopClient(); ServerAddress serverAddress = new ServerAddress(TV3BlasterPlugin.ServerHost); serverAddress.ShowDialog(this); TV3BlasterPlugin.ServerHost = serverAddress.ServerHost; IPAddress serverIP = Network.GetIPFromName(TV3BlasterPlugin.ServerHost); IPEndPoint endPoint = new IPEndPoint(serverIP, Server.DefaultPort); TV3BlasterPlugin.StartClient(endPoint); }