static void ExecuteInternal(DnHexBox dnHexBox) { if (dnHexBox == null) { return; } ulong start = dnHexBox.CaretPosition.Offset; ulong end = start; if (dnHexBox.Selection != null) { start = dnHexBox.Selection.Value.StartOffset; end = dnHexBox.Selection.Value.EndOffset; } var data = new SelectVM(dnHexBox.PhysicalToVisibleOffset(start), dnHexBox.PhysicalToVisibleOffset(end), dnHexBox.PhysicalToVisibleOffset(dnHexBox.StartOffset), dnHexBox.PhysicalToVisibleOffset(dnHexBox.EndOffset)); var win = new SelectDlg(); win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) { return; } dnHexBox.Selection = new HexSelection(dnHexBox.VisibleToPhysicalOffset(data.EndVM.Value), dnHexBox.VisibleToPhysicalOffset(data.StartVM.Value)); dnHexBox.CaretPosition = new HexBoxPosition(dnHexBox.VisibleToPhysicalOffset(data.StartVM.Value), dnHexBox.CaretPosition.Kind, 0); }
internal static void Execute2(DnHexBox dnHexBox) { if (!CanExecute(dnHexBox)) { return; } var data = new GoToOffsetVM(dnHexBox.PhysicalToVisibleOffset(dnHexBox.CaretPosition.Offset), dnHexBox.PhysicalToVisibleOffset(dnHexBox.StartOffset), dnHexBox.PhysicalToVisibleOffset(dnHexBox.EndOffset)); var win = new GoToOffsetDlg(); win.DataContext = data; win.Owner = MainWindow.Instance; if (dnHexBox.IsMemory) { win.Title = "Go to Address"; win.offsetLabel.Content = "_Address"; } else { win.Title = "Go to Offset"; win.offsetLabel.Content = "O_ffset"; } if (win.ShowDialog() != true) { return; } dnHexBox.CaretPosition = new HexBoxPosition(dnHexBox.VisibleToPhysicalOffset(data.OffsetVM.Value), dnHexBox.CaretPosition.Kind, 0); }
internal static void Execute2(DnHexBox dnHexBox) { if (!CanExecute(dnHexBox)) return; var data = new GoToOffsetVM(dnHexBox.PhysicalToVisibleOffset(dnHexBox.CaretPosition.Offset), dnHexBox.PhysicalToVisibleOffset(dnHexBox.StartOffset), dnHexBox.PhysicalToVisibleOffset(dnHexBox.EndOffset)); var win = new GoToOffsetDlg(); win.DataContext = data; win.Owner = MainWindow.Instance; if (dnHexBox.IsMemory) { win.Title = "Go to Address"; win.offsetLabel.Content = "_Address"; } else { win.Title = "Go to Offset"; win.offsetLabel.Content = "O_ffset"; } if (win.ShowDialog() != true) return; dnHexBox.CaretPosition = new HexBoxPosition(dnHexBox.VisibleToPhysicalOffset(data.OffsetVM.Value), dnHexBox.CaretPosition.Kind, 0); }
static void ExecuteInternal(DnHexBox dnHexBox) { if (dnHexBox == null) return; ulong start = dnHexBox.CaretPosition.Offset; ulong end = start; if (dnHexBox.Selection != null) { start = dnHexBox.Selection.Value.StartOffset; end = dnHexBox.Selection.Value.EndOffset; } var data = new SelectVM(dnHexBox.PhysicalToVisibleOffset(start), dnHexBox.PhysicalToVisibleOffset(end), dnHexBox.PhysicalToVisibleOffset(dnHexBox.StartOffset), dnHexBox.PhysicalToVisibleOffset(dnHexBox.EndOffset)); var win = new SelectDlg(); win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) return; dnHexBox.Selection = new HexSelection(dnHexBox.VisibleToPhysicalOffset(data.EndVM.Value), dnHexBox.VisibleToPhysicalOffset(data.StartVM.Value)); dnHexBox.CaretPosition = new HexBoxPosition(dnHexBox.VisibleToPhysicalOffset(data.StartVM.Value), dnHexBox.CaretPosition.Kind, 0); }