//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.Configuration { using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Text; /// /// Describes an association type and its maximum lifetime as an element /// in a .config file. /// internal class AssociationTypeElement : ConfigurationElement { /// /// The name of the attribute that stores the association type. /// private const string AssociationTypeConfigName = "type"; /// /// The name of the attribute that stores the association's maximum lifetime. /// private const string MaximumLifetimeConfigName = "lifetime"; /// /// Initializes a new instance of the class. /// internal AssociationTypeElement() { } /// /// Gets or sets the protocol name of the association. /// [ConfigurationProperty(AssociationTypeConfigName, IsRequired = true, IsKey = true)] ////[StringValidator(MinLength = 1)] public string AssociationType { get { return (string)this[AssociationTypeConfigName]; } set { this[AssociationTypeConfigName] = value; } } /// /// Gets or sets the maximum time a shared association should live. /// /// The default value is 14 days. [ConfigurationProperty(MaximumLifetimeConfigName, IsRequired = true)] public TimeSpan MaximumLifetime { get { return (TimeSpan)this[MaximumLifetimeConfigName]; } set { this[MaximumLifetimeConfigName] = value; } } } }