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
- Rectangle.cs
- ImportedPolicyConversionContext.cs
- SelectionProcessor.cs
- DataServiceProviderWrapper.cs
- Win32.cs
- HandlerWithFactory.cs
- OleDbError.cs
- CancelEventArgs.cs
- XmlSchemaParticle.cs
- ContextDataSourceView.cs
- ConditionalDesigner.cs
- InProcStateClientManager.cs
- HashHelper.cs
- ComponentManagerBroker.cs
- FlowLayoutPanel.cs
- WpfKnownMember.cs
- RemotingConfiguration.cs
- NoClickablePointException.cs
- Wizard.cs
- XmlObjectSerializerReadContextComplex.cs
- ChtmlSelectionListAdapter.cs
- NamedPipeConnectionPoolSettingsElement.cs
- Blend.cs
- formatter.cs
- xamlnodes.cs
- TypeSystemHelpers.cs
- ConfigurationSectionGroupCollection.cs
- SpeechEvent.cs
- WorkflowOwnerAsyncResult.cs
- PrinterSettings.cs
- XmlIlVisitor.cs
- XhtmlBasicTextViewAdapter.cs
- GroupDescription.cs
- BinaryObjectInfo.cs
- RadioButtonFlatAdapter.cs
- HttpsTransportBindingElement.cs
- TabPage.cs
- XmlSerializerAssemblyAttribute.cs
- StorageMappingFragment.cs
- RSACryptoServiceProvider.cs
- WebPartMinimizeVerb.cs
- Gdiplus.cs
- DataService.cs
- ImportCatalogPart.cs
- GeneralTransformCollection.cs
- OdbcStatementHandle.cs
- DisplayInformation.cs
- TextSelectionHelper.cs
- DbProviderConfigurationHandler.cs
- WpfXamlLoader.cs
- basenumberconverter.cs
- BindUriHelper.cs
- EntityRecordInfo.cs
- SqlPersonalizationProvider.cs
- RectAnimationBase.cs
- Rectangle.cs
- ContextDataSourceContextData.cs
- PageRanges.cs
- DocumentOrderComparer.cs
- TraceLevelStore.cs
- TagElement.cs
- HtmlInputSubmit.cs
- ProtocolsSection.cs
- HotCommands.cs
- DPCustomTypeDescriptor.cs
- NonSerializedAttribute.cs
- TreeViewHitTestInfo.cs
- XmlValidatingReaderImpl.cs
- PropertiesTab.cs
- SqlDataSourceEnumerator.cs
- SystemFonts.cs
- OdbcDataAdapter.cs
- TreeNodeCollection.cs
- ServiceDescription.cs
- SubclassTypeValidator.cs
- WrappingXamlSchemaContext.cs
- SchemaManager.cs
- IconBitmapDecoder.cs
- controlskin.cs
- OleDbReferenceCollection.cs
- Monitor.cs
- BitmapMetadataBlob.cs
- ConsoleEntryPoint.cs
- HtmlHead.cs
- MessageQueuePermissionAttribute.cs
- StringBuilder.cs
- RelationHandler.cs
- DispatcherFrame.cs
- MobileControlDesigner.cs
- RandomNumberGenerator.cs
- AQNBuilder.cs
- FileChangesMonitor.cs
- CollectionBuilder.cs
- BuildProvider.cs
- SqlFunctions.cs
- AnchorEditor.cs
- SuppressMessageAttribute.cs
- EventProvider.cs
- TextSimpleMarkerProperties.cs
- HttpApplication.cs