protected override void EndProcessing() { using (UseRequestedDispatchTables()) { PSConsoleReadLine.RemoveKeyHandler(Chord); } }
protected IDisposable UseRequestedDispatchTables() { bool inViMode = PSConsoleReadLine.GetOptions().EditMode == EditMode.Vi; bool viModeParamPresent = MyInvocation.BoundParameters.ContainsKey("ViMode"); if (inViMode || viModeParamPresent) { if (!inViMode) { // "-ViMode" must have been specified explicitly. Well, okay... we can // modify the Vi tables... but isn't that an odd thing to do from // not-vi mode? WriteWarning(PSReadLineResources.NotInViMode); } if (ViMode == ViMode.Command) { return(PSConsoleReadLine.UseViCommandModeTables()); } else // default if -ViMode not specified, invalid, or "Insert" { return(PSConsoleReadLine.UseViInsertModeTables()); } } return(null); }
protected override void EndProcessing() { if (ParameterSetName.Equals(FunctionParameterSet)) { var function = (string)_dynamicParameters.Value[FunctionParameter].Value; var keyHandler = (Action <ConsoleKeyInfo?, object>) Delegate.CreateDelegate(typeof(Action <ConsoleKeyInfo?, object>), typeof(PSConsoleReadLine).GetMethod(function)); BriefDescription = function; PSConsoleReadLine.SetKeyHandler(Chord, keyHandler, BriefDescription, Description); } else { PSConsoleReadLine.SetKeyHandler(Chord, ScriptBlock, BriefDescription, Description); } }
protected override void EndProcessing() { bool bound = true; bool unbound = true; if (_bound.HasValue && _unbound.HasValue) { bound = _bound.Value.IsPresent; unbound = _unbound.Value.IsPresent; } else if (_bound.HasValue) { bound = _bound.Value.IsPresent; unbound = false; } else if (_unbound.HasValue) { bound = false; unbound = _unbound.Value.IsPresent; } WriteObject(PSConsoleReadLine.GetKeyHandlers(bound, unbound), true); }
static PSConsoleReadLine() { _singleton = new PSConsoleReadLine(); _viRegister = new ViRegister(_singleton); }
protected override void EndProcessing() { PSConsoleReadLine.RemoveKeyHandler(Chord); }
protected override void EndProcessing() { PSConsoleReadLine.SetOptions(this); }
protected override void EndProcessing() { WriteObject(PSConsoleReadLine.GetOptions()); }
static PSConsoleReadLine() { _singleton = new PSConsoleReadLine(); _clipboard = new ViRegister(_singleton); }
internal Prediction(PSConsoleReadLine singleton) { _singleton = singleton; SetViewStyle(PSConsoleReadLineOptions.DefaultPredictionViewStyle); }
internal PredictionInlineView(PSConsoleReadLine singleton) : base(singleton) { }
internal PredictionListView(PSConsoleReadLine singleton) : base(singleton) { Reset(); }
protected PredictionViewBase(PSConsoleReadLine singleton) { _singleton = singleton; }
/// <summary> /// Initialize a new instance of the <see cref="ViRegister" /> class. /// </summary> /// <param name="singleton">The <see cref="PSConsoleReadLine" /> object. /// Used to hook into the undo / redo subsystem as part of /// pasting the contents of the register into a buffer. /// </param> public ViRegister(PSConsoleReadLine singleton) { _singleton = singleton; }