private void CbxDeviceType_SelectionChanged(object sender, SelectionChangedEventArgs e) { DmxDevice tempDevice = AvailableDevices[cbxDeviceType.SelectedIndex]; Tuple <string, string, int, int> properties = Tuple.Create(tempDevice.Name, tempDevice.DeviceType.ToString(), tempDevice.StartAddress, tempDevice.Channels.Count()); gbxProperties.DataContext = properties; imgDevice.DataContext = Tuple.Create("/DMX;component/Resources/Images/" + tempDevice.DeviceType.ToString() + ".png"); }
private void RemoveSelectedDevice_Click(object sender, RoutedEventArgs e) { if (tctDeviceTabs.SelectedIndex >= 0 && tctDeviceTabs.SelectedItem != null) { DmxDevice tempDmxDevice = _dmxDevices[tctDeviceTabs.SelectedIndex]; MessageBoxResult result = MessageBox.Show("Are you sure you want to remove " + tempDmxDevice.Name + "?\nThis can't be undone.", "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Stop, MessageBoxResult.No); if (result == MessageBoxResult.Yes) { _availableDevices.Add(tempDmxDevice); logger.Log("DmxDevice removed: " + tempDmxDevice.Name + " @ " + _dmxDevices[tctDeviceTabs.SelectedIndex].StartAddress); _dmxDevices.Remove(tempDmxDevice); tctDeviceTabs.Items.Remove(tctDeviceTabs.SelectedItem); } } }
public LaserMovinghead(DmxDevice dmxDevice) : base(dmxDevice.Name, dmxDevice.StartAddress, dmxDevice.DeviceType, dmxDevice.Channels.Length) { }
public NewDmxDeviceEventArgs(DmxDevice dmxDevice) { DmxDevice = dmxDevice; }