using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Tor.Config { /// /// Specifies the associated tor configuration name against an enumerator value. /// [AttributeUsage(AttributeTargets.Field)] internal sealed class ConfigurationAssocAttribute : Attribute { private readonly string name; private object defaultValue; private Type type; private ConfigurationValidation validation; /// /// Initializes a new instance of the class. /// /// The name of the configuration within the tor torrc configuration file. public ConfigurationAssocAttribute(string name) { this.defaultValue = null; this.name = name; this.type = null; this.validation = ConfigurationValidation.None; } #region Properties /// /// Gets or sets the default value of the configuration. /// public object Default { get { return defaultValue; } set { defaultValue = value; } } /// /// Gets the name of the configuration within the tor torrc configuration file. /// public string Name { get { return name; } } /// /// Gets or sets the type of value expected for the configuration. /// public Type Type { get { return type; } set { type = value; } } /// /// Gets or sets the validation to perform against the configuration value. /// public ConfigurationValidation Validation { get { return validation; } set { validation = value; } } #endregion } }