using System; using Umbraco.Web.WebApi; namespace Umbraco.Web.Features { /// /// Represents the Umbraco features. /// public class UmbracoFeatures { /// /// Initializes a new instance of the class. /// public UmbracoFeatures() { Disabled = new DisabledFeatures(); Enabled = new EnabledFeatures(); } /// /// Gets the disabled features. /// internal DisabledFeatures Disabled { get; } /// /// Gets the enabled features. /// internal EnabledFeatures Enabled { get; } /// /// Determines whether a controller is enabled. /// internal bool IsControllerEnabled(Type feature) { if (typeof(UmbracoApiControllerBase).IsAssignableFrom(feature)) return Disabled.Controllers.Contains(feature) == false; throw new NotSupportedException("Not a supported feature type."); } } }