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); }
internal void LoadList(ArchorDevList archors) { this.archors = archors; resultList = new CommandResultManager(); if (archors.ArchorList != null) { foreach (var item in archors.ArchorList) { var group = resultList.Add(item); //group.Archor.Ip = item.ArchorIp; group.Archor.Area = item.InstallArea; } } UDPArchorList list = new UDPArchorList(); foreach (var item in resultList.Groups) { list.Add(item.Archor); item.Archor.Num = list.Count; } archorList = list; if (ArchorListChanged != null) { ArchorListChanged(list, null); } }
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); }
public UDPArchorList GetMaxArchorList() { UDPArchorList list = new UDPArchorList(); foreach (var item in progressList) { list.Add(item.Value); } return(list); }
public UDPArchorList GetResultArchorList() { UDPArchorList list = new UDPArchorList(); foreach (var item in resultList.Groups) { list.Add(item.Archor); item.Archor.Num = list.Count; } return(list); }
public UDPArchorList AddArchor(System.Net.IPEndPoint iep, byte[] data) { resultList.Add(iep, data); archorList = new UDPArchorList(); foreach (var item in resultList.Groups) { archorList.Add(item.Archor); item.Archor.Num = archorList.Count; } if (ArchorListChanged != null) { ArchorListChanged(); } return(archorList); }
private UDPArchorList OnDataReceive(CommandResultGroup group) { UDPArchorList list = new UDPArchorList(); foreach (var item in resultList.Groups) { list.Add(item.Archor); item.Archor.Num = list.Count; } //if (ArchorUpdated != null) //{ // ArchorUpdated(group.Archor); //} if (ArchorListChanged != null) { ArchorListChanged(list, group.Archor); } return(list); }
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); }
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); }