aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Link/ConnectToFeature.cs
blob: bc85426a9683cde473f59b4d72f83231dbeb3cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Link
{
    using System.Collections.Generic;
    using WixToolset.Data;

    /// <summary>
    /// Object that connects things (components/modules) to features.
    /// </summary>
    public sealed class ConnectToFeature
    {
        /// <summary>
        /// Creates a new connect to feature.
        /// </summary>
        /// <param name="section">Section this connect belongs to.</param>
        /// <param name="childId">Id of the child.</param>
        public ConnectToFeature(IntermediateSection section, string childId) :
            this(section, childId, null, false)
        {
        }

        /// <summary>
        /// Creates a new connect to feature.
        /// </summary>
        /// <param name="section">Section this connect belongs to.</param>
        /// <param name="childId">Id of the child.</param>
        /// <param name="primaryFeature">Sets the primary feature for the connection.</param>
        /// <param name="explicitPrimaryFeature">Sets if this is explicit primary.</param>
        public ConnectToFeature(IntermediateSection section, string childId, string primaryFeature, bool explicitPrimaryFeature)
        {
            this.Section = section;
            this.ChildId = childId;

            this.PrimaryFeature = primaryFeature;
            this.IsExplicitPrimaryFeature = explicitPrimaryFeature;
        }

        /// <summary>
        /// Gets the section.
        /// </summary>
        /// <value>Section.</value>
        public IntermediateSection Section { get; }

        /// <summary>
        /// Gets the child identifier.
        /// </summary>
        /// <value>The child identifier.</value>
        public string ChildId { get; }

        /// <summary>
        /// Gets or sets if the flag for if the primary feature was set explicitly.
        /// </summary>
        /// <value>The flag for if the primary feature was set explicitly.</value>
        public bool IsExplicitPrimaryFeature { get; set; }

        /// <summary>
        /// Gets or sets the primary feature.
        /// </summary>
        /// <value>The primary feature.</value>
        public string PrimaryFeature { get; set; }

        /// <summary>
        /// Gets the features connected to.
        /// </summary>
        /// <value>Features connected to.</value>
        public List<string> ConnectFeatures { get; } = new List<string>();
    }
}