Class FeatureSet<T>
Generic version of FeatureSet where the generic type is the type of the feature.
Inherited Members
Namespace: Unity.Industrial.Forma.Core.Variants
Syntax
public class FeatureSet<T> : FeatureSet, ISerializationCallbackReceiver where T : Feature
Type Parameters
| Name | Description | 
|---|---|
| T | 
Fields
m_DefaultFeature
The default feature
Declaration
protected T m_DefaultFeature
Field Value
| Type | Description | 
|---|---|
| T | 
m_FeatureForCode
The feature for code
Declaration
protected Dictionary<string, T> m_FeatureForCode
Field Value
| Type | Description | 
|---|---|
| Dictionary<String, T> | 
m_Features
The features
Declaration
protected List<T> m_Features
Field Value
| Type | Description | 
|---|---|
| List<T> | 
m_SelectedFeature
The selected feature
Declaration
protected T m_SelectedFeature
Field Value
| Type | Description | 
|---|---|
| T | 
Properties
codes
Read-only collection of codes of the features in this set.
Declaration
public override IReadOnlyList<string> codes { get; }
Property Value
| Type | Description | 
|---|---|
| IReadOnlyList<String> | The codes.  | 
Overrides
defaultFeature
Gets the default feature.
Declaration
public T defaultFeature { get; }
Property Value
| Type | Description | 
|---|---|
| T | The default feature.  | 
featureForCode
Mapping from codes to features (read-only).
Declaration
public IReadOnlyDictionary<string, T> featureForCode { get; }
Property Value
| Type | Description | 
|---|---|
| IReadOnlyDictionary<String, T> | The feature for code.  | 
features
List of features in this feature set (read-only).
Declaration
public IReadOnlyList<T> features { get; }
Property Value
| Type | Description | 
|---|---|
| IReadOnlyList<T> | The features.  | 
selectedFeature
Currently selected feature.
Declaration
public T selectedFeature { get; }
Property Value
| Type | Description | 
|---|---|
| T | The selected feature.  | 
Remarks
Use SelectFeature(T) for selecting a feature.
variantTable
Variant table containing this feature set.
Declaration
public VariantTable variantTable { get; }
Property Value
| Type | Description | 
|---|---|
| VariantTable | The variant table.  | 
Methods
AddFeature(String)
Adds a new feature of the given code to the feature set.
Declaration
public virtual T AddFeature(string featureCode)
Parameters
| Type | Name | Description | 
|---|---|---|
| String | featureCode | The feature code.  | 
Returns
| Type | Description | 
|---|---|
| T | T.  | 
Remarks
Throws 
code is
null or only whitespaces, or if there is already a variant of the given
code in the set.
DeselectFeature()
Deselects the feature.
Declaration
public override void DeselectFeature()
Overrides
featureIndexOf(Feature)
Index of feature in this feature set
Declaration
public override int featureIndexOf(Feature feature)
Parameters
| Type | Name | Description | 
|---|---|---|
| Feature | feature | The feature.  | 
Returns
| Type | Description | 
|---|---|
| Int32 | System.Int32.  | 
Overrides
GetFeatures()
Gets the features.
Declaration
protected override IReadOnlyList<Feature> GetFeatures()
Returns
| Type | Description | 
|---|---|
| IReadOnlyList<Feature> | IReadOnlyList<Feature>.  | 
Overrides
GetSelectedFeature()
Gets the selected feature.
Declaration
protected override Feature GetSelectedFeature()
Returns
| Type | Description | 
|---|---|
| Feature | Feature.  | 
Overrides
HandleFeatureCodeChange(Object, FeatureCodeChangedEventArgs)
Handles the feature code change.
Declaration
protected void HandleFeatureCodeChange(object sender, FeatureCodeChangedEventArgs args)
Parameters
| Type | Name | Description | 
|---|---|---|
| Object | sender | The sender.  | 
| FeatureCodeChangedEventArgs | args | The FeatureCodeChangedEventArgs instance containing the event data.  | 
HasFeature(Feature)
Determines whether the specified feature has feature.
Declaration
public bool HasFeature(Feature feature)
Parameters
| Type | Name | Description | 
|---|---|---|
| Feature | feature | The feature.  | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
  | 
MoveFeature(T, Int32)
Move the feature to index of the feature set
Declaration
public void MoveFeature(T feature, int index)
Parameters
| Type | Name | Description | 
|---|---|---|
| T | feature | The feature.  | 
| Int32 | index | The index.  | 
Remarks
Throws an 
OnDisable()
Called when [disable].
Declaration
protected void OnDisable()
OnEnable()
Called when [enable].
Declaration
protected void OnEnable()
RemoveFeature(T)
Removes the feature from the feature set (along with its assignments).
Declaration
public void RemoveFeature(T feature)
Parameters
| Type | Name | Description | 
|---|---|---|
| T | feature | The feature.  | 
Remarks
Throws an 
RemoveFeature(String)
Removes the feature of the given code from the feature set (along with its assignments).
Declaration
public void RemoveFeature(string featureCode)
Parameters
| Type | Name | Description | 
|---|---|---|
| String | featureCode | The feature code.  | 
Remarks
Throws an 
ResetSelection()
Selects the first feature in the feature set.
Declaration
public override void ResetSelection()
Overrides
SelectFeature(T)
Selects the passed feature, deselecting the previous feature.
Declaration
public void SelectFeature(T feature)
Parameters
| Type | Name | Description | 
|---|---|---|
| T | feature | The feature.  | 
Remarks
Throws an 
null or not in the feature set.SelectFeatureInternal(T)
Selects the feature internal.
Declaration
public void SelectFeatureInternal(T feature)
Parameters
| Type | Name | Description | 
|---|---|---|
| T | feature | The feature.  | 
SetDefaultFeature()
Sets the default feature.
Declaration
public void SetDefaultFeature()