Exemple #1
0
        public ImmutableNamedElementCollectionDebugView(ImmutableNamedElementCollection <T> namedElementCollection)
        {
            if (namedElementCollection == null)
            {
                throw new ArgumentNullException(nameof(namedElementCollection));
            }

            nec = namedElementCollection;
        }
Exemple #2
0
 internal Property(
     PropertyName name,
     Value value,
     ImmutableNamedElementCollection <Property> properties)
 {
     Name        = name;
     Value       = value;
     _properties = properties;
 }
Exemple #3
0
 internal Ticket(
     ImmutableNamedElementCollection <Feature> features,
     ImmutableNamedElementCollection <ParameterInit> parameters,
     ImmutableNamedElementCollection <Property> properties,
     NamespaceDeclarationCollection namespaceDeclarations)
 {
     _features           = features;
     _parameters         = parameters;
     _properties         = properties;
     _declaredNamespaces = namespaceDeclarations;
 }
Exemple #4
0
 internal Feature(
     FeatureName name,
     ImmutableNamedElementCollection <Property> properties,
     ImmutableList <Option> options,
     ImmutableNamedElementCollection <Feature> nestedFeature)
 {
     Name        = name;
     _properties = properties;
     _options    = options;
     _features   = nestedFeature;
 }
Exemple #5
0
 internal Option(
     XName name,
     XName constrained,
     ImmutableNamedElementCollection <Property> properties,
     ImmutableNamedElementCollection <ScoredProperty> scoredPropertis)
 {
     Name              = name;
     Constrained       = constrained;
     _properties       = properties;
     _scoredProperties = scoredPropertis;
 }
Exemple #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ParameterDef"/> class.
        /// </summary>
        /// <param name="name">Name of this element.</param>
        /// <param name="elements">Properties of this element.</param>
        public ParameterDef(ParameterName name, params Property[] elements)
        {
            Name = name;

            var properties = ImmutableNamedElementCollection.CreatePropertyCollectionBuilder();

            foreach (var e in elements)
            {
                properties.Add(e);
            }

            _properties = properties.ToImmutable();
        }
Exemple #7
0
 internal ScoredProperty(
     ScoredPropertyName name,
     Value value,
     ParameterRef parameter,
     ImmutableNamedElementCollection <ScoredProperty> scoredProperties,
     ImmutableNamedElementCollection <Property> properties)
 {
     Name              = name;
     Value             = value;
     ParameterRef      = parameter;
     _scoredProperties = scoredProperties;
     _properties       = properties;
 }
Exemple #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Property"/> class.
        /// </summary>
        /// <param name="name">Name of this element.</param>
        /// <param name="value">Value element contained by this element</param>
        /// <param name="elements">Nested Properties</param>
        public Property(PropertyName name, Value value, params Property[] elements)
        {
            Name  = name;
            Value = value;

            var properties = ImmutableNamedElementCollection.CreatePropertyCollectionBuilder();

            foreach (var e in elements)
            {
                properties.Add(e);
            }

            _properties = properties.ToImmutable();
        }
Exemple #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScoredProperty"/> class.
        /// </summary>
        /// <param name="name">Name of ScoredProperty element.</param>
        /// <param name="elements">Child Property and/or ScoredProperty.</param>
        public ScoredProperty(ScoredPropertyName name, params ScoredPropertyChild[] elements)
        {
            Name = name;

            var scoredProperties = ImmutableNamedElementCollection.CreateScoredPropertyCollectionBuilder();
            var properties       = ImmutableNamedElementCollection.CreatePropertyCollectionBuilder();

            foreach (var e in elements)
            {
                e.Apply(
                    onScoredProperty: x => scoredProperties.Add(x),
                    onProperty: x => properties.Add(x));
            }

            _scoredProperties = scoredProperties.ToImmutable();
            _properties       = properties.ToImmutable();
        }
Exemple #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Option"/> class.
        /// </summary>
        /// <param name="name">Name of the Option.</param>
        /// <param name="constrained">Constraint value.</param>
        /// <param name="elements">Children of the Option.</param>
        public Option(XName name, XName constrained, params OptionChild[] elements)
        {
            Name        = name;
            Constrained = constrained;

            var properties       = ImmutableNamedElementCollection.CreatePropertyCollectionBuilder();
            var scoredProperties = ImmutableNamedElementCollection.CreateScoredPropertyCollectionBuilder();

            foreach (var e in elements)
            {
                e.Apply(
                    onProperty: x => properties.Add(x),
                    onScoredProperty: x => scoredProperties.Add(x));
            }

            _properties       = properties.ToImmutable();
            _scoredProperties = scoredProperties.ToImmutable();
        }
Exemple #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Ticket"/> class.
        /// </summary>
        /// <param name="elements">The child elements.</param>
        public Ticket(params TicketChild[] elements)
        {
            var features   = ImmutableNamedElementCollection.CreateFeatureCollectionBuilder();
            var parameters = ImmutableNamedElementCollection.CreateParameterInitCollectionBuilder();
            var properties = ImmutableNamedElementCollection.CreatePropertyCollectionBuilder();

            foreach (var e in elements)
            {
                e.Apply(
                    onFeature: x => features.Add(x),
                    onParameterInit: x => parameters.Add(x),
                    onProperty: x => properties.Add(x));
            }

            _features           = features.ToImmutable();
            _parameters         = parameters.ToImmutable();
            _properties         = properties.ToImmutable();
            _declaredNamespaces = NamespaceDeclarationCollection.Default;
        }
Exemple #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Feature"/> class.
        /// </summary>
        /// <param name="name">The name of the element.</param>
        /// <param name="elements">The options of the element.</param>
        public Feature(FeatureName name, params FeatureChild[] elements)
        {
            Name = name;
            var o          = new Option();
            var properties = ImmutableNamedElementCollection.CreatePropertyCollectionBuilder();
            var options    = ImmutableList.CreateBuilder <Option>();
            var features   = ImmutableNamedElementCollection.CreateFeatureCollectionBuilder();

            foreach (var e in elements)
            {
                e.Apply(
                    onProperty: x => properties.Add(x),
                    onOption: x => options.Add(x),
                    onFeature: x => features.Add(x));
            }

            _properties = properties.ToImmutable();
            _options    = options.ToImmutable();
            _features   = features.ToImmutable();
        }
Exemple #13
0
 internal ParameterDef(ParameterName name, ImmutableNamedElementCollection <Property> properties)
 {
     Name        = name;
     _properties = properties;
 }
 public bool Equals(ImmutableNamedElementCollection <T> rhs)
 {
     return(this == rhs);
 }