// 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; }
}
}
}