private void CbFilterCodition2_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_archorList == null) { return; } int id = CbFilterCodition2.SelectedIndex; UDPArchorList list = new UDPArchorList(); foreach (var item in subArchorList) { if (id == 0)//全部 { list.Add(item); } else if (id == 1)//有值 { if (!string.IsNullOrEmpty(item.Value)) { list.Add(item); } } else if (id == 2)//无值 { if (string.IsNullOrEmpty(item.Value)) { list.Add(item); } } } DataGrid3.ItemsSource = list; LbCount.Content = string.Format("{0}/{1}", list.GetConnectedCount(), list.Count); }
private void BtnNoDbInfo_Click(object sender, RoutedEventArgs e) { if (_archorList == null) { return; } int id = CbFilterCodition2.SelectedIndex; UDPArchorList list = new UDPArchorList(); foreach (var item in _archorList) { if (string.IsNullOrEmpty(item.DbInfo) && !string.IsNullOrEmpty(item.IsConnected)) { list.Add(item); } } DataGrid3.ItemsSource = list; LbCount.Content = string.Format("{0}/{1}", list.GetConnectedCount(), list.Count); }
private void CbAreas_SelectionChanged(object sender, SelectionChangedEventArgs e) { var area = CbAreas.SelectedItem as string; string[] parts = area.Split(' '); subArchorList = new UDPArchorList(); foreach (var item in _archorList) { if (area == "全部") { subArchorList.Add(item); } else if (item.RealArea == area) { subArchorList.Add(item); } } DataGrid3.ItemsSource = subArchorList; LbCount.Content = string.Format("{0}/{1}", subArchorList.GetConnectedCount(), subArchorList.Count); }
private void SetArchorList(ArchorManager archorManager, UDPArchorList list, UDPArchor item1 = null, int id = -1) { this.Dispatcher.Invoke(() => { if (archorManager == null) { TbConsole.Text = ""; DataGrid3.ItemsSource = null; LbCount.Content = ""; LbStatistics.Content = ""; } else { //IsDirty = true; LbTime.Content = archorManager.GetTimeSpan(); TbConsole.Text = archorManager.Log; if (DbArchorListDict != null) { //list.ClearInfo(); foreach (var item in list) { item.DbInfo = ""; item.RealArea = ""; var clientIP = item.GetClientIP(); //var ar = DbArchorList.Find(i => i.Ip == clientIP); if (DbArchorListDict.ContainsKey(clientIP)) { var ar = DbArchorListDict[clientIP]; if (ar != null) { item.RealArea = ar.Parent.Name; if (item.GetClientIP() != ar.Ip) { item.DbInfo = "IP:" + ar.Ip; } else { string code = ar.Code.Trim(); if (!string.IsNullOrEmpty(code)) { item.DbInfo = "有:" + code; } else { item.DbInfo = "有:" + ar.Ip; } } } } } } if (id > 0) { var item2 = list[id]; if (item2 != item1) { } int id2 = list.IndexOf(item1); } DataGrid3.ItemsSource = list; if (id > 0) { var item2 = list[id]; if (item2 != item1) { } int id2 = list.IndexOf(item1); } LbCount.Content = list.GetConnectedCount(); LbStatistics.Content = archorManager.GetStatistics(); LbServerIpList.Content = list.ServerList.GetText(); LbListenCount.Content = archorManager.valueList.Count; LbListenStatistics.Content = archorManager.valueList.GetStatistics(); } }); }
public void Filter() { if (_archorList == null) { return; } int id = CbFilterCondition.SelectedIndex; subArchorList = new UDPArchorList(); foreach (var item in _archorList) { if (id == 0)//全部 { subArchorList.Add(item); } else if (id == 1)//连通 { if (!string.IsNullOrEmpty(item.IsConnected)) { subArchorList.Add(item); } } else if (id == 2)//不连通 { if (string.IsNullOrEmpty(item.IsConnected)) { subArchorList.Add(item); } } else if (id == 3)//Ping通 { if (!string.IsNullOrEmpty(item.Ping)) { subArchorList.Add(item); } } else if (id == 4)//不Ping通 { if (string.IsNullOrEmpty(item.Ping)) { subArchorList.Add(item); } } else if (id == 5)//3 { if (item.GetClientIP().StartsWith("192.168.3.")) { subArchorList.Add(item); } } else if (id == 6)//4 { if (item.GetClientIP().StartsWith("192.168.4.")) { subArchorList.Add(item); } } else if (id == 7)//5 { if (item.GetClientIP().StartsWith("192.168.5.")) { subArchorList.Add(item); } } else if (id == 8)//1999端口 { if (item.ServerPort == 1999) { subArchorList.Add(item); } } else if (id == 9)//有DbInfo { if (!string.IsNullOrEmpty(item.DbInfo)) { subArchorList.Add(item); } } else if (id == 10)//11222902 { if (item.SoftVersion == "11222902") { subArchorList.Add(item); } } else if (id == 11)//11222906 { if (item.SoftVersion == "11222906") { subArchorList.Add(item); } } else if (id == 12)//11222906 { if (item.SoftVersion == "11222907") { subArchorList.Add(item); } } else if (id == 13)//3506 { if (item.SoftVersion == "3156" || item.SoftVersion == "3157") { subArchorList.Add(item); } } else if (id == 14)//网关错误 { if (!string.IsNullOrEmpty(item.Ip) && !string.IsNullOrEmpty(item.Gateway) && !IpHelper.IsSameDomain(item.Ip, item.Gateway)) { subArchorList.Add(item); } } else if (id == 15)//IsChecked { if (item.IsChecked) { subArchorList.Add(item); } } else if (id == 16)//有DbInfo { if (!string.IsNullOrEmpty(item.DbInfo)) { subArchorList.Add(item); } } else if (id == 17)//无DbInfo { if (string.IsNullOrEmpty(item.DbInfo)) { subArchorList.Add(item); } } else if (id == 18)//非25IP { if (!string.IsNullOrEmpty(item.IsConnected) && item.ServerIp != "172.16.100.25") { subArchorList.Add(item); } } else if (id == 19)//ping有问题的 { if (string.IsNullOrEmpty(item.Ping) || item.Ping == "*") { subArchorList.Add(item); } else { string[] parts = item.Ping.Split('/'); if (parts[0] != parts[1]) { subArchorList.Add(item); } } } else if (id == 20)//ping空 { if (string.IsNullOrEmpty(item.Ping)) { subArchorList.Add(item); } } else if (id == 21)//ping失败 { if (item.Ping == "*") { subArchorList.Add(item); } } else if (id == 22)//ping丢包 { if (!string.IsNullOrEmpty(item.Ping)) { string[] parts = item.Ping.Split('/'); if (parts.Length == 2 && parts[0] != parts[1]) { subArchorList.Add(item); } } } } DataGrid3.ItemsSource = subArchorList; LbCount.Content = string.Format("{0}/{1}", subArchorList.GetConnectedCount(), subArchorList.Count); }