public Feature Create(string name, ILocalizableString displayName = null, bool isDisabled = false,
            ILocalizableString description = null, FeatureScopes scope = FeatureScopes.All)
        {
            if (Features.ContainsKey(name))
            {
                throw new AbpException("There is already a feature with name: " + name);
            }

            var feature = new Feature(name, displayName, isDisabled, description, scope);
            Features[feature.Name] = feature;
            return feature;

        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a child feature.
 /// </summary>
 /// <returns>Returns newly created child feature</returns>
 public Feature CreateChildFeature(string name, string defaultValue, ILocalizableString displayName = null, ILocalizableString description = null, FeatureScopes scope = FeatureScopes.All, IInputType inputType = null)
 {
     var feature = new Feature(name, defaultValue, displayName, description, scope, inputType) { Parent = this };
     _children.Add(feature);
     return feature;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a child feature.
 /// A child feature can be enabled only if parent is enabled.
 /// </summary>
 /// <returns>Returns newly created child feature</returns>
 public Feature CreateChildFeature(string name, ILocalizableString displayName = null, bool isDisabled = false, ILocalizableString description = null, FeatureScopes scope = FeatureScopes.All)
 {
     var feature = new Feature(name, displayName, isDisabled, description, scope) { Parent = this };
     _children.Add(feature);
     return feature;
 }
 public Task<string> GetValueOrNullAsync(int tenantId, Feature feature)
 {
     return Task.FromResult((string) null);
 }