/// <summary> /// Creates a new feature. /// </summary> /// <param name="name">Unique name of the feature</param> /// <param name="defaultValue">Default value</param> /// <param name="displayName">Display name of the feature</param> /// <param name="description">A brief description for this feature</param> /// <param name="scope">Feature scope</param> /// <param name="inputType">Input type</param> public Feature Create(string name, string defaultValue, ILocalizableString displayName = null, ILocalizableString description = null, FeatureScopes scope = FeatureScopes.All, IInputType inputType = null) { if (Features.ContainsKey(name)) { throw new OwException("There is already a feature with name: " + name); } var feature = new Feature(name, defaultValue, displayName, description, scope, inputType); Features[feature.Name] = feature; return feature; }
/// <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; }
/// <inheritdoc/> public Task<string> GetValueOrNullAsync(int tenantId, Feature feature) { return Task.FromResult((string) null); }