Exemplo n.º 1
0
        protected override void Execute(DnHexBox dnHexBox)
        {
            var sel = dnHexBox.Selection;

            if (sel == null)
            {
                return;
            }

            var ask = new AskForInput();

            ask.Owner         = MainWindow.Instance;
            ask.Title         = "Enter Value";
            ask.label.Content = "_Byte";
            ask.textBox.Text  = "0xFF";
            ask.ShowDialog();
            if (ask.DialogResult != true)
            {
                return;
            }

            string error;
            byte   b = NumberVMUtils.ParseByte(ask.textBox.Text, byte.MinValue, byte.MaxValue, out error);

            if (!string.IsNullOrEmpty(error))
            {
                MainWindow.Instance.ShowMessageBox(error);
                return;
            }

            dnHexBox.FillBytes(sel.Value.StartOffset, sel.Value.EndOffset, b);
            dnHexBox.Selection = null;
        }
Exemplo n.º 2
0
		protected override void Execute(DnHexBox dnHexBox) {
			var sel = dnHexBox.Selection;
			if (sel == null)
				return;

			var ask = new AskForInput();
			ask.Owner = MainWindow.Instance;
			ask.Title = "Enter Value";
			ask.label.Content = "_Byte";
			ask.textBox.Text = "0xFF";
			ask.ShowDialog();
			if (ask.DialogResult != true)
				return;

			string error;
			byte b = NumberVMUtils.ParseByte(ask.textBox.Text, byte.MinValue, byte.MaxValue, out error);
			if (!string.IsNullOrEmpty(error)) {
				MainWindow.Instance.ShowMessageBox(error);
				return;
			}

			dnHexBox.FillBytes(sel.Value.StartOffset, sel.Value.EndOffset, b);
			dnHexBox.Selection = null;
		}