private void TypeFilter_SelectionChanged(object sender, SelectionChangedEventArgs e) { var item = ((sender as ComboBox).SelectedItem as KeyValueModel); if (item != null) { int type = (int)item.Key; PacketFilter.Source = (PacketSource)type; PacketsListItems.Refresh(); } }
private void PatternFilter_TextChanged(object sender, TextChangedEventArgs e) { var hex = Utils.Invoke(() => PatternFilter.Text)?.Replace(" ", ""); byte[] bytePattern = null; try { if (!string.IsNullOrEmpty(hex) && (hex.Length % 2) == 0) { bytePattern = Utils.HexToByteArrayNoSpaces(hex); } PacketFilter.Bytes = bytePattern; PacketsListItems.Refresh(); } catch (Exception ex) { Utils.Log(ex.Message + " " + ex.StackTrace, "error"); } }
private void LengthFilter_TextChanged(object sender, TextChangedEventArgs e) { var lenghts = Utils.Invoke(() => LengthFilter.Text).Split(','); if (lenghts.Count() > 0) { PacketFilter.Length.Clear(); foreach (var len in lenghts) { try { int length = int.Parse(len); PacketFilter.Length.Add(length); } catch { continue; } } } PacketsListItems.Refresh(); }