Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / WebPartsSection.cs / 3 / WebPartsSection.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 WebPartsSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propEnableExport = new ConfigurationProperty("enableExport", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propPersonalization = new ConfigurationProperty("personalization", typeof(WebPartsPersonalization), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propTransformers = new ConfigurationProperty("transformers", typeof(TransformerInfoCollection), null, ConfigurationPropertyOptions.IsDefaultCollection); static WebPartsSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propEnableExport); _properties.Add(_propPersonalization); _properties.Add(_propTransformers); } public WebPartsSection() { } /* protected override void InitializeDefault() { /* Don't Add to Basicmap AuthorizationRule rule0 = new AuthorizationRule(AuthorizationRuleAction.Deny); rule0.Users.Add("*"); rule0.Verbs.Add("enterSharedScope"); Personalization.Authorization.Rules.Add(rule0); AuthorizationRule rule1 = new AuthorizationRule(AuthorizationRuleAction.Allow); rule1.Users.Add("*"); rule1.Verbs.Add("modifyState"); Personalization.Authorization.Rules.Add(rule1); */ /* } */ [ConfigurationProperty("enableExport", DefaultValue = false)] public bool EnableExport { get { return (bool)base[_propEnableExport]; } set { base[_propEnableExport] = value; } } [ConfigurationProperty("personalization")] public WebPartsPersonalization Personalization { get { return (WebPartsPersonalization)base[_propPersonalization]; } } /// protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("transformers")] public TransformerInfoCollection Transformers { get { return (TransformerInfoCollection)base[_propTransformers]; } } protected override object GetRuntimeObject() { Personalization.ValidateAuthorization(); return base.GetRuntimeObject(); } } } // 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 WebPartsSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propEnableExport = new ConfigurationProperty("enableExport", typeof(bool), false, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propPersonalization = new ConfigurationProperty("personalization", typeof(WebPartsPersonalization), null, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propTransformers = new ConfigurationProperty("transformers", typeof(TransformerInfoCollection), null, ConfigurationPropertyOptions.IsDefaultCollection); static WebPartsSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propEnableExport); _properties.Add(_propPersonalization); _properties.Add(_propTransformers); } public WebPartsSection() { } /* protected override void InitializeDefault() { /* Don't Add to Basicmap AuthorizationRule rule0 = new AuthorizationRule(AuthorizationRuleAction.Deny); rule0.Users.Add("*"); rule0.Verbs.Add("enterSharedScope"); Personalization.Authorization.Rules.Add(rule0); AuthorizationRule rule1 = new AuthorizationRule(AuthorizationRuleAction.Allow); rule1.Users.Add("*"); rule1.Verbs.Add("modifyState"); Personalization.Authorization.Rules.Add(rule1); */ /* } */ [ConfigurationProperty("enableExport", DefaultValue = false)] public bool EnableExport { get { return (bool)base[_propEnableExport]; } set { base[_propEnableExport] = value; } } [ConfigurationProperty("personalization")] public WebPartsPersonalization Personalization { get { return (WebPartsPersonalization)base[_propPersonalization]; } } /// protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("transformers")] public TransformerInfoCollection Transformers { get { return (TransformerInfoCollection)base[_propTransformers]; } } protected override object GetRuntimeObject() { Personalization.ValidateAuthorization(); return base.GetRuntimeObject(); } } } // 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
- TimeSpanSecondsOrInfiniteConverter.cs
- DESCryptoServiceProvider.cs
- SeekableMessageNavigator.cs
- PropertyTab.cs
- CurrentTimeZone.cs
- _AutoWebProxyScriptWrapper.cs
- GridViewUpdateEventArgs.cs
- BasicViewGenerator.cs
- ObjectDataSource.cs
- Renderer.cs
- RenderDataDrawingContext.cs
- TraceSection.cs
- SymmetricAlgorithm.cs
- ProcessStartInfo.cs
- ColumnResult.cs
- SoapExtensionStream.cs
- ReflectPropertyDescriptor.cs
- URLIdentityPermission.cs
- ParenthesizePropertyNameAttribute.cs
- embossbitmapeffect.cs
- MessageFilterTable.cs
- SQLCharsStorage.cs
- CollectionViewGroupRoot.cs
- ColorAnimationBase.cs
- WindowsBrush.cs
- TransformProviderWrapper.cs
- PageParserFilter.cs
- ListInitExpression.cs
- PtsPage.cs
- EntityDesignerDataSourceView.cs
- ListSurrogate.cs
- StringCollection.cs
- EntityDataReader.cs
- ListBase.cs
- IODescriptionAttribute.cs
- DataGridCell.cs
- _FtpDataStream.cs
- ConfigXmlAttribute.cs
- XsdDuration.cs
- _AutoWebProxyScriptEngine.cs
- TextEditorSpelling.cs
- ExpressionBindingCollection.cs
- MimeFormReflector.cs
- GeometryDrawing.cs
- LocalFileSettingsProvider.cs
- StoreItemCollection.cs
- SourceLocation.cs
- SigningCredentials.cs
- TypefaceCollection.cs
- HostedNamedPipeTransportManager.cs
- QueryOutputWriter.cs
- GeometryHitTestResult.cs
- XmlEncodedRawTextWriter.cs
- figurelengthconverter.cs
- RelationshipSet.cs
- SessionParameter.cs
- FontStretch.cs
- OptimizedTemplateContent.cs
- RadioButton.cs
- CatalogPart.cs
- _NegotiateClient.cs
- Control.cs
- Int16Storage.cs
- StyleConverter.cs
- TextServicesDisplayAttribute.cs
- BooleanKeyFrameCollection.cs
- LinqDataSourceSelectEventArgs.cs
- IntSecurity.cs
- DefaultHttpHandler.cs
- ProbeDuplex11AsyncResult.cs
- DataGridRowAutomationPeer.cs
- ProfilePropertyNameValidator.cs
- CalloutQueueItem.cs
- EpmSyndicationContentSerializer.cs
- UpDownBase.cs
- ConnectionPoint.cs
- Inflater.cs
- TextPointer.cs
- TypeInformation.cs
- XmlObjectSerializerReadContextComplex.cs
- RegistrationServices.cs
- IPipelineRuntime.cs
- HealthMonitoringSectionHelper.cs
- ClientOptions.cs
- MatrixCamera.cs
- AstNode.cs
- MembershipUser.cs
- QilGeneratorEnv.cs
- InvokePattern.cs
- SafeRightsManagementSessionHandle.cs
- UITypeEditor.cs
- AssertFilter.cs
- PathHelper.cs
- Regex.cs
- SafeBitVector32.cs
- XsdDuration.cs
- SyndicationSerializer.cs
- PrimitiveDataContract.cs
- XpsSerializerWriter.cs
- IntSecurity.cs