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
- MenuBase.cs
- RNGCryptoServiceProvider.cs
- DataAdapter.cs
- RotationValidation.cs
- EdmToObjectNamespaceMap.cs
- HandledEventArgs.cs
- DoubleAnimation.cs
- XmlDataLoader.cs
- Processor.cs
- SubtreeProcessor.cs
- XmlReaderSettings.cs
- ToggleProviderWrapper.cs
- NumberFormatter.cs
- _NtlmClient.cs
- SettingsSection.cs
- TypeLibConverter.cs
- XamlPathDataSerializer.cs
- NativeMethods.cs
- ObfuscationAttribute.cs
- SqlProcedureAttribute.cs
- RepeatBehavior.cs
- GetPageCompletedEventArgs.cs
- ButtonPopupAdapter.cs
- ScrollChrome.cs
- GridViewCancelEditEventArgs.cs
- DecimalSumAggregationOperator.cs
- ValueUnavailableException.cs
- CssStyleCollection.cs
- ValidatorUtils.cs
- XmlSchemaObjectTable.cs
- TextContainer.cs
- Point3DIndependentAnimationStorage.cs
- ConfigurationPropertyCollection.cs
- Point3DCollectionConverter.cs
- TextSelectionHighlightLayer.cs
- ScriptResourceHandler.cs
- KnownAssembliesSet.cs
- ApplicationContext.cs
- InputProcessorProfiles.cs
- Crc32Helper.cs
- SpeakInfo.cs
- WizardPanel.cs
- MarkupObject.cs
- InputLanguageEventArgs.cs
- SequenceDesignerAccessibleObject.cs
- PersistenceProvider.cs
- CodeAttributeArgumentCollection.cs
- PublisherIdentityPermission.cs
- AuthenticationModulesSection.cs
- PolygonHotSpot.cs
- Function.cs
- InputMethodStateTypeInfo.cs
- OleDragDropHandler.cs
- FixedTextContainer.cs
- GenericXmlSecurityToken.cs
- WindowsBrush.cs
- TextRenderer.cs
- DataGridViewTopRowAccessibleObject.cs
- BinaryUtilClasses.cs
- DataGridViewImageCell.cs
- EnumBuilder.cs
- Viewport3DVisual.cs
- HttpModulesSection.cs
- SystemColors.cs
- PerfCounters.cs
- NativeMethods.cs
- DiscoveryOperationContext.cs
- StringAnimationBase.cs
- DragCompletedEventArgs.cs
- DataServiceRequestArgs.cs
- webproxy.cs
- PrintingPermissionAttribute.cs
- SecUtil.cs
- DocumentAutomationPeer.cs
- QuerySetOp.cs
- VectorCollectionValueSerializer.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- IntSecurity.cs
- CellQuery.cs
- ObjectDataSourceWizardForm.cs
- XmlArrayAttribute.cs
- ToolStripLabel.cs
- UnsafeNativeMethods.cs
- UpdateException.cs
- ExecutionEngineException.cs
- SqlInternalConnectionTds.cs
- x509store.cs
- __FastResourceComparer.cs
- ExpressionPrefixAttribute.cs
- ResourceExpressionEditorSheet.cs
- ListViewItemMouseHoverEvent.cs
- FragmentNavigationEventArgs.cs
- ReaderOutput.cs
- SmuggledIUnknown.cs
- HttpListenerRequest.cs
- PaperSource.cs
- TableCellAutomationPeer.cs
- PersonalizationEntry.cs
- Model3DGroup.cs
- TableRowCollection.cs