/// <summary>Get whether the token always chooses from a set of known values for the given input.</summary>
 /// <param name="input">The input argument, if applicable.</param>
 /// <param name="allowedValues">The possible values for the input.</param>
 /// <exception cref="InvalidOperationException">The input argument doesn't match this value provider, or does not respect <see cref="IValueProvider.AllowsInput"/> or <see cref="IValueProvider.RequiresInput"/>.</exception>
 public override bool HasBoundedValues(ITokenString input, out InvariantHashSet allowedValues)
 {
     allowedValues = input.IsMeaningful()
         ? InvariantHashSet.Boolean()
         : this.GetValidInputs();
     return(true);
 }
Exemple #2
0
 /// <summary>Get whether the token always chooses from a set of known values for the given input. Mutually exclusive with <see cref="IValueProvider.HasBoundedRangeValues"/>.</summary>
 /// <param name="input">The input argument, if applicable.</param>
 /// <param name="allowedValues">The possible values for the input.</param>
 /// <exception cref="InvalidOperationException">The input argument doesn't match this value provider, or does not respect <see cref="IValueProvider.AllowsInput"/> or <see cref="IValueProvider.RequiresInput"/>.</exception>
 public override bool HasBoundedValues(ITokenString input, out InvariantHashSet allowedValues)
 {
     allowedValues = input.IsMeaningful()
         ? InvariantHashSet.Boolean()
         : this.AllowedRootValues;
     return(allowedValues != null);
 }
        /// <summary>Get whether the token always chooses from a set of known values for the given input. Mutually exclusive with <see cref="IValueProvider.HasBoundedRangeValues"/>.</summary>
        /// <param name="input">The input argument, if applicable.</param>
        /// <param name="allowedValues">The possible values for the input.</param>
        /// <exception cref="InvalidOperationException">The input argument doesn't match this value provider, or does not respect <see cref="IValueProvider.AllowsInput"/> or <see cref="IValueProvider.RequiresInput"/>.</exception>
        public override bool HasBoundedValues(ITokenString input, out InvariantHashSet allowedValues)
        {
            if (input.IsMeaningful())
            {
                allowedValues = InvariantHashSet.Boolean();
                return(true);
            }

            allowedValues = null;
            return(false);
        }
        /// <inheritdoc />
        public virtual bool HasBoundedValues(IInputArguments input, out InvariantHashSet allowedValues)
        {
            // 'contains' limited to true/false
            if (input.ReservedArgs.ContainsKey(InputArguments.ContainsKey))
            {
                allowedValues = InvariantHashSet.Boolean();
                return(true);
            }

            // default logic
            return(this.Values.HasBoundedValues(input, out allowedValues));
        }
 /// <summary>Get the allowed values for an input argument (or <c>null</c> if any value is allowed).</summary>
 /// <param name="input">The input argument, if applicable.</param>
 /// <exception cref="InvalidOperationException">The input argument doesn't match this value provider, or does not respect <see cref="IValueProvider.AllowsInput"/> or <see cref="IValueProvider.RequiresInput"/>.</exception>
 public override InvariantHashSet GetAllowedValues(string input)
 {
     return(input != null
         ? InvariantHashSet.Boolean()
         : this.AllowedRootValues);
 }
 /// <summary>Get the allowed values for an input argument (or <c>null</c> if any value is allowed).</summary>
 /// <param name="input">The input argument, if applicable.</param>
 /// <exception cref="InvalidOperationException">The input argument doesn't match this value provider, or does not respect <see cref="IValueProvider.AllowsInput"/> or <see cref="IValueProvider.RequiresInput"/>.</exception>
 public override InvariantHashSet GetAllowedValues(ITokenString input)
 {
     return(input.IsMeaningful()
         ? InvariantHashSet.Boolean()
         : this.AllowedRootValues);
 }
 /// <summary>Get the allowed values for a token name (or <c>null</c> if any value is allowed).</summary>
 /// <exception cref="InvalidOperationException">The key doesn't match this token, or the key does not respect <see cref="IToken.CanHaveSubkeys"/> or <see cref="IToken.RequiresSubkeys"/>.</exception>
 public override InvariantHashSet GetAllowedValues(TokenName name)
 {
     return(name.HasSubkey()
         ? InvariantHashSet.Boolean()
         : this.AllowedRootValues);
 }
Exemple #8
0
 /// <inheritdoc />
 public override bool HasBoundedValues(IInputArguments input, out InvariantHashSet allowedValues)
 {
     allowedValues = InvariantHashSet.Boolean();
     return(true);
 }
Exemple #9
0
 /// <summary>Get whether the token always chooses from a set of known values for the given input.</summary>
 /// <param name="input">The input argument, if applicable.</param>
 /// <param name="allowedValues">The possible values for the input.</param>
 /// <exception cref="InvalidOperationException">The input argument doesn't match this value provider, or does not respect <see cref="IValueProvider.AllowsInput"/> or <see cref="IValueProvider.RequiresInput"/>.</exception>
 public override bool HasBoundedValues(ITokenString input, out InvariantHashSet allowedValues)
 {
     allowedValues = InvariantHashSet.Boolean();
     return(true);
 }
Exemple #10
0
 /// <summary>Get the allowed values for an input argument (or <c>null</c> if any value is allowed).</summary>
 /// <param name="input">The input argument, if applicable.</param>
 /// <exception cref="InvalidOperationException">The input argument doesn't match this value provider, or does not respect <see cref="IValueProvider.AllowsInput"/> or <see cref="IValueProvider.RequiresInput"/>.</exception>
 public override InvariantHashSet GetAllowedValues(ITokenString input)
 {
     return(InvariantHashSet.Boolean());
 }