Class PathAttribute
Defines an attribute used to indicate the path to the configuration value(s) underlying a class or individual property.
Inheritance
System.Object
System.Attribute
PathAttribute
Namespace: OpenCollar.Extensions.Configuration
Assembly: OpenCollar.Extensions.Configuration.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)]
public sealed class PathAttribute : Attribute
Remarks
The usage
and path
arguments of the constructor can be used to determine whether this
property is read from a path relative to the parent or from an absolute path.
The following UML has been generated directly from the source code using Jebbs PlantUML .
Examples
In the following example the attribute is used to define a path that is always absolute.
[Path(PathIs.Absolute, "ConfigurationStrings:Database")]
string DatabaseConnectionString
{
get; set;
}
Constructors
| Improve this Doc View SourcePathAttribute(PathIs, String)
Initializes a new instance of the PathAttribute class.
Declaration
public PathAttribute(PathIs usage, string path)
Parameters
Type | Name | Description |
---|---|---|
PathIs | usage | The usage. |
System.String | path | The path. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
See Also
System.Attribute