Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Configuration / SiteMapSection.cs / 2 / SiteMapSection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; using System.Security.Permissions; /**/ [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class SiteMapSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propDefaultProvider = new ConfigurationProperty("defaultProvider", typeof(string), "AspNetXmlSiteMapProvider", null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propEnabled = new ConfigurationProperty("enabled", typeof(bool), true, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propProviders = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection), null, ConfigurationPropertyOptions.None); private SiteMapProviderCollection _siteMapProviders; static SiteMapSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propDefaultProvider); _properties.Add(_propEnabled); _properties.Add(_propProviders); } public SiteMapSection() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("defaultProvider", DefaultValue = "AspNetXmlSiteMapProvider")] [StringValidator(MinLength = 1)] public string DefaultProvider { get { return (string)base[_propDefaultProvider]; } set { base[_propDefaultProvider] = value; } } [ConfigurationProperty("enabled", DefaultValue = true)] public bool Enabled { get { return (bool)base[_propEnabled]; } set { base[_propEnabled] = value; } } [ConfigurationProperty("providers")] public ProviderSettingsCollection Providers { get { return (ProviderSettingsCollection)base[_propProviders]; } } internal SiteMapProviderCollection ProvidersInternal { get { if (_siteMapProviders == null) { lock (this) { if (_siteMapProviders == null) { SiteMapProviderCollection siteMapProviders = new SiteMapProviderCollection(); ProvidersHelper.InstantiateProviders(Providers, siteMapProviders, typeof(SiteMapProvider)); _siteMapProviders = siteMapProviders; } } } return _siteMapProviders; } } internal void ValidateDefaultProvider() { if (!String.IsNullOrEmpty(DefaultProvider)) // make sure the specified provider has a provider entry in the collection { if (Providers[DefaultProvider] == null) { throw new ConfigurationErrorsException( SR.GetString(SR.Config_provider_must_exist, DefaultProvider), ElementInformation.Properties[_propDefaultProvider.Name].Source, ElementInformation.Properties[_propDefaultProvider.Name].LineNumber); } } } } // class SiteMapSection }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BitmapCodecInfo.cs
- DomainUpDown.cs
- NodeCounter.cs
- RelationshipManager.cs
- CqlParser.cs
- ObjectHandle.cs
- BaseCodeDomTreeGenerator.cs
- DateTimeParse.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- TdsParserStateObject.cs
- BaseTreeIterator.cs
- ListBox.cs
- VariableBinder.cs
- figurelength.cs
- X509Chain.cs
- WindowsImpersonationContext.cs
- UnionCodeGroup.cs
- WebServiceEnumData.cs
- DataGridViewImageCell.cs
- ReaderContextStackData.cs
- X509UI.cs
- PrimaryKeyTypeConverter.cs
- DocComment.cs
- DesignerAutoFormat.cs
- ToolboxControl.cs
- ErrorInfoXmlDocument.cs
- CodeBinaryOperatorExpression.cs
- UniqueConstraint.cs
- GroupDescription.cs
- DataPagerCommandEventArgs.cs
- SqlDataSourceEnumerator.cs
- DateTimePicker.cs
- OutputCacheSettingsSection.cs
- HighlightVisual.cs
- Helpers.cs
- HighlightComponent.cs
- MetadataProperty.cs
- FormsIdentity.cs
- FlagPanel.cs
- DataConnectionHelper.cs
- DataGridViewLayoutData.cs
- DataMember.cs
- CompilerScope.Storage.cs
- Condition.cs
- CryptoApi.cs
- SecurityKeyType.cs
- HostedNamedPipeTransportManager.cs
- ClientTargetSection.cs
- StoreContentChangedEventArgs.cs
- BitFlagsGenerator.cs
- StyleHelper.cs
- AuthenticationSection.cs
- XmlCDATASection.cs
- DeobfuscatingStream.cs
- TreeNode.cs
- TypeUnloadedException.cs
- FileDataSourceCache.cs
- XpsFixedDocumentReaderWriter.cs
- Lease.cs
- processwaithandle.cs
- XmlSchemaGroup.cs
- filewebresponse.cs
- XamlReader.cs
- Token.cs
- SingleBodyParameterMessageFormatter.cs
- HttpResponse.cs
- assertwrapper.cs
- EntityDataSourceContextDisposingEventArgs.cs
- RequiredAttributeAttribute.cs
- ParenthesizePropertyNameAttribute.cs
- ObjectIDGenerator.cs
- ErrorInfoXmlDocument.cs
- CollectionViewGroup.cs
- PlaceHolder.cs
- CombinedGeometry.cs
- MouseDevice.cs
- GeneratedView.cs
- XmlDesignerDataSourceView.cs
- TrustLevelCollection.cs
- GifBitmapDecoder.cs
- TypeAccessException.cs
- SyndicationSerializer.cs
- NodeLabelEditEvent.cs
- CurrentChangingEventManager.cs
- CallbackHandler.cs
- StorageConditionPropertyMapping.cs
- XDRSchema.cs
- SizeChangedEventArgs.cs
- WebPartMenu.cs
- CookielessHelper.cs
- Quack.cs
- ChannelPool.cs
- unsafenativemethodsother.cs
- PbrsForward.cs
- ObjectPersistData.cs
- VerifyHashRequest.cs
- SharedPerformanceCounter.cs
- nulltextnavigator.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- QueueProcessor.cs