Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
		}