November Happy Hour will be moved to Thursday December 5th.

Class AppSettingsOptionsLoader

Loads the options specified in web.config for properties of type PropertyAppSettings and PropertyAppSettingsMultiple.

Inheritance
System.Object
AppSettingsOptionsLoader
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.SpecializedProperties
Assembly: EPiServer.dll
Version: 10.10.4
Syntax
public class AppSettingsOptionsLoader
Examples
   The settings should be defined like this in web.config:
    <appSettings>
<add key="MyProperty" value="label1;value1|label2;value2" />
<add key="AnotherProperty" value="label10;value10|label20;value20" />
</appSettings>

Constructors

AppSettingsOptionsLoader()

Declaration
public AppSettingsOptionsLoader()

Properties

ApplicationPath

Gets the application path.

Declaration
protected virtual string ApplicationPath { get; }
Property Value
Type Description
System.String
Remarks

It gets the path from HttpContext.Current.Request.ApplicationPath.

Methods

GetCashedOptionList(String)

Gets the options for the specified propertyName from the appSettings section in web.config.

Declaration
public virtual IEnumerable<string> GetCashedOptionList(string nameOfProperty)
Parameters
Type Name Description
System.String nameOfProperty
Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

A string with the possible options for this property.

Examples
   The settings should be defined like this in web.config:
    <appSettings>
<add key="MyProperty" value="label1;value1|label2;value2" />
<add key="AnotherProperty" value="label10;value10|label20;value20" />
</appSettings>

TransformOption(String, String)

Transforms an option to a key value pair by splitting on the ';' character.

Declaration
public KeyValuePair<string, string> TransformOption(string optionString, string nameOfProperty)
Parameters
Type Name Description
System.String optionString

The option that will be split.

System.String nameOfProperty

The name of property that the value belongs to.

Returns
Type Description
System.Collections.Generic.KeyValuePair<System.String, System.String>

A key value pair where the first part is the key and the second the value.

Remarks

The value for optionString should look similar to to this: "text1;value1"

Extension Methods