Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Configuration / ProfileSection.cs / 3 / ProfileSection.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.Web.Util; using System.Security.Permissions; /**/ [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class ProfileSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propEnabled = new ConfigurationProperty("enabled", typeof(bool), true, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propDefaultProvider = new ConfigurationProperty("defaultProvider", typeof(string), "AspNetSqlProfileProvider", null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propProviders = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propProfile = new ConfigurationProperty("properties", typeof(RootProfilePropertySettingsCollection), null, ConfigurationPropertyOptions.IsDefaultCollection); private static readonly ConfigurationProperty _propInherits = new ConfigurationProperty("inherits", typeof(string), String.Empty, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propAutomaticSaveEnabled = new ConfigurationProperty("automaticSaveEnabled", typeof(bool), true, ConfigurationPropertyOptions.None); static ProfileSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propEnabled); _properties.Add(_propDefaultProvider); _properties.Add(_propProviders); _properties.Add(_propProfile); _properties.Add(_propInherits); _properties.Add(_propAutomaticSaveEnabled); } private long _recompilationHash; private bool _recompilationHashCached; internal long RecompilationHash { get { if (!_recompilationHashCached) { _recompilationHash = CalculateHash(); _recompilationHashCached = true; } return _recompilationHash; } } private long CalculateHash() { HashCodeCombiner hashCombiner = new HashCodeCombiner(); CalculateProfilePropertySettingsHash(PropertySettings, hashCombiner); if (PropertySettings != null) { foreach (ProfileGroupSettings pgs in PropertySettings.GroupSettings) { hashCombiner.AddObject(pgs.Name); CalculateProfilePropertySettingsHash(pgs.PropertySettings, hashCombiner); } } return hashCombiner.CombinedHash; } private void CalculateProfilePropertySettingsHash( ProfilePropertySettingsCollection settings, HashCodeCombiner hashCombiner) { foreach (ProfilePropertySettings pps in settings) { hashCombiner.AddObject(pps.Name); hashCombiner.AddObject(pps.Type); } } public ProfileSection() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("automaticSaveEnabled", DefaultValue = true)] public bool AutomaticSaveEnabled { get { return (bool)base[_propAutomaticSaveEnabled]; } set { base[_propAutomaticSaveEnabled] = value; } } [ConfigurationProperty("enabled", DefaultValue = true)] public bool Enabled { get { return (bool)base[_propEnabled]; } set { base[_propEnabled] = value; } } [ConfigurationProperty("defaultProvider", DefaultValue = "AspNetSqlProfileProvider")] [StringValidator(MinLength = 1)] public string DefaultProvider { get { return (string)base[_propDefaultProvider]; } set { base[_propDefaultProvider] = value; } } [ConfigurationProperty("inherits", DefaultValue = "")] public string Inherits { get { return (string)base[_propInherits]; } set { base[_propInherits] = value; } } [ConfigurationProperty("providers")] public ProviderSettingsCollection Providers { get { return (ProviderSettingsCollection)base[_propProviders]; } } // not exposed to the API [ConfigurationProperty("properties")] public RootProfilePropertySettingsCollection PropertySettings { get { return (RootProfilePropertySettingsCollection)base[_propProfile]; } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataSpaceManager.cs
- SoapObjectWriter.cs
- DataExpression.cs
- BamlTreeUpdater.cs
- PreDigestedSignedInfo.cs
- CryptoProvider.cs
- WsdlInspector.cs
- ExtensibleClassFactory.cs
- GifBitmapDecoder.cs
- _CommandStream.cs
- Imaging.cs
- ChangeBlockUndoRecord.cs
- IgnoreDeviceFilterElementCollection.cs
- Resources.Designer.cs
- ResourceProviderFactory.cs
- CompilerScope.cs
- RequestResizeEvent.cs
- LinkButton.cs
- DataGridViewCellPaintingEventArgs.cs
- TaskFormBase.cs
- MouseWheelEventArgs.cs
- UrlMappingsModule.cs
- RadioButtonBaseAdapter.cs
- WriteableBitmap.cs
- HttpModule.cs
- CodeTypeDelegate.cs
- CrossContextChannel.cs
- TypedTableBaseExtensions.cs
- FormViewDeleteEventArgs.cs
- ObjectViewFactory.cs
- MarkedHighlightComponent.cs
- RightsManagementManager.cs
- PositiveTimeSpanValidatorAttribute.cs
- HwndHost.cs
- TypeDescriptionProvider.cs
- PointKeyFrameCollection.cs
- CompressionTransform.cs
- SafeHandles.cs
- ChildTable.cs
- ListControl.cs
- ButtonBaseDesigner.cs
- XsltConvert.cs
- FieldToken.cs
- PerspectiveCamera.cs
- EntityProxyTypeInfo.cs
- ServiceDiscoveryBehavior.cs
- QilInvokeEarlyBound.cs
- ObjectAssociationEndMapping.cs
- TextSchema.cs
- ActivityUtilities.cs
- XmlValidatingReaderImpl.cs
- OletxTransactionFormatter.cs
- CollectionEditVerbManager.cs
- VirtualPathProvider.cs
- MeshGeometry3D.cs
- designeractionlistschangedeventargs.cs
- RuleSettings.cs
- HtmlToClrEventProxy.cs
- LinearQuaternionKeyFrame.cs
- Content.cs
- OdbcConnection.cs
- AssociationType.cs
- BufferedGraphics.cs
- WindowsRebar.cs
- BitmapMetadataBlob.cs
- ComponentManagerBroker.cs
- BaseWebProxyFinder.cs
- basenumberconverter.cs
- ResourceExpression.cs
- RegexFCD.cs
- DocumentViewerAutomationPeer.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- SystemIcmpV6Statistics.cs
- LongValidator.cs
- XPathDocumentIterator.cs
- Frame.cs
- DataGridCellClipboardEventArgs.cs
- SiblingIterators.cs
- ZipQueryOperator.cs
- Binding.cs
- DateTimePickerDesigner.cs
- File.cs
- NullableLongSumAggregationOperator.cs
- VisualTarget.cs
- CodePageUtils.cs
- RulePatternOps.cs
- SmtpAuthenticationManager.cs
- AdapterDictionary.cs
- WeakEventManager.cs
- Vector3DCollectionConverter.cs
- VSWCFServiceContractGenerator.cs
- PageThemeParser.cs
- MenuCommandsChangedEventArgs.cs
- RootBuilder.cs
- StreamSecurityUpgradeProvider.cs
- SkewTransform.cs
- StickyNoteHelper.cs
- ProjectionCamera.cs
- ArrangedElement.cs
- ToolBarButtonClickEvent.cs