Exemple #1
0
        /// <summary>
        /// Sets the value to the Property specified name.
        /// </summary>
        /// <param name="name">The name of the Property to set value.</param>
        /// <param name="value">The new value of the Property.</param>
        /// <returns>The new instance with new Property value.</returns>
        public Option Set(PropertyName name, Value value)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            var p = _properties.Get(name)?.Set(value) ?? new Property(name, value);

            return(new Option(Name, Constrained, _properties.SetItem(p), _scoredProperties));
        }
Exemple #2
0
        /// <summary>
        /// Sets a value to the Property specified name.
        /// </summary>
        /// <remarks>
        /// Returns new instance of Feature when specified Property found,
        /// otherwise return this.
        /// </remarks>
        /// <param name="name">The name of Property.</param>
        /// <param name="value">The new value of Property.</param>
        /// <returns>The new instance with Property set new value.</returns>
        public Feature Set(PropertyName name, Value value)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            var p = _properties.Get(name)?.Set(value)
                    ?? new Property(name, value);

            return(new Feature(Name, _properties.SetItem(p), _options, _features));
        }
Exemple #3
0
        /// <summary>
        /// Sets a value to the Property specified by name.
        /// </summary>
        /// <param name="name">The name of the Property to set.</param>
        /// <param name="value">A value to set to the Property.</param>
        /// <returns>A new Ticket with the value set.</returns>
        public Ticket Set(PropertyName name, Value value)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            var p = new Property(name, value);

            return(new Ticket(_features, _parameters, _properties.SetItem(p), _declaredNamespaces));
        }
Exemple #4
0
        /// <summary>
        /// Sets the value to the Property of the Feature specified name.
        /// </summary>
        /// <param name="name1">The name of Feature.</param>
        /// <param name="name2">The name of Property.</param>
        /// <param name="value">The value to set.</param>
        /// <returns>The new instance containing new value.</returns>
        public Capabilities Set(FeatureName name1, PropertyName name2, Value value)
        {
            if (name1 == null)
            {
                throw new ArgumentNullException(nameof(name1));
            }
            if (name2 == null)
            {
                throw new ArgumentNullException(nameof(name2));
            }

            var ft = _features.Get(name1)?.Set(name2, value) ?? new Feature(name1, new Property(name2, value));

            return(new Capabilities(_features.SetItem(ft), _parameters, _properties, _declaredNamespaces));
        }
Exemple #5
0
        /// <summary>
        /// Sets the <see cref="Option"/> to the nested <see cref="Feature"/>
        /// specified name.
        /// </summary>
        /// <param name="name">The name of the nested <see cref="Feature"/>.</param>
        /// <param name="selection">The <see cref="Option"/> to set.</param>
        /// <returns>The new instance contains new <see cref="Option"/>.</returns>
        public Feature Set(FeatureName name, Option selection)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (selection == null)
            {
                throw new ArgumentNullException(nameof(selection));
            }

            var ft = _features.Contains(name)
                ? _features[name].Set(selection)
                : new Feature(name, selection);

            return(new Feature(Name, _properties, _options, _features.SetItem(ft)));
        }
Exemple #6
0
        /// <summary>
        /// Set an option to the Feature specified by name.
        /// </summary>
        /// <param name="name">The name of Feature to set.</param>
        /// <param name="selection">An option to set to the Feature.</param>
        /// <returns>A new Ticket with the option set.</returns>
        public Ticket Set(FeatureName name, Option selection)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (selection == null)
            {
                throw new ArgumentNullException(nameof(selection));
            }

            var sel = ToPrintTicketOption(selection);
            var ft  = _features.Contains(name)
                ? _features[name].Set(sel)
                : new Feature(name, sel);

            return(new Ticket(_features.SetItem(ft), _parameters, _properties, _declaredNamespaces));
        }
Exemple #7
0
        public Property Set(PropertyName name, Value value)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            var p = _properties.Get(name) ?? new Property(name);

            return(new Property(Name, value, _properties.SetItem(p)));
        }