//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------ using System.Configuration; using System.IdentityModel.Tokens; namespace System.IdentityModel.Configuration { /// /// Class the represents system.identityModel section in the configuration file /// public sealed partial class SystemIdentityModelSection : ConfigurationSection { /// /// The name of the configuration section defined by Windows Identity Foundation. /// public const string SectionName = ConfigurationStrings.SystemIdentityModel; /// /// Returns the current reference /// public static SystemIdentityModelSection Current { get { return ConfigurationManager.GetSection( SectionName ) as SystemIdentityModelSection; } } /// /// Returns the unnamed reference from the configuration file /// public static IdentityConfigurationElement DefaultIdentityConfigurationElement { get { SystemIdentityModelSection section = SystemIdentityModelSection.Current; return ( section != null ) ? section.IdentityConfigurationElements.GetElement( ConfigurationStrings.DefaultServiceName ) : null; } } /// /// Returns collection /// [ConfigurationProperty( ConfigurationStrings.DefaultCollectionName, Options = ConfigurationPropertyOptions.IsDefaultCollection )] public IdentityConfigurationElementCollection IdentityConfigurationElements { get { return (IdentityConfigurationElementCollection)this[ConfigurationStrings.DefaultCollectionName]; } } /// /// Returns a value indicating whether this element has been configured with non-default values. /// internal bool IsConfigured { get { return IdentityConfigurationElements.IsConfigured; } } } }