public ValueChange(SignEX s, IEnumerable <IntPtr> list) { InitializeComponent(); changelist = list; sc = s; }
private void Button_search(object sender, RoutedEventArgs e) { TaskbarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.Indeterminate; if (process == null) { MessageBox.Show("You have to select process first"); TaskbarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None; return; } if (string.IsNullOrWhiteSpace(Text1.Text)) { TaskbarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None; return; } s = new SignEX(process); byte[] bytes_scan = null; int? value = null; if (ValueBox.SelectedIndex == 1) { try { if (BaseBox.SelectedIndex == 1) { bytes_scan = Text1.Text.Split(' ').Where(x => x != string.Empty). Select(x => byte.Parse(x, System.Globalization.NumberStyles.HexNumber)).ToArray(); } else { bytes_scan = Text1.Text.Split(' ').Where(x => x != string.Empty). Select(byte.Parse).ToArray(); } } catch { MessageBox.Show("Values can't be parsed", "Error"); TaskbarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None; return; } } else { try { if (BaseBox.SelectedIndex == 1) { value = int.Parse(Text1.Text, System.Globalization.NumberStyles.HexNumber); } else { value = int.Parse(Text1.Text); } bytes_scan = BitConverter.GetBytes((int)value); } catch { MessageBox.Show("Values can't be parsed", "Error"); TaskbarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None; return; } } if (BaseBox.SelectedIndex == 1) { addresses_list.ItemsSource = s.SignScan(bytes_scan).Select(x => ((IntPtr)x, value == null ? Text1.Text : value.ToString())); } else { addresses_list.ItemsSource = s.SignScan(bytes_scan).Select(x => ((IntPtr)x, value == null ? Text1.Text : value.ToString())); } Updatelist(); TaskbarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None; }