Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / Configuration / RoleManagerSection.cs / 1 / RoleManagerSection.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.Globalization; using System.IO; using System.Text; using System.ComponentModel; using System.Web.Security; // for CookieProtection Enum using System.Security.Permissions; /**/ [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class RoleManagerSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propEnabled = new ConfigurationProperty("enabled", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propUseCookies = new ConfigurationProperty("cacheRolesInCookie", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieName = new ConfigurationProperty("cookieName", typeof(string), ".ASPXROLES", StdValidatorsAndConverters.WhiteSpaceTrimStringConverter, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieTimeout = new ConfigurationProperty("cookieTimeout", typeof(TimeSpan), TimeSpan.FromMinutes(30.0), StdValidatorsAndConverters.TimeSpanMinutesOrInfiniteConverter, StdValidatorsAndConverters.PositiveTimeSpanValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookiePath = new ConfigurationProperty("cookiePath", typeof(string), "/", StdValidatorsAndConverters.WhiteSpaceTrimStringConverter, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieRequireSSL = new ConfigurationProperty("cookieRequireSSL", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieSlidingExpiration = new ConfigurationProperty("cookieSlidingExpiration", typeof(bool), true, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieProtection = new ConfigurationProperty("cookieProtection", typeof(CookieProtection), CookieProtection.All, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propDefaultProvider = new ConfigurationProperty("defaultProvider", typeof(string), "AspNetSqlRoleProvider", null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propProviders = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCreatePersistentCookie = new ConfigurationProperty("createPersistentCookie", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propDomain = new ConfigurationProperty("domain", typeof(string), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propMaxCachedResults = new ConfigurationProperty("maxCachedResults", typeof(int), 25, ConfigurationPropertyOptions.None); private enum InheritedType { inNeither = 0, inParent = 1, inSelf = 2, inBothSame = 3, inBothDiff = 4, } static RoleManagerSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propEnabled); _properties.Add(_propUseCookies); _properties.Add(_propCookieName); _properties.Add(_propCookieTimeout); _properties.Add(_propCookiePath); _properties.Add(_propCookieRequireSSL); _properties.Add(_propCookieSlidingExpiration); _properties.Add(_propCookieProtection); _properties.Add(_propDefaultProvider); _properties.Add(_propProviders); _properties.Add(_propCreatePersistentCookie); _properties.Add(_propDomain); _properties.Add(_propMaxCachedResults); } public RoleManagerSection() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("enabled", DefaultValue = false)] public bool Enabled { get { return (bool)base[_propEnabled]; } set { base[_propEnabled] = value; } } [ConfigurationProperty("createPersistentCookie", DefaultValue = false)] public bool CreatePersistentCookie { get { return (bool)base[_propCreatePersistentCookie]; } set { base[_propCreatePersistentCookie] = value; } } [ConfigurationProperty("cacheRolesInCookie", DefaultValue = false)] public bool CacheRolesInCookie { get { return (bool)base[_propUseCookies]; } set { base[_propUseCookies] = value; } } [ConfigurationProperty("cookieName", DefaultValue = ".ASPXROLES")] [TypeConverter(typeof(WhiteSpaceTrimStringConverter))] [StringValidator(MinLength = 1)] public string CookieName { get { return (string)base[_propCookieName]; } set { base[_propCookieName] = value; } } [ConfigurationProperty("cookieTimeout", DefaultValue = "00:30:00")] [TypeConverter(typeof(TimeSpanMinutesOrInfiniteConverter))] [TimeSpanValidator(MinValueString="00:00:00", MaxValueString=TimeSpanValidatorAttribute.TimeSpanMaxValue)] public TimeSpan CookieTimeout { get { return (TimeSpan)base[_propCookieTimeout]; } set { base[_propCookieTimeout] = value; } } [ConfigurationProperty("cookiePath", DefaultValue = "/")] [TypeConverter(typeof(WhiteSpaceTrimStringConverter))] [StringValidator(MinLength = 1)] public string CookiePath { get { return (string)base[_propCookiePath]; } set { base[_propCookiePath] = value; } } [ConfigurationProperty("cookieRequireSSL", DefaultValue = false)] public bool CookieRequireSSL { get { return (bool)base[_propCookieRequireSSL]; } set { base[_propCookieRequireSSL] = value; } } [ConfigurationProperty("cookieSlidingExpiration", DefaultValue = true)] public bool CookieSlidingExpiration { get { return (bool)base[_propCookieSlidingExpiration]; } set { base[_propCookieSlidingExpiration] = value; } } [ConfigurationProperty("cookieProtection", DefaultValue = CookieProtection.All)] public CookieProtection CookieProtection { get { return (CookieProtection)base[_propCookieProtection]; } set { base[_propCookieProtection] = value; } } [ConfigurationProperty("defaultProvider", DefaultValue = "AspNetSqlRoleProvider")] [TypeConverter(typeof(WhiteSpaceTrimStringConverter))] [StringValidator(MinLength = 1)] public string DefaultProvider { get { return (string)base[_propDefaultProvider]; } set { base[_propDefaultProvider] = value; } } [ConfigurationProperty("providers")] public ProviderSettingsCollection Providers { get { return (ProviderSettingsCollection)base[_propProviders]; } } [ConfigurationProperty("domain")] public string Domain { get { return (string)base[_propDomain]; } set { base[_propDomain] = value; } } [ConfigurationProperty("maxCachedResults", DefaultValue = 25)] public int MaxCachedResults { get { return (int)base[_propMaxCachedResults]; } set { base[_propMaxCachedResults] = value; } } } // class RoleManagerSection } // 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.Globalization; using System.IO; using System.Text; using System.ComponentModel; using System.Web.Security; // for CookieProtection Enum using System.Security.Permissions; /**/ [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class RoleManagerSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propEnabled = new ConfigurationProperty("enabled", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propUseCookies = new ConfigurationProperty("cacheRolesInCookie", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieName = new ConfigurationProperty("cookieName", typeof(string), ".ASPXROLES", StdValidatorsAndConverters.WhiteSpaceTrimStringConverter, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieTimeout = new ConfigurationProperty("cookieTimeout", typeof(TimeSpan), TimeSpan.FromMinutes(30.0), StdValidatorsAndConverters.TimeSpanMinutesOrInfiniteConverter, StdValidatorsAndConverters.PositiveTimeSpanValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookiePath = new ConfigurationProperty("cookiePath", typeof(string), "/", StdValidatorsAndConverters.WhiteSpaceTrimStringConverter, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieRequireSSL = new ConfigurationProperty("cookieRequireSSL", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieSlidingExpiration = new ConfigurationProperty("cookieSlidingExpiration", typeof(bool), true, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCookieProtection = new ConfigurationProperty("cookieProtection", typeof(CookieProtection), CookieProtection.All, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propDefaultProvider = new ConfigurationProperty("defaultProvider", typeof(string), "AspNetSqlRoleProvider", null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propProviders = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propCreatePersistentCookie = new ConfigurationProperty("createPersistentCookie", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propDomain = new ConfigurationProperty("domain", typeof(string), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propMaxCachedResults = new ConfigurationProperty("maxCachedResults", typeof(int), 25, ConfigurationPropertyOptions.None); private enum InheritedType { inNeither = 0, inParent = 1, inSelf = 2, inBothSame = 3, inBothDiff = 4, } static RoleManagerSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propEnabled); _properties.Add(_propUseCookies); _properties.Add(_propCookieName); _properties.Add(_propCookieTimeout); _properties.Add(_propCookiePath); _properties.Add(_propCookieRequireSSL); _properties.Add(_propCookieSlidingExpiration); _properties.Add(_propCookieProtection); _properties.Add(_propDefaultProvider); _properties.Add(_propProviders); _properties.Add(_propCreatePersistentCookie); _properties.Add(_propDomain); _properties.Add(_propMaxCachedResults); } public RoleManagerSection() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("enabled", DefaultValue = false)] public bool Enabled { get { return (bool)base[_propEnabled]; } set { base[_propEnabled] = value; } } [ConfigurationProperty("createPersistentCookie", DefaultValue = false)] public bool CreatePersistentCookie { get { return (bool)base[_propCreatePersistentCookie]; } set { base[_propCreatePersistentCookie] = value; } } [ConfigurationProperty("cacheRolesInCookie", DefaultValue = false)] public bool CacheRolesInCookie { get { return (bool)base[_propUseCookies]; } set { base[_propUseCookies] = value; } } [ConfigurationProperty("cookieName", DefaultValue = ".ASPXROLES")] [TypeConverter(typeof(WhiteSpaceTrimStringConverter))] [StringValidator(MinLength = 1)] public string CookieName { get { return (string)base[_propCookieName]; } set { base[_propCookieName] = value; } } [ConfigurationProperty("cookieTimeout", DefaultValue = "00:30:00")] [TypeConverter(typeof(TimeSpanMinutesOrInfiniteConverter))] [TimeSpanValidator(MinValueString="00:00:00", MaxValueString=TimeSpanValidatorAttribute.TimeSpanMaxValue)] public TimeSpan CookieTimeout { get { return (TimeSpan)base[_propCookieTimeout]; } set { base[_propCookieTimeout] = value; } } [ConfigurationProperty("cookiePath", DefaultValue = "/")] [TypeConverter(typeof(WhiteSpaceTrimStringConverter))] [StringValidator(MinLength = 1)] public string CookiePath { get { return (string)base[_propCookiePath]; } set { base[_propCookiePath] = value; } } [ConfigurationProperty("cookieRequireSSL", DefaultValue = false)] public bool CookieRequireSSL { get { return (bool)base[_propCookieRequireSSL]; } set { base[_propCookieRequireSSL] = value; } } [ConfigurationProperty("cookieSlidingExpiration", DefaultValue = true)] public bool CookieSlidingExpiration { get { return (bool)base[_propCookieSlidingExpiration]; } set { base[_propCookieSlidingExpiration] = value; } } [ConfigurationProperty("cookieProtection", DefaultValue = CookieProtection.All)] public CookieProtection CookieProtection { get { return (CookieProtection)base[_propCookieProtection]; } set { base[_propCookieProtection] = value; } } [ConfigurationProperty("defaultProvider", DefaultValue = "AspNetSqlRoleProvider")] [TypeConverter(typeof(WhiteSpaceTrimStringConverter))] [StringValidator(MinLength = 1)] public string DefaultProvider { get { return (string)base[_propDefaultProvider]; } set { base[_propDefaultProvider] = value; } } [ConfigurationProperty("providers")] public ProviderSettingsCollection Providers { get { return (ProviderSettingsCollection)base[_propProviders]; } } [ConfigurationProperty("domain")] public string Domain { get { return (string)base[_propDomain]; } set { base[_propDomain] = value; } } [ConfigurationProperty("maxCachedResults", DefaultValue = 25)] public int MaxCachedResults { get { return (int)base[_propMaxCachedResults]; } set { base[_propMaxCachedResults] = value; } } } // class RoleManagerSection } // 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
- SingleTagSectionHandler.cs
- BmpBitmapDecoder.cs
- ObjectQuery.cs
- CalculatedColumn.cs
- FillRuleValidation.cs
- ECDiffieHellmanCngPublicKey.cs
- OperatorExpressions.cs
- SoapParser.cs
- PageFunction.cs
- ObjectItemNoOpAssemblyLoader.cs
- Subtree.cs
- RuntimeHandles.cs
- WindowsPen.cs
- Formatter.cs
- MessageQueueTransaction.cs
- BaseServiceProvider.cs
- ComponentGlyph.cs
- BamlStream.cs
- TextBoxAutomationPeer.cs
- AlphaSortedEnumConverter.cs
- UseLicense.cs
- ExtensionDataReader.cs
- autovalidator.cs
- _AutoWebProxyScriptWrapper.cs
- ConstraintStruct.cs
- DesignerDeviceConfig.cs
- WizardForm.cs
- CompModSwitches.cs
- Matrix.cs
- Registration.cs
- SettingsPropertyCollection.cs
- ColumnCollection.cs
- NativeMethodsCLR.cs
- QuaternionValueSerializer.cs
- WindowsFormsSectionHandler.cs
- updatecommandorderer.cs
- PixelShader.cs
- EmptyQuery.cs
- ViewGenerator.cs
- SupportingTokenParameters.cs
- ViewStateModeByIdAttribute.cs
- ChangeConflicts.cs
- ThreadInterruptedException.cs
- ButtonRenderer.cs
- CultureSpecificCharacterBufferRange.cs
- MimeTypeAttribute.cs
- JsonSerializer.cs
- AutomationIdentifierGuids.cs
- PathBox.cs
- UserControlParser.cs
- CryptoConfig.cs
- HyperLinkDataBindingHandler.cs
- FunctionImportElement.cs
- XmlAttributes.cs
- QueryBranchOp.cs
- ContextMenuStripGroup.cs
- ClickablePoint.cs
- UpdateRecord.cs
- AppDomain.cs
- ResourceManager.cs
- XPathNavigator.cs
- MD5CryptoServiceProvider.cs
- SiteMembershipCondition.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- CounterSampleCalculator.cs
- WebPartConnectionsCancelEventArgs.cs
- QueryResults.cs
- XmlHierarchicalDataSourceView.cs
- ConstraintConverter.cs
- activationcontext.cs
- DataList.cs
- CapabilitiesAssignment.cs
- XmlNamespaceMappingCollection.cs
- SqlPersonalizationProvider.cs
- ToolStripArrowRenderEventArgs.cs
- CrossContextChannel.cs
- CompilationSection.cs
- BaseConfigurationRecord.cs
- XmlRootAttribute.cs
- SessionPageStatePersister.cs
- ImportFileRequest.cs
- OleDbCommandBuilder.cs
- XamlVector3DCollectionSerializer.cs
- ForeignKeyFactory.cs
- WebPartConnectionsDisconnectVerb.cs
- PeerObject.cs
- brushes.cs
- ArrayWithOffset.cs
- EntityDataSourceSelectedEventArgs.cs
- SafeHandles.cs
- SmtpFailedRecipientsException.cs
- SiteMapHierarchicalDataSourceView.cs
- TextChange.cs
- CounterCreationDataCollection.cs
- OciLobLocator.cs
- CommonBehaviorsSection.cs
- FixedTextContainer.cs
- TreePrinter.cs
- TreeBuilder.cs
- BuilderInfo.cs