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;

        }
Example #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;
 }
Example #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;
 }
Example #4
0
 /// <inheritdoc/>
 public string GetValueOrNull(long tenantId, Feature feature)
 {
     return((string)null);
 }
Example #5
0
 /// <inheritdoc/>
 public Task <string> GetValueOrNullAsync(long tenantId, Feature feature)
 {
     return(Task.FromResult((string)null));
 }
 /// <inheritdoc/>
 public virtual Task <string> GetValueOrNullAsync(int tenantId, Feature feature)
 {
     return(GetValueOrNullAsync(tenantId, feature.Name));
 }
 public Task<string> GetValueOrNullAsync(int tenantId, Feature feature)
 {
     return Task.FromResult((string) null);
 }