Show / Hide Table of Contents

    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 Source

    PathAttribute(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

    path must contain a valid path or fragment of a path.

    System.ArgumentOutOfRangeException

    usage does not contain a valid value.

    See Also

    System.Attribute
    PathIs
    • Improve this Doc
    • View Source
    Back to top
    Copyright © 2019-2020 Jonathan Evans
    Version: 0.2.232