public void RefreshChannelList() { List <ChannelListItemViewModel> ChannelListTemp = new List <ChannelListItemViewModel>(); GlobalCache.ChannelList = THRIFTSERVICES.Services.ThriftServiceBasic.SelectChannelList(); foreach (MyChannelCfg mcc in GlobalCache.ChannelList) { if (GlobalCache.AppType == 1) { if (mcc.Name.Contains(GlobalCache.AppLocation)) { ChannelListItemViewModel channel = new ChannelListItemViewModel(); channel.MyChannelCfg = mcc; channel.IsOpened = false; ChannelListTemp.Add(channel); } } else { ChannelListItemViewModel channel = new ChannelListItemViewModel(); channel.MyChannelCfg = mcc; channel.IsOpened = false; ChannelListTemp.Add(channel); } } foreach (ChannelListItemViewModel cLI in ChannelList) { if (cLI.IsOpened == true) { ChannelListTemp.Where(p => p.MyChannelCfg.TcChaneelID == cLI.MyChannelCfg.TcChaneelID).ToList()[0].IsOpened = true; } } ChannelList = ChannelListTemp; }
/// <summary> /// /// </summary> public ChannelManageViewModel() { ChannelList = new List <ChannelListItemViewModel>(); var channelList = GlobalCache.ChannelList = THRIFTSERVICES.Services.ThriftServiceBasic.SelectChannelList(); foreach (MyChannelCfg mcc in channelList) { ChannelListItemViewModel channel = new ChannelListItemViewModel(); channel.MyChannelCfg = mcc; channel.IsOpened = false; ChannelList.Add(channel); } CapImageCount = 0; ComImageCount = 0; //初始化阈值 Threshold = new List <string>(); for (int i = 0; i < 100; i++) { Threshold.Add(i.ToString()); } }