Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / ControlDesignerState.cs / 1 / ControlDesignerState.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; ////// Class to wrap the IComponentDesignerStateService /// to expose a simple indexer property. /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] public sealed class ControlDesignerState { private IDictionary _designerState; private IComponent _component; internal ControlDesignerState(IComponent component) { _component = component; } public object this[string key] { get { if (_designerState == null) { // Try to use designer state service if ((_component != null) && (_component.Site != null)) { IComponentDesignerStateService designerStateService = (IComponentDesignerStateService)_component.Site.GetService(typeof(IComponentDesignerStateService)); if (designerStateService != null) { return designerStateService.GetState(_component, key); } } // State service does not exist, use private hashtable instead _designerState = new Hashtable(); } return _designerState[key]; } set { if (_designerState == null) { // Try to use designer state service if ((_component != null) && (_component.Site != null)) { IComponentDesignerStateService designerStateService = (IComponentDesignerStateService)_component.Site.GetService(typeof(IComponentDesignerStateService)); if (designerStateService != null) { designerStateService.SetState(_component, key, value); return; } } // State service does not exist, use private hashtable instead _designerState = new Hashtable(); } _designerState[key] = value; } } } } // 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
- IDQuery.cs
- JsonFaultDetail.cs
- TextDecorationLocationValidation.cs
- ResXDataNode.cs
- ToolStripSystemRenderer.cs
- GroupQuery.cs
- Int32CollectionValueSerializer.cs
- GatewayDefinition.cs
- Vector3DConverter.cs
- EnumerableRowCollectionExtensions.cs
- Lease.cs
- WebPartPersonalization.cs
- WeakEventManager.cs
- TraceHandler.cs
- SwitchDesigner.xaml.cs
- XDeferredAxisSource.cs
- VisualState.cs
- Connector.cs
- CodeArgumentReferenceExpression.cs
- WindowsListViewItemCheckBox.cs
- NeutralResourcesLanguageAttribute.cs
- SchemaImporterExtensionElement.cs
- storepermissionattribute.cs
- HelloOperation11AsyncResult.cs
- IPEndPoint.cs
- HttpDictionary.cs
- Control.cs
- CustomAttribute.cs
- EdmScalarPropertyAttribute.cs
- XsdCachingReader.cs
- _OSSOCK.cs
- TextRangeSerialization.cs
- WmlLinkAdapter.cs
- PeerCollaborationPermission.cs
- SecureConversationDriver.cs
- ThaiBuddhistCalendar.cs
- Tokenizer.cs
- PointConverter.cs
- CompressStream.cs
- PropertyGrid.cs
- RectAnimationClockResource.cs
- RepeaterItem.cs
- DataGridViewCellFormattingEventArgs.cs
- WebPartDeleteVerb.cs
- SetStoryboardSpeedRatio.cs
- StateElement.cs
- GeneralTransform3DTo2DTo3D.cs
- RawAppCommandInputReport.cs
- LinearGradientBrush.cs
- ProxyFragment.cs
- TreeViewCancelEvent.cs
- DnsPermission.cs
- WebConfigurationHost.cs
- Column.cs
- UseLicense.cs
- StringAnimationBase.cs
- ContainerParagraph.cs
- EntityDataSourceWrapperCollection.cs
- ExportFileRequest.cs
- HttpConfigurationSystem.cs
- SqlCacheDependency.cs
- SrgsSubset.cs
- ChangeTracker.cs
- ChtmlCommandAdapter.cs
- MemoryPressure.cs
- NamedPermissionSet.cs
- WebControl.cs
- Exceptions.cs
- OciLobLocator.cs
- XmlSchemaInfo.cs
- BindToObject.cs
- ByteStack.cs
- LicFileLicenseProvider.cs
- ThreadInterruptedException.cs
- DiffuseMaterial.cs
- Bits.cs
- EndpointIdentityConverter.cs
- PropertyPathConverter.cs
- processwaithandle.cs
- FromRequest.cs
- BasicExpressionVisitor.cs
- InvalidAsynchronousStateException.cs
- SponsorHelper.cs
- NavigateEvent.cs
- ResourceCollectionInfo.cs
- BeginStoryboard.cs
- PixelFormatConverter.cs
- XmlAttributes.cs
- LayoutSettings.cs
- NameTable.cs
- CfgArc.cs
- SmtpCommands.cs
- PersonalizationAdministration.cs
- BezierSegment.cs
- ImageCodecInfo.cs
- IndexOutOfRangeException.cs
- PrivateFontCollection.cs
- DPTypeDescriptorContext.cs
- ContainerVisual.cs
- MultiTrigger.cs