Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / ProfileSection.cs / 1305376 / 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; /**/ 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]; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // 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; /**/ 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]; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SiteMapPath.cs
- ColorAnimation.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- SqlNodeAnnotation.cs
- PartialCachingAttribute.cs
- ScrollContentPresenter.cs
- RawStylusInputReport.cs
- ObsoleteAttribute.cs
- PrtTicket_Base.cs
- FrameworkElementFactory.cs
- LocatorPart.cs
- RemoteWebConfigurationHostServer.cs
- Pointer.cs
- AppDomainGrammarProxy.cs
- XmlHierarchicalDataSourceView.cs
- BamlBinaryReader.cs
- EUCJPEncoding.cs
- MetabaseServerConfig.cs
- ScriptReferenceBase.cs
- BaseTemplateBuildProvider.cs
- LoginName.cs
- HtmlWindow.cs
- TabControlDesigner.cs
- CanonicalizationDriver.cs
- XPathSelectionIterator.cs
- CompilerGeneratedAttribute.cs
- UpdateCompiler.cs
- WebPartConnectionsCancelEventArgs.cs
- SequentialOutput.cs
- XhtmlBasicListAdapter.cs
- NegationPusher.cs
- ServiceEndpointAssociationProvider.cs
- DelegateSerializationHolder.cs
- DesignerAttribute.cs
- MultipartIdentifier.cs
- SplineKeyFrames.cs
- _DisconnectOverlappedAsyncResult.cs
- XmlSchemaNotation.cs
- PropertyChange.cs
- _FtpControlStream.cs
- X509ServiceCertificateAuthenticationElement.cs
- RtfToken.cs
- StateInitialization.cs
- DataRecordInfo.cs
- VScrollBar.cs
- ScrollContentPresenter.cs
- SqlUtils.cs
- PerformanceCounterPermissionAttribute.cs
- SubstitutionList.cs
- SqlTrackingWorkflowInstance.cs
- TreeNodeEventArgs.cs
- TextMetrics.cs
- ReadOnlyDictionary.cs
- WebPartDeleteVerb.cs
- ImageMap.cs
- TextParagraphCache.cs
- ParameterToken.cs
- BitmapImage.cs
- DataGridViewAdvancedBorderStyle.cs
- IUnknownConstantAttribute.cs
- GenericTransactionFlowAttribute.cs
- DeriveBytes.cs
- DbSetClause.cs
- AQNBuilder.cs
- SamlDelegatingWriter.cs
- PixelShader.cs
- MetadataUtil.cs
- SessionPageStateSection.cs
- BaseDataListPage.cs
- SigningDialog.cs
- XmlSchemaSequence.cs
- ConfigurationSchemaErrors.cs
- WebRequestModuleElementCollection.cs
- XmlSerializer.cs
- WeakHashtable.cs
- HitTestDrawingContextWalker.cs
- RuleRefElement.cs
- DisplayMemberTemplateSelector.cs
- StreamGeometry.cs
- ACL.cs
- UrlAuthorizationModule.cs
- TextRunCache.cs
- CompositeActivityMarkupSerializer.cs
- CommandConverter.cs
- DefaultSerializationProviderAttribute.cs
- DescendentsWalker.cs
- Block.cs
- SettingsPropertyWrongTypeException.cs
- AccessedThroughPropertyAttribute.cs
- HeaderedItemsControl.cs
- NoClickablePointException.cs
- CreateUserWizardStep.cs
- Validator.cs
- TextProperties.cs
- TypeConverterMarkupExtension.cs
- TdsRecordBufferSetter.cs
- Helpers.cs
- TimeIntervalCollection.cs
- MediaCommands.cs
- SqlFunctionAttribute.cs