 | ISettingsProcessorPut Method |
Puts an
Object into the settings, uniquely identified by the
group
and
key parameters.
Namespace: Orthogonal.NSettingsAssembly: Orthogonal.NSettings (in Orthogonal.NSettings.dll) Version: 3.0.5
Syntaxvoid Put(
Object group,
Object key,
Object value
)
Parameters
- group Object
-
An object that optionally provides the name of the group in which a setting key/value pair is stored.
The object value is internally converted to a group name by calling its ToString method.
A null group value may be specified which causes the setting to be placed in an unnamed group. Named groups
of settings optionally provide a convenient way of managing large numbers of settings by allowing them to be grouped
by related functionality. Settings with the same key cannot exist in the same group, but the same
key may be used in different groups. The group and key effectively form a compound key.
Do not use multiple group names that differ only by case.
Hint: It is good coding practise to specify the group as an enumerated value or a global string constant.
- key Object
-
An object that provides the name of the key under which a setting value is stored.
The object value is internally converted to a key name by calling its ToString method.
Do not use multiple key names that differ only by case.
Hint: It is good coding practise to specify the key name using the C# or Visual Basic nameof keyword.
- value Object
- The value to be stored in the settings. Supported value types include
all signed and unsigned numeric types, string, string[], byte[] and all types that have a
string TypeConverter associated with them, which includes
Guid, DateTime, TimeSpan and many other commonly used types.
A null value is permitted.
For more information see: NSettings Wiki
RemarksPutting a value with the same group and key as an
existing setting will replace the setting value.
Putting a null value may cause the underlying setting row or object to be physically deleted
in some backing storage implementations. Calling applications need not be aware of this though, as
retrieving a non-existent value behaves the same as retieving a null value.
See Also