From d3d3649a68cb1fa589fdd987a6690dbd5d671f0d Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 17 Sep 2017 15:35:20 -0700 Subject: Initial code commit --- src/WixToolset.Core/Link/ConnectToFeature.cs | 95 ++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 src/WixToolset.Core/Link/ConnectToFeature.cs (limited to 'src/WixToolset.Core/Link/ConnectToFeature.cs') diff --git a/src/WixToolset.Core/Link/ConnectToFeature.cs b/src/WixToolset.Core/Link/ConnectToFeature.cs new file mode 100644 index 00000000..6e046b89 --- /dev/null +++ b/src/WixToolset.Core/Link/ConnectToFeature.cs @@ -0,0 +1,95 @@ +// 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.Specialized; + using WixToolset.Data; + + /// + /// Object that connects things (components/modules) to features. + /// + public sealed class ConnectToFeature + { + private Section section; + private string childId; + + private string primaryFeature; + private bool explicitPrimaryFeature; + private StringCollection connectFeatures; + + /// + /// Creates a new connect to feature. + /// + /// Section this connect belongs to. + /// Id of the child. + public ConnectToFeature(Section section, string childId) : + this(section, childId, null, false) + { + } + + /// + /// Creates a new connect to feature. + /// + /// Section this connect belongs to. + /// Id of the child. + /// Sets the primary feature for the connection. + /// Sets if this is explicit primary. + public ConnectToFeature(Section section, string childId, string primaryFeature, bool explicitPrimaryFeature) + { + this.section = section; + this.childId = childId; + + this.primaryFeature = primaryFeature; + this.explicitPrimaryFeature = explicitPrimaryFeature; + + this.connectFeatures = new StringCollection(); + } + + /// + /// Gets the section. + /// + /// Section. + public Section Section + { + get { return this.section; } + } + + /// + /// Gets the child identifier. + /// + /// The child identifier. + public string ChildId + { + get { return this.childId; } + } + + /// + /// Gets or sets if the flag for if the primary feature was set explicitly. + /// + /// The flag for if the primary feature was set explicitly. + public bool IsExplicitPrimaryFeature + { + get { return this.explicitPrimaryFeature; } + set { this.explicitPrimaryFeature = value; } + } + + /// + /// Gets or sets the primary feature. + /// + /// The primary feature. + public string PrimaryFeature + { + get { return this.primaryFeature; } + set { this.primaryFeature = value; } + } + + /// + /// Gets the features connected to. + /// + /// Features connected to. + public StringCollection ConnectFeatures + { + get { return this.connectFeatures; } + } + } +} -- cgit v1.2.3-55-g6feb