private List <string> GetEnabledFeatures(params FeatureCategory[] features) { if (features == null) { throw new ArgumentNullException("Parameter features should not be null."); } List <string> list = new List <string>(); list.Add("*"); foreach (object obj in ((IEnumerable)this.Schema)) { FeatureDefinition featureDefinition = (FeatureDefinition)obj; if (featureDefinition.Type.Equals(typeof(bool)) && (bool)this[featureDefinition]) { if (featureDefinition.Categories.Any((FeatureCategory x) => features.Contains(x))) { list.Add(featureDefinition.Name); } } } return(list); }
internal List <ValidationError> ValidateFeaturesAllowedForSKU() { List <ValidationError> list = new List <ValidationError>(); ServicePlanSkus servicePlanSkus; if (Datacenter.IsPartnerHostedOnly(false)) { servicePlanSkus = ServicePlanSkus.Hosted; } else { servicePlanSkus = ServicePlanSkus.Datacenter; } foreach (object obj in this.propertyBag.Keys) { FeatureDefinition featureDefinition = (FeatureDefinition)obj; if ((byte)(featureDefinition.ServicePlanSkus & servicePlanSkus) == 0) { list.Add(new ServicePlanFeaturesValidationError(featureDefinition.Name, servicePlanSkus.ToString())); } } return(list); }
private static bool FeaturesChanged(ServicePlan deltaServicePlan, FeatureCategory featureCategory) { foreach (object obj in ((IEnumerable)deltaServicePlan.Organization.Schema)) { FeatureDefinition featureDefinition = (FeatureDefinition)obj; if (featureDefinition.Categories.Contains(featureCategory) && deltaServicePlan.Organization.PropertyBag.IsModified(featureDefinition)) { return(true); } } for (int i = 0; i < deltaServicePlan.MailboxPlans.Count; i++) { foreach (object obj2 in ((IEnumerable)deltaServicePlan.MailboxPlans[i].Schema)) { FeatureDefinition featureDefinition2 = (FeatureDefinition)obj2; if (featureDefinition2.Categories.Contains(featureCategory) && deltaServicePlan.MailboxPlans[i].PropertyBag.IsModified(featureDefinition2)) { return(true); } } } return(false); }