Class SettingsDictionary

A collection of settings used for adding configuration aspects for children of containers. Inherit to create implementations matching specific containers to declare the necessy settings.

Inheritance
System.Object
SettingsDictionary
Implements
System.Collections.Generic.IDictionary<System.String, System.Object>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, System.Object>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Object>>
System.Collections.IEnumerable
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.Shell.ViewComposition
Assembly: EPiServer.Shell.dll
Version: 10.10.4
Syntax
public class SettingsDictionary : ISettingsDictionary, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable

Constructors

SettingsDictionary()

Declaration
public SettingsDictionary()

Properties

Count

Gets the number of elements contained in this dictionary.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

IsReadOnly

Gets a value indicating whether this instance is read only.

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

true if this instance is read only; otherwise, false.

Item[String]

Gets or sets the System.Object with the specified key.

Declaration
public object this[string key] { get; set; }
Parameters
Type Name Description
System.String key
Property Value
Type Description
System.Object

Keys

Gets the keys in the dictionary.

Declaration
public ICollection<string> Keys { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<System.String>

Values

Gets a collection containing the values in the dictionary.

Declaration
public ICollection<object> Values { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<System.Object>

Methods

Add(Setting)

Adds the specified Setting object containing persistance information. Will override any previous setting with the same key.

Declaration
public void Add(Setting setting)
Parameters
Type Name Description
Setting setting

The setting object to add.

Add(KeyValuePair<String, Object>)

Adds the specified key and value to the dictionary.

Declaration
public void Add(KeyValuePair<string, object> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<System.String, System.Object> item

The KeyValuePair to add

Remarks

The value will not be persisted.

Add(String, Object)

Adds the specified key and value to the dictionary.

Declaration
public void Add(string key, object value)
Parameters
Type Name Description
System.String key

The key.

System.Object value

The value.

Remarks

The value will not be persisted.

AddSettings(IDictionary<String, Object>, Boolean)

Adds the settings specified in

values

to the settings collection.

Declaration
public void AddSettings(IDictionary<string, object> values, bool personalizable)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.String, System.Object> values

The values.

System.Boolean personalizable

if the settings should be personalizable.

Clear()

Remove all elements from the dictionary.

Declaration
public void Clear()

Contains(KeyValuePair<String, Object>)

Determines whether this dictionary contains the specified key value combination.

Declaration
public bool Contains(KeyValuePair<string, object> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<System.String, System.Object> item

The KeyValuePair to test.

Returns
Type Description
System.Boolean

true if the dictionary contains the specified KeyValuePair; otherwise, false.

ContainsKey(String)

Determines whether the specified key exists in the dictionary.

Declaration
public bool ContainsKey(string key)
Parameters
Type Name Description
System.String key

Name of the key.

Returns
Type Description
System.Boolean

true if the dictionary contains the key; otherwise, false.

Copy()

Creates a deep copy of the settings dictionary.

Declaration
public ISettingsDictionary Copy()
Returns
Type Description
ISettingsDictionary

A new settings dictionary with the same values as this object.

CopyTo(KeyValuePair<String, Object>[], Int32)

Copies the elements of the collection to an array, starting at a particular array index.

Declaration
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<System.String, System.Object>[] array

The array which the elements are copied to.

System.Int32 arrayIndex

The zero-based index in the array at which copying begins.

GetEnumerator()

Gets the enumerator for iterating thhrough the collection.

Declaration
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, System.Object>>

GetPersonalizableSettings()

Gets the settings that can be personalized.

Declaration
public IDictionary<string, object> GetPersonalizableSettings()
Returns
Type Description
System.Collections.Generic.IDictionary<System.String, System.Object>

An System.Collections.IDictionary with the settings that can be personalized.

MergeRange(Setting[])

Adds a range of Setting objects.

Declaration
public void MergeRange(Setting[] settings)
Parameters
Type Name Description
Setting[] settings

The settings.

Remove(KeyValuePair<String, Object>)

Removes the specified item from the collection.

Declaration
public bool Remove(KeyValuePair<string, object> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<System.String, System.Object> item

The item to remove.

Returns
Type Description
System.Boolean

true if the item was found and successfully removed; otherwise false.

Remove(String)

Removes the value with the specified key from the dictionary.

Declaration
public bool Remove(string key)
Parameters
Type Name Description
System.String key

Name of the key to remove.

Returns
Type Description
System.Boolean

true if the element is successfully found and removed; otherwise, false.

TryGetValue(String, out Object)

Gets the value associated with the specified key.

Declaration
public bool TryGetValue(string key, out object value)
Parameters
Type Name Description
System.String key

The key of the value to get.

System.Object value

Contains the value associated with the specified key if the key exists in the dictionary.

Returns
Type Description
System.Boolean

true if the dictionary contains an element with the specified key; otherwise, false.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

An System.Collections.IEnumerator object that can be used to iterate through the collection.

Implements

System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods