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
- OutputCacheSection.cs
- AssociationType.cs
- DocumentEventArgs.cs
- DocumentAutomationPeer.cs
- MaterialCollection.cs
- PeerName.cs
- XPathChildIterator.cs
- JavascriptCallbackResponseProperty.cs
- DecoderReplacementFallback.cs
- ScaleTransform.cs
- ControlBindingsCollection.cs
- XslTransform.cs
- XmlCharType.cs
- PeerPresenceInfo.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- MenuAdapter.cs
- TrackingWorkflowEventArgs.cs
- StrongNamePublicKeyBlob.cs
- DataFormats.cs
- M3DUtil.cs
- FacetValues.cs
- TypeSemantics.cs
- Parser.cs
- SqlDataReader.cs
- ClipboardProcessor.cs
- BamlRecords.cs
- EncryptionUtility.cs
- TextModifier.cs
- RuntimeDelegateArgument.cs
- ControlValuePropertyAttribute.cs
- InternalUserCancelledException.cs
- HandoffBehavior.cs
- CellNormalizer.cs
- WebPartConnectVerb.cs
- StorageComplexPropertyMapping.cs
- DynamicRenderer.cs
- CultureSpecificStringDictionary.cs
- ShapeTypeface.cs
- DataGridViewToolTip.cs
- BreadCrumbTextConverter.cs
- SQLResource.cs
- DodSequenceMerge.cs
- GuidelineCollection.cs
- QuaternionAnimationBase.cs
- TriggerActionCollection.cs
- BaseTemplateParser.cs
- XmlSerializerAssemblyAttribute.cs
- WebPartHeaderCloseVerb.cs
- ModelTreeManager.cs
- TrustLevel.cs
- IconBitmapDecoder.cs
- ResourcePermissionBaseEntry.cs
- AssertHelper.cs
- ItemsChangedEventArgs.cs
- TemplateColumn.cs
- GetPageNumberCompletedEventArgs.cs
- TreeViewHitTestInfo.cs
- UniqueEventHelper.cs
- EntityContainerEntitySet.cs
- ItemChangedEventArgs.cs
- AssociationTypeEmitter.cs
- CodeAttributeArgumentCollection.cs
- DataListCommandEventArgs.cs
- BuildManager.cs
- StringStorage.cs
- Context.cs
- MetadataCache.cs
- IgnoreFileBuildProvider.cs
- DataGridHeaderBorder.cs
- DataTableExtensions.cs
- ManifestSignatureInformation.cs
- Positioning.cs
- ChannelServices.cs
- OleDbPropertySetGuid.cs
- ObjectSecurity.cs
- SelectedCellsCollection.cs
- DataKeyCollection.cs
- ObjectViewEntityCollectionData.cs
- EmptyEnumerator.cs
- BreakSafeBase.cs
- PrintingPermissionAttribute.cs
- Quaternion.cs
- XhtmlConformanceSection.cs
- CheckableControlBaseAdapter.cs
- ArcSegment.cs
- QueryStatement.cs
- IDQuery.cs
- DesignTimeTemplateParser.cs
- IncomingWebResponseContext.cs
- WebDescriptionAttribute.cs
- XamlLoadErrorInfo.cs
- RemotingConfigParser.cs
- AnimatedTypeHelpers.cs
- ContextDataSource.cs
- TraceContext.cs
- SqlNamer.cs
- QueryExpression.cs
- HttpConfigurationSystem.cs
- XComponentModel.cs
- XmlSchemaAnyAttribute.cs