Show / Hide Table of Contents

Class FeatureDefinition

Inheritance
System.Object
FeatureDefinition
Namespace: Volo.Abp.Features
Assembly: Volo.Abp.Features.dll
Syntax
public class FeatureDefinition : object

Constructors

FeatureDefinition(String, String, ILocalizableString, ILocalizableString, IStringValueType, Boolean)

Declaration
public FeatureDefinition(string name, string defaultValue = null, ILocalizableString displayName = null, ILocalizableString description = null, IStringValueType valueType = null, bool isVisibleToClients = true)
Parameters
Type Name Description
System.String name
System.String defaultValue
ILocalizableString displayName
ILocalizableString description
IStringValueType valueType
System.Boolean isVisibleToClients

Properties

AllowedProviders

A list of allowed providers to get/set value of this feature. An empty list indicates that all providers are allowed.

Declaration
public List<string> AllowedProviders { get; }
Property Value
Type Description
List<System.String>

Children

List of child features.

Declaration
public IReadOnlyList<FeatureDefinition> Children { get; }
Property Value
Type Description
IReadOnlyList<FeatureDefinition>

DefaultValue

Default value of the feature.

Declaration
public string DefaultValue { get; set; }
Property Value
Type Description
System.String

Description

Declaration
public ILocalizableString Description { get; set; }
Property Value
Type Description
ILocalizableString

DisplayName

Declaration
public ILocalizableString DisplayName { get; set; }
Property Value
Type Description
ILocalizableString

IsVisibleToClients

Can clients see this feature and it's value. Default: true.

Declaration
public bool IsVisibleToClients { get; set; }
Property Value
Type Description
System.Boolean

Item[String]

Gets/sets a key-value on the Properties.

Declaration
public object this[string name] { get; set; }
Parameters
Type Name Description
System.String name

Name of the property

Property Value
Type Description
System.Object

Returns the value in the Properties dictionary by given . Returns null if given is not present in the Properties dictionary.

Name

Unique name of the feature.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Parent

Parent of this feature, if one exists. If set, this feature can be enabled only if the parent is enabled.

Declaration
public FeatureDefinition Parent { get; }
Property Value
Type Description
FeatureDefinition

Properties

Can be used to get/set custom properties for this feature.

Declaration
public Dictionary<string, object> Properties { get; }
Property Value
Type Description
Dictionary<System.String, System.Object>

ValueType

Input type. This can be used to prepare an input for changing this feature's value. Default: ToggleStringValueType.

Declaration
public IStringValueType ValueType { get; set; }
Property Value
Type Description
IStringValueType

Methods

CreateChild(String, String, ILocalizableString, ILocalizableString, IStringValueType, Boolean)

Adds a child feature.

Declaration
public FeatureDefinition CreateChild(string name, string defaultValue = null, ILocalizableString displayName = null, ILocalizableString description = null, IStringValueType valueType = null, bool isVisibleToClients = true)
Parameters
Type Name Description
System.String name
System.String defaultValue
ILocalizableString displayName
ILocalizableString description
IStringValueType valueType
System.Boolean isVisibleToClients
Returns
Type Description
FeatureDefinition

Returns a newly created child feature

RemoveChild(String)

Declaration
public void RemoveChild(string name)
Parameters
Type Name Description
System.String name

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

WithProperty(String, Object)

Sets a property in the Properties dictionary. This is a shortcut for nested calls on this object.

Declaration
public virtual FeatureDefinition WithProperty(string key, object value)
Parameters
Type Name Description
System.String key
System.Object value
Returns
Type Description
FeatureDefinition

WithProviders(String[])

Sets a property in the Properties dictionary. This is a shortcut for nested calls on this object.

Declaration
public virtual FeatureDefinition WithProviders(params string[] providers)
Parameters
Type Name Description
System.String[] providers
Returns
Type Description
FeatureDefinition

Extension Methods

AbpObjectExtensions.As<T>(Object)
AbpObjectExtensions.To<T>(Object)
AbpObjectExtensions.IsIn<T>(T, T[])
AbpObjectExtensions.If<T>(T, Boolean, Func<T, T>)
AbpObjectExtensions.If<T>(T, Boolean, Action<T>)
LockExtensions.Locking(Object, Action)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<TResult>(Object, Func<TResult>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
Back to top Powered by Volosoft