void SetEntry() { if (ValueTextBox.Text.Trim().Length <= 0) { return; } byte[] writeBuf = SearchTypeConverter.ParseInputToByteArray(ValueTextBox.Text, TargetEntry.ValueType); if (writeBuf.Length <= 0) { MessageBox.Show("Failed to convert input value!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error); return; } if (TargetEntry.ValueType == SearchType.String) { List <byte> strList = writeBuf.ToList(); strList.Add((byte)0x00); writeBuf = strList.ToArray(); } TargetEntry.Frozen = FrozenCheckBox.IsChecked.Value; TargetEntry.Value = ValueTextBox.Text; try { TargetProcess.WriteBuffer(TargetEntry.OriginalAddress, writeBuf); } catch (Exception e) { } this.Close(); }
private void UpdateSearchEntryFrozen(SearchEntry en) { byte[] write = SearchTypeConverter.ParseInputToByteArray(en.Value, en.ValueType); if (write.Length <= 0) { return; //failed to parse, no messagebox to avoid spam } if (en.ValueType == SearchType.String) { List <byte> strList = write.ToList(); strList.Add((byte)0x00); write = strList.ToArray(); } SelectedProcess.WriteBuffer(en.OriginalAddress, write); }