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
- ClientConvert.cs
- OdbcHandle.cs
- DirectionalLight.cs
- PropertyMapper.cs
- HostSecurityManager.cs
- ListViewDataItem.cs
- SerializationSectionGroup.cs
- SocketAddress.cs
- SettingsAttributes.cs
- DocumentationServerProtocol.cs
- ThemeDictionaryExtension.cs
- ConstrainedDataObject.cs
- RegexFCD.cs
- Drawing.cs
- DesignerSelectionListAdapter.cs
- XPathNavigatorReader.cs
- PngBitmapEncoder.cs
- XmlJsonReader.cs
- BinaryFormatterWriter.cs
- HttpCapabilitiesSectionHandler.cs
- TextDecorationUnitValidation.cs
- FontUnit.cs
- GroupBoxDesigner.cs
- CompositeCollection.cs
- SystemIPGlobalProperties.cs
- SafeProcessHandle.cs
- EntryWrittenEventArgs.cs
- DataGridTablesFactory.cs
- FormParameter.cs
- DBConnection.cs
- MulticastNotSupportedException.cs
- WindowsGraphicsWrapper.cs
- SingleAnimationBase.cs
- ViewGenerator.cs
- Wizard.cs
- XmlLoader.cs
- Utility.cs
- ContextMenu.cs
- DataGridViewRowCancelEventArgs.cs
- RijndaelManaged.cs
- CornerRadiusConverter.cs
- TypeTypeConverter.cs
- FieldToken.cs
- smtppermission.cs
- ExtendedPropertyInfo.cs
- HttpNamespaceReservationInstallComponent.cs
- KeyInstance.cs
- WindowsImpersonationContext.cs
- Update.cs
- SecurityTokenAuthenticator.cs
- PolyLineSegmentFigureLogic.cs
- SelectionChangedEventArgs.cs
- ImageList.cs
- CssTextWriter.cs
- BitmapPalette.cs
- Vector3DCollection.cs
- TextBoxDesigner.cs
- ExceptionHandlers.cs
- BuildManagerHost.cs
- DataRowComparer.cs
- VisualTreeUtils.cs
- HostedHttpContext.cs
- Transactions.cs
- DetectEofStream.cs
- EdmConstants.cs
- ServiceOperationInvoker.cs
- FormViewUpdatedEventArgs.cs
- ParentControlDesigner.cs
- EmbeddedMailObjectsCollection.cs
- DiscreteKeyFrames.cs
- SingleConverter.cs
- SpecularMaterial.cs
- GridViewColumnHeader.cs
- Latin1Encoding.cs
- WebPartChrome.cs
- CategoryEditor.cs
- Nullable.cs
- OpenFileDialog.cs
- ConfigXmlAttribute.cs
- MemoryMappedViewAccessor.cs
- EventMappingSettings.cs
- __Filters.cs
- WsatConfiguration.cs
- HtmlTableRowCollection.cs
- ActivityCodeDomSerializer.cs
- ScopelessEnumAttribute.cs
- SafeBitVector32.cs
- ChtmlPageAdapter.cs
- PreviewKeyDownEventArgs.cs
- SafeMILHandle.cs
- Mappings.cs
- XamlFilter.cs
- ObjectViewQueryResultData.cs
- EventMappingSettings.cs
- MarkupCompilePass1.cs
- Rect3D.cs
- ListCardsInFileRequest.cs
- TextParentUndoUnit.cs
- TypedDatasetGenerator.cs
- ClaimTypeRequirement.cs