/// <summary> /// Calls base or assigns a value to the current property. /// </summary> void OnInvokingCommand(object sender, CommandLineEventArgs e) { // base string code = e.Command.TrimStart(); if (!code.StartsWith("=", StringComparison.Ordinal)) { return; } // we do e.Ignore = true; // skip empty FarFile f = CurrentFile; if (f == null) { return; } if (!(f.Data is PSPropertyInfo pi)) { return; } try { SetUserValue(pi, code.Substring(1)); UpdateRedraw(true); } catch (RuntimeException ex) { A.Message(ex.Message); } }
/// <summary> /// When a valid address is provided, we scroll the memory window to that address /// </summary> private void OnCommandLineEntered(object sender, CommandLineEventArgs e) { if (ushort.TryParse(e.CommandLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ushort addr)) { ScrollToTop(addr); e.Handled = true; } }
/// <summary> /// When a valid address is provided, we scroll the memory window to that address /// </summary> private void OnCommandLineEntered(object sender, CommandLineEventArgs e) { e.Handled = Vm.ProcessCommandline(e.CommandLine, out var validationMessage); if (validationMessage != null) { Prompt.IsValid = false; Prompt.ValidationMessage = validationMessage; } }
/// <summary> /// When a valid address is provided, we scroll the memory window to that address /// </summary> private void OnCommandLineEntered(object sender, CommandLineEventArgs e) { e.Handled = Vm.ProcessCommandline(e.CommandLine, out var validationMessage, out var newPrompt); if (validationMessage != null) { Prompt.IsValid = false; Prompt.ValidationMessage = validationMessage; } if (newPrompt != null) { Prompt.CommandText = newPrompt; Prompt.CommandLine.CaretIndex = Prompt.CommandText.Length; } }