public static void Send(RundownItem item) { if (string.IsNullOrEmpty(item.StaticItem.Clipname)) return; UdpClient client = new UdpClient(); client.Connect(IPAddress.Parse(Settings.Default.SpyderIp), Settings.Default.SpyderPort); string command = Settings.Default.SpyderSettings .Cast<string>() .First(x => Regex.IsMatch(x, String.Format("{0}.*", item.StaticItem.Clipname))) .Split('#')[1]; byte[] packet = Encoding.ASCII.GetBytes(string.Format("spyder\0\0\0\0RSC {0} 1", item.ControlValue)); client.Send(packet, packet.Length); client.Close(); }
private bool SetSelectedChannel(RundownItem item) { if (item.IsControl) return false; if (string.IsNullOrEmpty(item.Channel)) { if (cbChannels_.Items.Count > 0) { cbChannels_.SelectedIndex = 0; return true; } } else { if (cbChannels_.Items.Contains(item.Channel)) cbChannels_.SelectedIndex = cbChannels_.Items.IndexOf(item.Channel); else { cbChannels_.Items.Add(item.Channel); cbChannels_.SelectedIndex = cbChannels_.Items.Count - 1; } } return false; }