/// <summary>Handles the event that is thrown when the reader class indicates that the output device has changed</summary> private void _reader_OutputDeviceChanged(object sender, ReaderDeviceChangedEventArgs e) { if (InvokeRequired) { Invoke(new ReaderDeviceChangedEventHandler(_reader_OutputDeviceChanged), sender, e); return; } var outputSourceLong = string.Empty; switch (e.CurrentDevice.ReaderDeviceType) { case ReaderDeviceType.Network: outputSourceLong = string.Format("NET@{0}:{1}", e.CurrentDevice.Hostname, e.CurrentDevice.Port); break; case ReaderDeviceType.Textfile: outputSourceLong = e.CurrentDevice.FilePath; break; case ReaderDeviceType.Database: outputSourceLong = string.Format("{1}@{0}", e.CurrentDevice.Hostname, e.CurrentDevice.DatabaseType); break; case ReaderDeviceType.None: outputSourceLong = "None"; break; case ReaderDeviceType.Plugin: outputSourceLong = "Plugin: " + e.CurrentDevice.DeviceName; break; } txtInfo.Text += "OUTPUT via " + outputSourceLong + Environment.NewLine; }
/// <summary>Handles the event that is thrown when the reader class indicates that the input device has changed</summary> private void _reader_InputDeviceChanged(object sender, ReaderDeviceChangedEventArgs e) { if (InvokeRequired) { Invoke(new ReaderDeviceChangedEventHandler(_reader_InputDeviceChanged), sender, e); return; } var inputSource = string.Empty; switch (e.CurrentDevice.ReaderDeviceType) { case ReaderDeviceType.SiDevice: inputSource = DeviceInfo.GetPrettyDeviceName(e.CurrentDevice); break; case ReaderDeviceType.SiLiveSoapService: inputSource = "SPORTident Live SOAP Service"; break; default: inputSource = e.CurrentDevice.ReaderDeviceType.ToString(); break; } txtInfo.Text += "INPUT via " + inputSource + Environment.NewLine; }