Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Configuration / WebPartsSection.cs / 1 / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FontInfo.cs
- WebPartHeaderCloseVerb.cs
- UnsafeNativeMethodsTablet.cs
- XmlAutoDetectWriter.cs
- StdValidatorsAndConverters.cs
- Types.cs
- HostingEnvironmentException.cs
- DomainUpDown.cs
- XamlContextStack.cs
- TabPage.cs
- NavigationExpr.cs
- IList.cs
- ApplicationDirectory.cs
- MemberJoinTreeNode.cs
- FolderBrowserDialog.cs
- ResourceReader.cs
- SqlDataSourceCache.cs
- IsolatedStorageFilePermission.cs
- DbParameterCollectionHelper.cs
- InvokeHandlers.cs
- InkCanvasSelection.cs
- GorillaCodec.cs
- StreamDocument.cs
- DrawingAttributesDefaultValueFactory.cs
- Setter.cs
- SystemWebExtensionsSectionGroup.cs
- DocumentEventArgs.cs
- AsyncCompletedEventArgs.cs
- ComponentEvent.cs
- RegexGroup.cs
- CFStream.cs
- StateInitialization.cs
- DataGridViewButtonCell.cs
- SqlDataSourceCommandEventArgs.cs
- FixedDocument.cs
- EntityCollectionChangedParams.cs
- GraphicsContainer.cs
- RelationshipDetailsRow.cs
- ActivityExecutionWorkItem.cs
- AttachedAnnotation.cs
- WebServiceFault.cs
- ToolStripDesignerAvailabilityAttribute.cs
- Rect3DValueSerializer.cs
- PathStreamGeometryContext.cs
- PagePropertiesChangingEventArgs.cs
- ControlPaint.cs
- SqlGenerator.cs
- DeleteHelper.cs
- CodeComment.cs
- XPathArrayIterator.cs
- QilLoop.cs
- StreamBodyWriter.cs
- Repeater.cs
- ClientUrlResolverWrapper.cs
- EditorPartChrome.cs
- WeakEventTable.cs
- ServerValidateEventArgs.cs
- PolyBezierSegment.cs
- __FastResourceComparer.cs
- HashHelper.cs
- CheckBoxDesigner.cs
- nulltextcontainer.cs
- StrokeRenderer.cs
- MetadataUtilsSmi.cs
- InputBuffer.cs
- CompoundFileReference.cs
- DataRowCollection.cs
- SupportingTokenAuthenticatorSpecification.cs
- BlockExpression.cs
- SiteMapNode.cs
- RequestResponse.cs
- DeviceSpecificDesigner.cs
- AbstractSvcMapFileLoader.cs
- HostedTcpTransportManager.cs
- HtmlTableRow.cs
- DateTimeFormat.cs
- QuaternionAnimationUsingKeyFrames.cs
- InternalBufferOverflowException.cs
- EndpointDispatcher.cs
- PrinterSettings.cs
- JumpList.cs
- NameTable.cs
- DayRenderEvent.cs
- CuspData.cs
- SimpleParser.cs
- DataControlExtensions.cs
- PathSegmentCollection.cs
- DbConnectionPoolGroup.cs
- SequentialUshortCollection.cs
- ServiceDefaults.cs
- AdapterDictionary.cs
- ConnectionPointConverter.cs
- ThreadAbortException.cs
- Span.cs
- ExplicitDiscriminatorMap.cs
- XmlSchemaCompilationSettings.cs
- OdbcReferenceCollection.cs
- IntegerValidatorAttribute.cs
- TokenBasedSetEnumerator.cs
- FileEnumerator.cs