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
- TextSelectionHighlightLayer.cs
- Selector.cs
- ApplicationId.cs
- complextypematerializer.cs
- MenuItemStyle.cs
- ZoomingMessageFilter.cs
- SkewTransform.cs
- MouseActionConverter.cs
- ActivityBuilderHelper.cs
- FeatureSupport.cs
- GenericEnumerator.cs
- HtmlElementCollection.cs
- WebServiceHostFactory.cs
- SHA512Managed.cs
- PrintController.cs
- ExclusiveCanonicalizationTransform.cs
- User.cs
- PerfService.cs
- TimeSpan.cs
- ProfileModule.cs
- DefaultAsyncDataDispatcher.cs
- UpdateDelegates.Generated.cs
- FilterFactory.cs
- OdbcFactory.cs
- InputScopeManager.cs
- LineBreak.cs
- WinFormsSpinner.cs
- SpotLight.cs
- TriState.cs
- NamespaceCollection.cs
- DataGridViewColumnEventArgs.cs
- _UriSyntax.cs
- RawStylusInputReport.cs
- TextTreeUndo.cs
- TypefaceCollection.cs
- StatusStrip.cs
- PerformanceCounterPermissionAttribute.cs
- ResourceCategoryAttribute.cs
- ClientOperationFormatterProvider.cs
- HttpPostLocalhostServerProtocol.cs
- SortAction.cs
- BufferedOutputStream.cs
- ColumnWidthChangingEvent.cs
- InternalUserCancelledException.cs
- SmiConnection.cs
- XdrBuilder.cs
- dataobject.cs
- UnicodeEncoding.cs
- ListContractAdapter.cs
- StaticResourceExtension.cs
- ZeroOpNode.cs
- OleDbDataAdapter.cs
- DataObjectCopyingEventArgs.cs
- StylusButtonEventArgs.cs
- CheckBoxField.cs
- EventSourceCreationData.cs
- DataSourceXmlSerializationAttribute.cs
- LightweightEntityWrapper.cs
- Simplifier.cs
- LinqDataSourceContextEventArgs.cs
- EmptyEnumerator.cs
- SynchronizationContext.cs
- ToolStripRenderEventArgs.cs
- VectorCollectionConverter.cs
- InputLanguageProfileNotifySink.cs
- WizardPanel.cs
- ResourcePermissionBase.cs
- CompilationLock.cs
- HtmlTextArea.cs
- _ListenerResponseStream.cs
- HostSecurityManager.cs
- UpdateCommand.cs
- Constants.cs
- codemethodreferenceexpression.cs
- FixedSOMTextRun.cs
- compensatingcollection.cs
- WebControlsSection.cs
- NominalTypeEliminator.cs
- HashCodeCombiner.cs
- AnimationClock.cs
- SizeChangedInfo.cs
- EncodingTable.cs
- BitmapEditor.cs
- SizeAnimationUsingKeyFrames.cs
- ColorTransform.cs
- ConnectionPool.cs
- PrtCap_Public_Simple.cs
- XmlSiteMapProvider.cs
- KnowledgeBase.cs
- PolyLineSegmentFigureLogic.cs
- InputBinding.cs
- PaperSource.cs
- AccessDataSourceView.cs
- TrackingServices.cs
- ForeignConstraint.cs
- SqlCacheDependency.cs
- mediaeventshelper.cs
- StringCollection.cs
- DataServiceResponse.cs
- IFlowDocumentViewer.cs