Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Configuration / WebPartsPersonalization.cs / 1 / 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
- CryptoApi.cs
- StringUtil.cs
- OdbcStatementHandle.cs
- _PooledStream.cs
- ScaleTransform3D.cs
- Lease.cs
- LayoutExceptionEventArgs.cs
- InvokeProviderWrapper.cs
- Addressing.cs
- DataGridViewButtonColumn.cs
- _NegoState.cs
- PenContext.cs
- CultureInfoConverter.cs
- ZoomPercentageConverter.cs
- ScrollChrome.cs
- CharEntityEncoderFallback.cs
- CodeTypeReference.cs
- AttributeData.cs
- BodyWriter.cs
- EventManager.cs
- FlowDocumentPage.cs
- ListViewCommandEventArgs.cs
- SchemaNamespaceManager.cs
- XmlWriterTraceListener.cs
- MinimizableAttributeTypeConverter.cs
- TextRangeSerialization.cs
- XmlEnumAttribute.cs
- UnsafeNetInfoNativeMethods.cs
- DPAPIProtectedConfigurationProvider.cs
- ImageInfo.cs
- DataGridViewCellConverter.cs
- Set.cs
- SelectorItemAutomationPeer.cs
- TreeNodeEventArgs.cs
- CatalogPartChrome.cs
- PathBox.cs
- SortFieldComparer.cs
- ButtonChrome.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- Input.cs
- SspiWrapper.cs
- DataGridViewSelectedCellCollection.cs
- DesignerDataTableBase.cs
- UnsafeNetInfoNativeMethods.cs
- Matrix3DStack.cs
- MobileContainerDesigner.cs
- TdsParserHelperClasses.cs
- PluggableProtocol.cs
- GroupItemAutomationPeer.cs
- TypeForwardedToAttribute.cs
- TrackingStringDictionary.cs
- SQLStringStorage.cs
- recordstatescratchpad.cs
- MultipartIdentifier.cs
- sitestring.cs
- PropertyCollection.cs
- DataGridDesigner.cs
- EdmScalarPropertyAttribute.cs
- NativeWindow.cs
- ObjectReaderCompiler.cs
- UpDownBase.cs
- HttpStreamMessage.cs
- DbFunctionCommandTree.cs
- AllMembershipCondition.cs
- base64Transforms.cs
- CompressStream.cs
- PersistNameAttribute.cs
- DeobfuscatingStream.cs
- TextureBrush.cs
- Common.cs
- TreeNodeCollection.cs
- RTLAwareMessageBox.cs
- Function.cs
- MenuEventArgs.cs
- ClientScriptManagerWrapper.cs
- CodeCatchClause.cs
- TrustLevelCollection.cs
- TogglePattern.cs
- OutputCacheSection.cs
- EditorAttribute.cs
- ChtmlTextBoxAdapter.cs
- DataServiceKeyAttribute.cs
- CodeExporter.cs
- ScriptControlDescriptor.cs
- ToolStripSystemRenderer.cs
- TaskHelper.cs
- SineEase.cs
- FunctionDetailsReader.cs
- StoreItemCollection.cs
- SafeNativeMethodsOther.cs
- XmlWellformedWriterHelpers.cs
- ToolBarTray.cs
- OleDbError.cs
- HwndSubclass.cs
- SpeechSeg.cs
- PolygonHotSpot.cs
- StorageScalarPropertyMapping.cs
- GuidelineCollection.cs
- FolderBrowserDialogDesigner.cs
- WebPartAddingEventArgs.cs