Exemple #1
0
 void ThrowIfSubFeatureAlradyAdded(ISubFeature subFeature)
 {
     if (_subFeatures.Contains(subFeature))
     {
         throw new SubFeatureAlreadyAddedToFeature(this, subFeature);
     }
 }
Exemple #2
0
 /// <inheritdoc/>
 public void AddSubFeature(ISubFeature subFeature)
 {
     ThrowIfSubFeatureAlradyAdded(subFeature);
     _subFeatures.Add(subFeature);
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="SubFeatureAlreadyAddedToFeature"/>
 /// </summary>
 /// <param name="feature"><see cref="IFeature">Feature</see> the sub feature is already added to</param>
 /// <param name="subFeature"><see cref="ISubFeature">Sub feature</see> that is already added</param>
 public SubFeatureAlreadyAddedToFeature(IFeature feature, ISubFeature subFeature) : base($"Feature '{subFeature.Name}' has already been added to the feature '{subFeature.Name}'")
 {
 }