public CameraCommandEditWrapper(CameraCommand cmd, List <string> camList, List <string> presetList) { CommandList = new List <Cmd> { Cmd.OUTPUT, Cmd.PRESET, Cmd.WAIT }; this.Command = cmd.Command; this.WaitTime = cmd.WaitTime; this.SelectedOutputCamera = cmd.SelectedOutputCamera; this.SelectedPreset = cmd.SelectedPreset; this.CamList = camList; this.PresetList = presetList; }
public void saveProgram(ObservableCollection <CameraCommandEditWrapper> list) { if (ProgramName == "") { MessageBox.Show("Invalid Program Name!"); return; } if (list.Count <= 0) { MessageBox.Show("Invalid Program!"); return; } else { foreach (CameraCommandEditWrapper item in list) { if (item.Parameter == null) { MessageBox.Show("Invalid Parameter!"); return; } } foreach (ProgramInfo item in programList) { if (item.ProgramName == ProgramName && programList.IndexOf(item) != Index) { MessageBox.Show("Duplicate Program Name!"); return; } } } if (Index >= programList.Count) { List <CameraCommand> newCmdList = new List <CameraCommand>(); ProgramInfo newProgramInfo = new ProgramInfo() { ProgramName = ProgramName, commandList = newCmdList }; programList.Add(newProgramInfo); } ProgramInfo plist = programList[Index]; plist.commandList.Clear(); foreach (CameraCommandEditWrapper item in list) { CameraCommand newItem = new CameraCommand(item); plist.commandList.Add(newItem); } plist.ProgramName = ProgramName; _ea.GetEvent <ProgramSaveEvent>().Publish(Index); }