Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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)));
        }