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
- SqlClientWrapperSmiStream.cs
- HttpWebResponse.cs
- SHA512.cs
- VerificationException.cs
- CanExpandCollapseAllConverter.cs
- DataPagerFieldItem.cs
- SchemaImporterExtensionElementCollection.cs
- CanonicalFontFamilyReference.cs
- SapiInterop.cs
- ColumnMapVisitor.cs
- DecimalStorage.cs
- FontWeightConverter.cs
- Size3D.cs
- EventArgs.cs
- StackBuilderSink.cs
- SurrogateSelector.cs
- ProfilePropertySettingsCollection.cs
- ValidationHelper.cs
- AssemblyAttributes.cs
- LinqTreeNodeEvaluator.cs
- EncryptedType.cs
- XmlAnyAttributeAttribute.cs
- AbstractExpressions.cs
- ModelVisual3D.cs
- MarkupExtensionParser.cs
- SimpleBitVector32.cs
- FixedDocument.cs
- WindowsEditBox.cs
- PageOutputQuality.cs
- ScriptingRoleServiceSection.cs
- DSASignatureFormatter.cs
- IndependentAnimationStorage.cs
- CodeDirectionExpression.cs
- MenuStrip.cs
- FillErrorEventArgs.cs
- EtwTrace.cs
- NameValueConfigurationElement.cs
- ServiceDocumentFormatter.cs
- InstanceOwnerQueryResult.cs
- BoundField.cs
- OdbcDataReader.cs
- EventLogConfiguration.cs
- _BufferOffsetSize.cs
- Stopwatch.cs
- ResolveNameEventArgs.cs
- SafeEventLogReadHandle.cs
- DataSourceGeneratorException.cs
- FileUpload.cs
- SingleTagSectionHandler.cs
- MasterPageParser.cs
- WebException.cs
- StateItem.cs
- CompilerTypeWithParams.cs
- AesCryptoServiceProvider.cs
- SoapMessage.cs
- WasEndpointConfigContainer.cs
- ServiceObjectContainer.cs
- AnimationException.cs
- PersistStreamTypeWrapper.cs
- TypeKeyValue.cs
- DrawListViewItemEventArgs.cs
- ASCIIEncoding.cs
- COM2Properties.cs
- HttpContext.cs
- EventLogInternal.cs
- ListControlStringCollectionEditor.cs
- PrinterUnitConvert.cs
- CollectionBase.cs
- CoTaskMemUnicodeSafeHandle.cs
- SiteMapSection.cs
- ProgressPage.cs
- ClientRuntimeConfig.cs
- ByteAnimationBase.cs
- ServiceRouteHandler.cs
- ConfigXmlWhitespace.cs
- TogglePattern.cs
- HtmlHistory.cs
- DataGridColumnHeaderCollection.cs
- TextBox.cs
- PerformanceCounterPermission.cs
- AttributeData.cs
- ChangeInterceptorAttribute.cs
- WebPartDisplayModeCancelEventArgs.cs
- EntryIndex.cs
- ParallelTimeline.cs
- Message.cs
- NonValidatingSecurityTokenAuthenticator.cs
- Stack.cs
- GenericXmlSecurityToken.cs
- DrawingBrush.cs
- RequestValidator.cs
- TextRangeEditLists.cs
- BuildManagerHost.cs
- TextSyndicationContent.cs
- OperationPerformanceCounters.cs
- Random.cs
- HttpListenerRequestUriBuilder.cs
- IndexOutOfRangeException.cs
- XmlSignificantWhitespace.cs
- DragDrop.cs