コード例 #1
0
ファイル: DebugView.cs プロジェクト: kei10in/KipSharp
        public ImmutableNamedElementCollectionDebugView(ImmutableNamedElementCollection <T> namedElementCollection)
        {
            if (namedElementCollection == null)
            {
                throw new ArgumentNullException(nameof(namedElementCollection));
            }

            nec = namedElementCollection;
        }
コード例 #2
0
ファイル: Property.cs プロジェクト: kei10in/KipSharp
 internal Property(
     PropertyName name,
     Value value,
     ImmutableNamedElementCollection <Property> properties)
 {
     Name        = name;
     Value       = value;
     _properties = properties;
 }
コード例 #3
0
ファイル: Ticket.cs プロジェクト: kei10in/KipSharp
 internal Ticket(
     ImmutableNamedElementCollection <Feature> features,
     ImmutableNamedElementCollection <ParameterInit> parameters,
     ImmutableNamedElementCollection <Property> properties,
     NamespaceDeclarationCollection namespaceDeclarations)
 {
     _features           = features;
     _parameters         = parameters;
     _properties         = properties;
     _declaredNamespaces = namespaceDeclarations;
 }
コード例 #4
0
ファイル: Feature.cs プロジェクト: kei10in/KipSharp
 internal Feature(
     FeatureName name,
     ImmutableNamedElementCollection <Property> properties,
     ImmutableList <Option> options,
     ImmutableNamedElementCollection <Feature> nestedFeature)
 {
     Name        = name;
     _properties = properties;
     _options    = options;
     _features   = nestedFeature;
 }
コード例 #5
0
 internal Option(
     XName name,
     XName constrained,
     ImmutableNamedElementCollection <Property> properties,
     ImmutableNamedElementCollection <ScoredProperty> scoredPropertis)
 {
     Name              = name;
     Constrained       = constrained;
     _properties       = properties;
     _scoredProperties = scoredPropertis;
 }
コード例 #6
0
ファイル: ParameterDef.cs プロジェクト: kei10in/KipSharp
        /// <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();
        }
コード例 #7
0
ファイル: ScoredProperty.cs プロジェクト: kei10in/KipSharp
 internal ScoredProperty(
     ScoredPropertyName name,
     Value value,
     ParameterRef parameter,
     ImmutableNamedElementCollection <ScoredProperty> scoredProperties,
     ImmutableNamedElementCollection <Property> properties)
 {
     Name              = name;
     Value             = value;
     ParameterRef      = parameter;
     _scoredProperties = scoredProperties;
     _properties       = properties;
 }
コード例 #8
0
ファイル: Property.cs プロジェクト: kei10in/KipSharp
        /// <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();
        }
コード例 #9
0
ファイル: ScoredProperty.cs プロジェクト: kei10in/KipSharp
        /// <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();
        }
コード例 #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();
        }
コード例 #11
0
ファイル: Ticket.cs プロジェクト: kei10in/KipSharp
        /// <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;
        }
コード例 #12
0
ファイル: Feature.cs プロジェクト: kei10in/KipSharp
        /// <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();
        }
コード例 #13
0
ファイル: ParameterDef.cs プロジェクト: kei10in/KipSharp
 internal ParameterDef(ParameterName name, ImmutableNamedElementCollection <Property> properties)
 {
     Name        = name;
     _properties = properties;
 }
コード例 #14
0
 public bool Equals(ImmutableNamedElementCollection <T> rhs)
 {
     return(this == rhs);
 }