Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / WebPartsPersonalization.cs / 2 / 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. //------------------------------------------------------------------------------ // // 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MappingSource.cs
- ScrollEvent.cs
- LifetimeMonitor.cs
- TableLayoutPanel.cs
- CanonicalXml.cs
- MediaContextNotificationWindow.cs
- NativeRecognizer.cs
- XmlEnumAttribute.cs
- SingleKeyFrameCollection.cs
- CompositeKey.cs
- UnitySerializationHolder.cs
- DataGrid.cs
- StructuralCache.cs
- GridLengthConverter.cs
- KeyTime.cs
- EdmSchemaAttribute.cs
- DateRangeEvent.cs
- embossbitmapeffect.cs
- Transform3DGroup.cs
- XmlReflectionMember.cs
- RemoteWebConfigurationHostServer.cs
- ButtonFlatAdapter.cs
- CannotUnloadAppDomainException.cs
- VectorAnimationBase.cs
- TypeHelper.cs
- wgx_render.cs
- HttpCapabilitiesBase.cs
- NullableDecimalSumAggregationOperator.cs
- XmlHierarchicalDataSourceView.cs
- ServerIdentity.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- BitmapEffectState.cs
- nulltextnavigator.cs
- RouteItem.cs
- AutomationTextAttribute.cs
- TaskExtensions.cs
- LostFocusEventManager.cs
- ModuleBuilder.cs
- TypeDescriptionProviderAttribute.cs
- MarkupProperty.cs
- Convert.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- ProfileWorkflowElement.cs
- XmlIlVisitor.cs
- HostSecurityManager.cs
- HttpProfileBase.cs
- CodeArrayIndexerExpression.cs
- MsmqInputChannel.cs
- HandoffBehavior.cs
- RowCache.cs
- ListDictionary.cs
- XmlUtil.cs
- HyperLinkDataBindingHandler.cs
- BinaryCommonClasses.cs
- MemoryStream.cs
- ClientSideProviderDescription.cs
- ConsumerConnectionPoint.cs
- FullTextState.cs
- MsmqIntegrationProcessProtocolHandler.cs
- ShadowGlyph.cs
- StylusEventArgs.cs
- DaylightTime.cs
- ConnectionOrientedTransportElement.cs
- pingexception.cs
- WindowsContainer.cs
- ValidationHelpers.cs
- InputBinder.cs
- SimpleLine.cs
- AnnotationResource.cs
- CodeTypeParameterCollection.cs
- WebEvents.cs
- Contracts.cs
- Configuration.cs
- DataSetMappper.cs
- EventSinkActivityDesigner.cs
- DefaultSerializationProviderAttribute.cs
- ModelPropertyImpl.cs
- SolidBrush.cs
- PropertyReferenceSerializer.cs
- TypeResolvingOptions.cs
- CodeArgumentReferenceExpression.cs
- PictureBox.cs
- SchemaImporterExtension.cs
- MessageQueuePermissionAttribute.cs
- ISAPIApplicationHost.cs
- ContextMenuStripActionList.cs
- MimeFormReflector.cs
- ReversePositionQuery.cs
- BufferBuilder.cs
- TypeGeneratedEventArgs.cs
- HtmlAnchor.cs
- PeerDefaultCustomResolverClient.cs
- GridViewPageEventArgs.cs
- DataGridViewDataConnection.cs
- Size3DValueSerializer.cs
- HwndPanningFeedback.cs
- SingleConverter.cs
- ALinqExpressionVisitor.cs
- SerializerWriterEventHandlers.cs
- SQLDateTimeStorage.cs