Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Configuration / WebPartsSection.cs / 5 / 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
- SQLChars.cs
- streamingZipPartStream.cs
- DocumentPageTextView.cs
- FileAuthorizationModule.cs
- XamlClipboardData.cs
- AttributeUsageAttribute.cs
- Propagator.cs
- Int64AnimationUsingKeyFrames.cs
- ReleaseInstanceMode.cs
- EdmComplexPropertyAttribute.cs
- ProfileSection.cs
- GradientStopCollection.cs
- UrlMappingCollection.cs
- BitmapPalettes.cs
- ContentControl.cs
- AuthenticationModuleElement.cs
- DynamicMethod.cs
- HuffModule.cs
- XmlToDatasetMap.cs
- DiffuseMaterial.cs
- InvalidateEvent.cs
- CatalogPart.cs
- _ContextAwareResult.cs
- PartialClassGenerationTask.cs
- WebUtil.cs
- ButtonColumn.cs
- SqlStream.cs
- TabletDevice.cs
- WebReferenceCollection.cs
- PolyQuadraticBezierSegment.cs
- InvalidCastException.cs
- IntegerValidatorAttribute.cs
- TaskFormBase.cs
- MessageQueuePermissionEntryCollection.cs
- Int64Converter.cs
- SharedDp.cs
- IDictionary.cs
- WinFormsComponentEditor.cs
- AccessDataSourceDesigner.cs
- ServerType.cs
- XamlVector3DCollectionSerializer.cs
- Directory.cs
- RawStylusSystemGestureInputReport.cs
- WorkflowClientDeliverMessageWrapper.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- DynamicValidatorEventArgs.cs
- ScriptHandlerFactory.cs
- ItemList.cs
- CollectionChangeEventArgs.cs
- DateTimeFormat.cs
- BinaryObjectWriter.cs
- SystemWebCachingSectionGroup.cs
- RotateTransform3D.cs
- ControlType.cs
- QueryPageSettingsEventArgs.cs
- SerialPort.cs
- OpenTypeLayout.cs
- PageWrapper.cs
- ComplexTypeEmitter.cs
- RangeEnumerable.cs
- RemotingServices.cs
- MemoryStream.cs
- XmlSchemaSubstitutionGroup.cs
- DataTrigger.cs
- LayoutSettings.cs
- DataGridViewCellStyleChangedEventArgs.cs
- EntityKeyElement.cs
- ResXBuildProvider.cs
- SQLDateTimeStorage.cs
- SafePipeHandle.cs
- ListViewAutomationPeer.cs
- Function.cs
- AutoGeneratedField.cs
- HiddenFieldPageStatePersister.cs
- CapabilitiesAssignment.cs
- AssemblyName.cs
- FieldNameLookup.cs
- ByteFacetDescriptionElement.cs
- PanelDesigner.cs
- Label.cs
- QueryAsyncResult.cs
- TakeQueryOptionExpression.cs
- SmiSettersStream.cs
- rsa.cs
- SqlDataSourceConnectionPanel.cs
- ThemeConfigurationDialog.cs
- StrokeNodeOperations.cs
- XmlDictionary.cs
- ArrangedElementCollection.cs
- CompilationUtil.cs
- AsyncResult.cs
- RoutedEventHandlerInfo.cs
- indexingfiltermarshaler.cs
- MaskedTextProvider.cs
- Aggregates.cs
- DefaultAsyncDataDispatcher.cs
- DbConnectionPool.cs
- MergeFilterQuery.cs
- DesignerVerbCollection.cs
- FixedHighlight.cs