Ejemplo n.º 1
0
        public void RefreshChannelList()
        {
            List <ChannelListItemViewModel> ChannelListTemp = new List <ChannelListItemViewModel>();

            foreach (MyChannelCfg mcc in new ThirftService().QueryAllChannel())
            {
                if (Login.ClientType == "1")
                {
                    if (mcc.Name.Contains(Login.ClientAreaName))
                    {
                        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;
        }
Ejemplo n.º 2
0
        public ChannelManageViewModel()
        {
            ChannelList = new List <ChannelListItemViewModel>();
            foreach (MyChannelCfg mcc in new ThirftService().QueryAllChannel())
            {
                ChannelListItemViewModel channel = new ChannelListItemViewModel();
                channel.MyChannelCfg = mcc;
                channel.IsOpened     = false;
                ChannelList.Add(channel);
            }
            //RefreshChannelList();
            CapImageCount = 0;
            ComImageCount = 0;

            //初始化阈值
            Threshold = new List <string>();
            for (int i = 1; i < 100; i++)
            {
                Threshold.Add(i + "");
            }
            //初始化阈值选中项
            //SelectedThreshold = Convert.ToInt32(ConfigurationManager.AppSettings["阈值"]) - 1 ;
        }