Method GetFieldValue
- Namespace
- Skyline.DataMiner.Utils.DOM.Extensions
- Assembly
- Skyline.DataMiner.Utils.DOM.dll
GetFieldValue<T>(ISectionContainer, string, string, DomCache)
Gets the value of a field within a section by name.
public static T GetFieldValue<T>(this ISectionContainer container, string sectionName, string fieldName, DomCache cache)
Parameters
container
ISectionContainerThe ISectionContainer instance.
sectionName
stringThe name of the section.
fieldName
stringThe name of the field.
cache
DomCacheThe DomCache instance.
Returns
- T
The value of the specified field in the specified section, or the default value for the type if not found.
Type Parameters
T
The type of the field value.
Exceptions
- ArgumentNullException
Thrown when
container
orcache
is null.- ArgumentException
Thrown when
sectionName
orfieldName
is null or whitespace.