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
- XmlSchemaAll.cs
- Emitter.cs
- FontNameEditor.cs
- DbConnectionStringCommon.cs
- AdjustableArrowCap.cs
- WebControlAdapter.cs
- SendKeys.cs
- DataServiceConfiguration.cs
- DebugController.cs
- DataRelation.cs
- SchemaInfo.cs
- ReadOnlyCollection.cs
- CacheHelper.cs
- SemanticBasicElement.cs
- PassportIdentity.cs
- TargetConverter.cs
- ScriptReferenceEventArgs.cs
- _SSPISessionCache.cs
- DrawToolTipEventArgs.cs
- EndpointDiscoveryMetadata.cs
- PathFigureCollectionConverter.cs
- XmlEnumAttribute.cs
- KnownColorTable.cs
- AccessibilityHelperForVista.cs
- Attributes.cs
- SafePEFileHandle.cs
- RouteParametersHelper.cs
- followingquery.cs
- UnsafeNativeMethods.cs
- GraphicsState.cs
- BindingList.cs
- OutputCache.cs
- RowTypeElement.cs
- MetadataArtifactLoaderComposite.cs
- XmlSerializerFactory.cs
- StylusButton.cs
- HttpPostProtocolReflector.cs
- WbmpConverter.cs
- MessageBox.cs
- _ScatterGatherBuffers.cs
- URLString.cs
- Stack.cs
- SystemTcpConnection.cs
- IndividualDeviceConfig.cs
- QueryAccessibilityHelpEvent.cs
- ItemCheckEvent.cs
- GeneralTransform3DGroup.cs
- HostingEnvironment.cs
- GroupBoxAutomationPeer.cs
- Visual3DCollection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ServiceReference.cs
- GradientBrush.cs
- TypeDescriptionProviderAttribute.cs
- XmlValidatingReader.cs
- WebPartConnectionsConfigureVerb.cs
- SBCSCodePageEncoding.cs
- DataViewManager.cs
- UnauthorizedWebPart.cs
- EdmProviderManifest.cs
- TreeNodeCollection.cs
- ResourceAssociationSet.cs
- HealthMonitoringSection.cs
- DrawingAttributes.cs
- SpecularMaterial.cs
- XmlSchemaAppInfo.cs
- HtmlSelectionListAdapter.cs
- TabControlToolboxItem.cs
- SQLInt16.cs
- SqlCachedBuffer.cs
- DataGrid.cs
- RuleSetBrowserDialog.cs
- TablePatternIdentifiers.cs
- TextParagraphView.cs
- ControlValuePropertyAttribute.cs
- DBDataPermissionAttribute.cs
- XmlFileEditor.cs
- TypeGeneratedEventArgs.cs
- HttpStreamMessage.cs
- Bold.cs
- HashJoinQueryOperatorEnumerator.cs
- Margins.cs
- Tuple.cs
- SwitchElementsCollection.cs
- DocumentCollection.cs
- ComPlusInstanceContextInitializer.cs
- Vector3D.cs
- XMLUtil.cs
- XamlVector3DCollectionSerializer.cs
- OptimizerPatterns.cs
- _AcceptOverlappedAsyncResult.cs
- OleDbErrorCollection.cs
- XmlDocument.cs
- FormsAuthenticationUserCollection.cs
- NextPreviousPagerField.cs
- AttachedAnnotation.cs
- GACMembershipCondition.cs
- IsolatedStorageFilePermission.cs
- SelectionList.cs
- LoginCancelEventArgs.cs