Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / WebPartsPersonalization.cs / 1305376 / 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; 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; 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
- OleDbStruct.cs
- ToolStripSettings.cs
- COM2Enum.cs
- XmlNullResolver.cs
- OrthographicCamera.cs
- OletxEnlistment.cs
- InputDevice.cs
- FtpCachePolicyElement.cs
- XmlSchemaSimpleTypeRestriction.cs
- SystemIPInterfaceProperties.cs
- ButtonChrome.cs
- _LocalDataStoreMgr.cs
- Misc.cs
- TemplatePagerField.cs
- SqlCaseSimplifier.cs
- basenumberconverter.cs
- XmlReaderDelegator.cs
- ObservableDictionary.cs
- sortedlist.cs
- ColorContext.cs
- HwndHost.cs
- ThousandthOfEmRealPoints.cs
- TriggerAction.cs
- XPathAncestorIterator.cs
- LocatorManager.cs
- Debugger.cs
- documentation.cs
- ProxyWebPartConnectionCollection.cs
- ScrollBarRenderer.cs
- PlainXmlSerializer.cs
- XamlPointCollectionSerializer.cs
- QuaternionAnimation.cs
- DbParameterCollectionHelper.cs
- RepeatBehaviorConverter.cs
- GraphicsPath.cs
- PartitionedDataSource.cs
- Int32Storage.cs
- XmlUrlResolver.cs
- UserMapPath.cs
- ToolboxComponentsCreatingEventArgs.cs
- util.cs
- MessageDecoder.cs
- ApplicationContext.cs
- Rotation3DKeyFrameCollection.cs
- GraphicsState.cs
- FontDifferentiator.cs
- TextEditorSpelling.cs
- ServiceElement.cs
- Pair.cs
- AlgoModule.cs
- WithStatement.cs
- DocumentApplicationJournalEntry.cs
- BinaryNode.cs
- CornerRadius.cs
- EventLogger.cs
- Frame.cs
- EntityCommandExecutionException.cs
- DataIdProcessor.cs
- SdlChannelSink.cs
- XmlSchemaType.cs
- ProcessModelSection.cs
- GlyphInfoList.cs
- ScaleTransform3D.cs
- FocusWithinProperty.cs
- Pair.cs
- dataobject.cs
- HttpModuleAction.cs
- BinHexDecoder.cs
- __ConsoleStream.cs
- XmlSchemaFacet.cs
- ISessionStateStore.cs
- PathGeometry.cs
- AnnotationDocumentPaginator.cs
- ImageMapEventArgs.cs
- SafeFileMappingHandle.cs
- Matrix.cs
- BaseProcessProtocolHandler.cs
- Byte.cs
- MenuAdapter.cs
- Subset.cs
- ConstructorNeedsTagAttribute.cs
- RadioButton.cs
- TextServicesProperty.cs
- MetadataItemCollectionFactory.cs
- Grid.cs
- KeyboardDevice.cs
- NullableConverter.cs
- StringFormat.cs
- TabControl.cs
- SQLInt64.cs
- WorkflowDispatchContext.cs
- XmlElementList.cs
- Encoder.cs
- CodePageUtils.cs
- PropertyEmitterBase.cs
- AdPostCacheSubstitution.cs
- ConnectorRouter.cs
- StringValidatorAttribute.cs
- AutomationProperties.cs
- DataGridColumn.cs