Code:
/ DotNET / DotNET / 8.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
- FormsAuthenticationUserCollection.cs
- Thickness.cs
- Style.cs
- XmlNodeReader.cs
- EntityViewGenerator.cs
- UnmanagedMarshal.cs
- AppDomainProtocolHandler.cs
- UnsafeNativeMethodsMilCoreApi.cs
- String.cs
- EventSinkActivityDesigner.cs
- RuntimeEnvironment.cs
- XmlNodeChangedEventManager.cs
- DataMember.cs
- TitleStyle.cs
- PeerServiceMessageContracts.cs
- DecoderNLS.cs
- NameSpaceEvent.cs
- DataGridViewImageColumn.cs
- BitmapEffectCollection.cs
- Vector3DValueSerializer.cs
- ThicknessAnimationBase.cs
- OAVariantLib.cs
- ToolStripComboBox.cs
- AnonymousIdentificationSection.cs
- FragmentQueryKB.cs
- DrawingGroupDrawingContext.cs
- DesigntimeLicenseContext.cs
- MutexSecurity.cs
- MultiBindingExpression.cs
- SqlMetaData.cs
- ListBoxAutomationPeer.cs
- mansign.cs
- CoTaskMemHandle.cs
- SerializationHelper.cs
- RijndaelManagedTransform.cs
- PseudoWebRequest.cs
- AnnotationResourceCollection.cs
- FontWeightConverter.cs
- _SslState.cs
- ProfileService.cs
- TextBoxView.cs
- MailBnfHelper.cs
- ImageListImageEditor.cs
- Graphics.cs
- ClickablePoint.cs
- DrawingCollection.cs
- AnnotationDocumentPaginator.cs
- CodeAccessSecurityEngine.cs
- StringInfo.cs
- Cloud.cs
- StringBuilder.cs
- BinaryConverter.cs
- LinqDataSourceSelectEventArgs.cs
- XamlBrushSerializer.cs
- ServiceBuildProvider.cs
- CaseStatementProjectedSlot.cs
- ExpressionBuilderCollection.cs
- KeyInterop.cs
- ImportCatalogPart.cs
- GridLength.cs
- LineGeometry.cs
- RC2CryptoServiceProvider.cs
- ContainerUIElement3D.cs
- IResourceProvider.cs
- CompatibleComparer.cs
- HttpHandlerActionCollection.cs
- Rotation3D.cs
- SystemException.cs
- FontFamily.cs
- BamlStream.cs
- XmlSchemaComplexContentRestriction.cs
- AnnotationHighlightLayer.cs
- Application.cs
- UnsafeNativeMethods.cs
- TextElementAutomationPeer.cs
- FunctionNode.cs
- DBCommandBuilder.cs
- PenThread.cs
- ParameterRetriever.cs
- WebConfigurationHost.cs
- XmlWhitespace.cs
- XamlSerializer.cs
- BoundingRectTracker.cs
- BaseParagraph.cs
- LongCountAggregationOperator.cs
- SortExpressionBuilder.cs
- SerialStream.cs
- ExitEventArgs.cs
- TraceRecord.cs
- Peer.cs
- ListViewItem.cs
- WebHttpBindingCollectionElement.cs
- TemplateContentLoader.cs
- CustomDictionarySources.cs
- SHA384.cs
- ToolStripItemClickedEventArgs.cs
- SystemEvents.cs
- CollectionMarkupSerializer.cs
- ScriptControlManager.cs
- HtmlMeta.cs