/********* ** Public methods *********/ /// <summary>Construct an instance.</summary> /// <param name="provider">The underlying value provider.</param> public GenericToken(IValueProvider provider) { this.Values = provider; this.Name = TokenName.Parse(provider.Name); this.CanHaveMultipleRootValues = provider.CanHaveMultipleValues(); }
/********* ** Public methods *********/ /// <summary>Construct an instance.</summary> /// <param name="provider">The underlying value provider.</param> public GenericToken(IValueProvider provider) { this.Values = provider; this.Name = TokenName.Parse(provider.Name); this.CanHaveSubkeys = provider.AllowsInput; this.RequiresSubkeys = provider.RequiresInput; this.CanHaveMultipleRootValues = provider.CanHaveMultipleValues(); this.IsValidInContext = provider.IsValidInContext; }
/// <summary>Construct an instance.</summary> /// <param name="name">The token name.</param> /// <param name="canHaveMultipleValues">Whether the token may contain multiple values (or <c>null</c> to set it based on the given values).</param> /// <param name="allowedValues">The allowed values (or <c>null</c> if any value is allowed).</param> /// <param name="values">Get the current token values.</param> public ImmutableToken(string name, InvariantHashSet values, InvariantHashSet allowedValues = null, bool?canHaveMultipleValues = null) : this(TokenName.Parse(name), values, allowedValues, canHaveMultipleValues) { }
/// <summary>Construct an instance.</summary> /// <param name="name">The token name.</param> /// <param name="canHaveMultipleRootValues">Whether the root token may contain multiple values.</param> protected BaseToken(string name, bool canHaveMultipleRootValues) : this(TokenName.Parse(name), canHaveMultipleRootValues) { }