// TODO remove the feature loaded method and make this virtual again? => only if loading becomes again because of sub features // setup a feature using patching internal void SetupFeature() { Loaded = FeatureUtils.Setup(this); if (Loaded) { SetupFeatureLoaded(); } }
public bool IsFunctionalityOptional(Functionality functionality, IEnumerable <Feature> supportedFeatures) { bool optional = true; FunctionalityItem item = _profileFunctionalities.FirstOrDefault(F => F.Functionality == functionality); if (item != null && item.Features != null) { optional = false; foreach (Feature feature in item.Features) { ProfileFeature f = _features.FirstOrDefault(F => F.Feature == feature); if (f != null) { //[19.07.2013] AKS: //Suppose we have profile with mandatory functionality AorB, //i.e. either A or B should be supported. //Suppose functionality F require feature A. //There are two cases when feature A is not supported: //1. AorB is supported but A is not supported(i.e. only feature B is supported) => functionality F should be colored as absent and optional //2. AorB is not supported => functionality F should be colored as absent and mandatory if (ProfileFeatureState.Mandatory == f.State && FeatureUtils.IsCompoundFeature(feature)) { optional = supportedFeatures.ContainsFeature(feature); break; } else if (f.State == ProfileFeatureState.Optional) { optional = true; break; } } } } return(optional); }