Exemple #1
0
        /// <summary>
        /// Sets the fallback predictor.
        /// </summary>
        /// <param name="commands">The command collection to set the predictor</param>
        protected void SetFallbackPredictor(IList <PredictiveCommand> commands)
        {
            Validation.CheckArgument(commands, $"{nameof(commands)} cannot be null.");

            _fallbackPredictor     = new CommandLinePredictor(commands, _parameterValuePredictor);
            _allPredictiveCommands = commands.Select(x => AzPredictorService.GetCommandName(x.Command)).ToHashSet <string>(StringComparer.OrdinalIgnoreCase); // this could be slow
        }
Exemple #2
0
 /// <summary>
 /// Sets the commands predictor.
 /// </summary>
 /// <param name="commands">The command collection to set the predictor</param>
 protected void SetCommandsPredictor(IList <string> commands)
 {
     this._commands   = new Predictor(commands, this._parameterValuePredictor);
     this._commandSet = commands.Select(x => AzPredictorService.GetCommandName(x)).ToHashSet <string>(StringComparer.OrdinalIgnoreCase); // this could be slow
 }