Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Configuration / WebPartsPersonalization.cs / 5 / WebPartsPersonalization.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Configuration; using System.Collections; using System.Collections.Specialized; using System.Security.Principal; using System.Web; using System.Web.Compilation; using System.Web.Configuration; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.Util; using System.Xml; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class WebPartsPersonalization : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propDefaultProvider = new ConfigurationProperty( "defaultProvider", typeof( string ), "AspNetSqlPersonalizationProvider", null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None ); private static readonly ConfigurationProperty _propProviders = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propAuthorization = new ConfigurationProperty("authorization", typeof(WebPartsPersonalizationAuthorization), null, ConfigurationPropertyOptions.None); static WebPartsPersonalization() { _properties = new ConfigurationPropertyCollection(); _properties.Add(_propDefaultProvider); _properties.Add(_propProviders); _properties.Add(_propAuthorization); } public WebPartsPersonalization() { } [ConfigurationProperty("authorization")] public WebPartsPersonalizationAuthorization Authorization { get { return (WebPartsPersonalizationAuthorization)base[_propAuthorization]; } } [ConfigurationProperty("defaultProvider", DefaultValue = "AspNetSqlPersonalizationProvider")] [StringValidator(MinLength = 1)] public string DefaultProvider { get { return (string)base[_propDefaultProvider]; } set { base[_propDefaultProvider] = value; } } ///protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("providers")] public ProviderSettingsCollection Providers { get { return (ProviderSettingsCollection)base[_propProviders]; } } internal void ValidateAuthorization() { foreach (AuthorizationRule rule in Authorization.Rules) { StringCollection verbs = rule.Verbs; if (verbs.Count == 0) { throw new ConfigurationErrorsException( SR.GetString(SR.WebPartsSection_NoVerbs), rule.ElementInformation.Properties["verbs"].Source, rule.ElementInformation.Properties["verbs"].LineNumber); } foreach (string verb in verbs) { if (verb != "enterSharedScope" && verb != "modifyState") { throw new ConfigurationErrorsException( SR.GetString(SR.WebPartsSection_InvalidVerb, verb), rule.ElementInformation.Properties["verbs"].Source, rule.ElementInformation.Properties["verbs"].LineNumber); } } } } } } // 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.Configuration; using System.Collections; using System.Collections.Specialized; using System.Security.Principal; using System.Web; using System.Web.Compilation; using System.Web.Configuration; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.Util; using System.Xml; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class WebPartsPersonalization : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propDefaultProvider = new ConfigurationProperty( "defaultProvider", typeof( string ), "AspNetSqlPersonalizationProvider", null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.None ); private static readonly ConfigurationProperty _propProviders = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propAuthorization = new ConfigurationProperty("authorization", typeof(WebPartsPersonalizationAuthorization), null, ConfigurationPropertyOptions.None); static WebPartsPersonalization() { _properties = new ConfigurationPropertyCollection(); _properties.Add(_propDefaultProvider); _properties.Add(_propProviders); _properties.Add(_propAuthorization); } public WebPartsPersonalization() { } [ConfigurationProperty("authorization")] public WebPartsPersonalizationAuthorization Authorization { get { return (WebPartsPersonalizationAuthorization)base[_propAuthorization]; } } [ConfigurationProperty("defaultProvider", DefaultValue = "AspNetSqlPersonalizationProvider")] [StringValidator(MinLength = 1)] public string DefaultProvider { get { return (string)base[_propDefaultProvider]; } set { base[_propDefaultProvider] = value; } } ///protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("providers")] public ProviderSettingsCollection Providers { get { return (ProviderSettingsCollection)base[_propProviders]; } } internal void ValidateAuthorization() { foreach (AuthorizationRule rule in Authorization.Rules) { StringCollection verbs = rule.Verbs; if (verbs.Count == 0) { throw new ConfigurationErrorsException( SR.GetString(SR.WebPartsSection_NoVerbs), rule.ElementInformation.Properties["verbs"].Source, rule.ElementInformation.Properties["verbs"].LineNumber); } foreach (string verb in verbs) { if (verb != "enterSharedScope" && verb != "modifyState") { throw new ConfigurationErrorsException( SR.GetString(SR.WebPartsSection_InvalidVerb, verb), rule.ElementInformation.Properties["verbs"].Source, rule.ElementInformation.Properties["verbs"].LineNumber); } } } } } } // 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
- CapacityStreamGeometryContext.cs
- AccessViolationException.cs
- XmlWhitespace.cs
- BamlLocalizableResource.cs
- MatchAllMessageFilter.cs
- DesignerVerb.cs
- Mouse.cs
- IRCollection.cs
- StringHandle.cs
- TextPenaltyModule.cs
- SecondaryViewProvider.cs
- SaveFileDialogDesigner.cs
- DataGridTableCollection.cs
- CategoryGridEntry.cs
- DataGridLengthConverter.cs
- XhtmlConformanceSection.cs
- EntitySetBaseCollection.cs
- VisualBasicSettingsHandler.cs
- EqualityComparer.cs
- _HeaderInfo.cs
- XPathNavigatorKeyComparer.cs
- IndentedTextWriter.cs
- DataObjectPastingEventArgs.cs
- TabControl.cs
- MemberMaps.cs
- _ScatterGatherBuffers.cs
- PageClientProxyGenerator.cs
- AbstractDataSvcMapFileLoader.cs
- BlockCollection.cs
- InstanceCollisionException.cs
- SessionStateContainer.cs
- CommunicationObjectAbortedException.cs
- CompareInfo.cs
- StringToken.cs
- FontConverter.cs
- SQLRoleProvider.cs
- AuthenticationModuleElement.cs
- SelectionEditor.cs
- _AuthenticationState.cs
- DrawingVisualDrawingContext.cs
- CorePropertiesFilter.cs
- ManipulationPivot.cs
- ComponentChangingEvent.cs
- BitStack.cs
- SmtpCommands.cs
- ToolStripSeparator.cs
- MatrixTransform3D.cs
- ClassData.cs
- SystemTcpConnection.cs
- PopupRoot.cs
- ImageListUtils.cs
- FunctionDefinition.cs
- XmlSchemaExternal.cs
- Parser.cs
- ContentType.cs
- LocalClientSecuritySettingsElement.cs
- ConfigurationSectionHelper.cs
- PrintSystemException.cs
- CodeCatchClause.cs
- Schedule.cs
- ToolBar.cs
- TextProperties.cs
- InputChannelBinder.cs
- HashFinalRequest.cs
- SerializableReadOnlyDictionary.cs
- CompletionProxy.cs
- ActionItem.cs
- smtppermission.cs
- ScalarConstant.cs
- XamlReader.cs
- ProfessionalColors.cs
- EntityParameter.cs
- TextElement.cs
- DesignerCategoryAttribute.cs
- DefaultValueTypeConverter.cs
- EntityContainerRelationshipSetEnd.cs
- DataPager.cs
- RoleManagerSection.cs
- UseManagedPresentationBindingElementImporter.cs
- TextServicesDisplayAttribute.cs
- XmlSerializerSection.cs
- FixedSOMFixedBlock.cs
- TrackingLocationCollection.cs
- QueryOperationResponseOfT.cs
- AccessViolationException.cs
- MatrixStack.cs
- DiagnosticsConfiguration.cs
- AdornedElementPlaceholder.cs
- RawStylusActions.cs
- SetterBaseCollection.cs
- RawStylusInputReport.cs
- GenericTypeParameterConverter.cs
- CustomExpression.cs
- Evaluator.cs
- Rule.cs
- SingleKeyFrameCollection.cs
- HttpHandlersSection.cs
- EncryptedKey.cs
- CookieHandler.cs
- DelegateHelpers.cs