private void switchStatusChanged(int index, int ooff) { SwitchStatus ss = AllSwitchStatus.FirstOrDefault(s => s.Index == index); if (ss != null) { ss.IsSwitchOn = ooff == 0 ? false : true; } }
public void UpdateSwitchInfo() { if (!string.IsNullOrWhiteSpace(VideoId)) { var control = CCTVInfoManager.Instance.GetControlConfig(VideoId); if (control != null && control.AuxSwitch != null) { SwitchInfo[] infos = control.AuxSwitch; AllSwitchStatus.Clear(); for (int i = 0; i < infos.Length; i++) { AllSwitchStatus.Add(new SwitchStatus() { Name = infos[i].Name, Index = infos[i].Index, IsEnable = true, IsSwitchOn = false }); } OnSwitchesUpdated(); } } }