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
- RequestStatusBarUpdateEventArgs.cs
- EventManager.cs
- CompareValidator.cs
- ArithmeticException.cs
- VectorAnimationUsingKeyFrames.cs
- WebBrowserDocumentCompletedEventHandler.cs
- CopyCodeAction.cs
- UnsafeNativeMethodsMilCoreApi.cs
- StorageConditionPropertyMapping.cs
- SqlCommandSet.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- WebServiceData.cs
- TextDocumentView.cs
- BoundField.cs
- RuleSettings.cs
- XmlILModule.cs
- FontStretches.cs
- ReceiveActivityDesignerTheme.cs
- ImageFormatConverter.cs
- ExpressionCopier.cs
- ComplexPropertyEntry.cs
- Helper.cs
- NativeMethods.cs
- RangeBaseAutomationPeer.cs
- XmlDocument.cs
- TargetInvocationException.cs
- NameValuePermission.cs
- InfiniteTimeSpanConverter.cs
- DesignTimeValidationFeature.cs
- Paragraph.cs
- PointHitTestResult.cs
- DrawItemEvent.cs
- XmlWrappingReader.cs
- ByteRangeDownloader.cs
- XmlSchemaComplexType.cs
- ChangeTracker.cs
- MimeTypeMapper.cs
- CodeGotoStatement.cs
- XmlEntityReference.cs
- NumberFormatInfo.cs
- WebBrowserUriTypeConverter.cs
- CompressEmulationStream.cs
- ProtocolsConfiguration.cs
- KeyMatchBuilder.cs
- SchemaImporterExtension.cs
- BaseCollection.cs
- ReadWriteObjectLock.cs
- DesignerLabelAdapter.cs
- InitializerFacet.cs
- InternalSafeNativeMethods.cs
- XmlTextAttribute.cs
- PropertyItem.cs
- NullableIntMinMaxAggregationOperator.cs
- SplitterCancelEvent.cs
- DiscoveryEndpointValidator.cs
- EntityType.cs
- SoapMessage.cs
- ClientScriptManager.cs
- StreamResourceInfo.cs
- StorageMappingItemLoader.cs
- AsymmetricKeyExchangeDeformatter.cs
- InputLanguage.cs
- AssociativeAggregationOperator.cs
- InputProcessorProfilesLoader.cs
- ByteStack.cs
- IPHostEntry.cs
- ArgumentDesigner.xaml.cs
- ContentFileHelper.cs
- PeerApplicationLaunchInfo.cs
- ProfileGroupSettings.cs
- Pointer.cs
- DataSourceProvider.cs
- WinFormsUtils.cs
- TripleDESCryptoServiceProvider.cs
- StrokeCollection2.cs
- TabItemWrapperAutomationPeer.cs
- ObjectDataSourceView.cs
- XmlSchemaSubstitutionGroup.cs
- ChtmlCalendarAdapter.cs
- TimelineClockCollection.cs
- AssemblyHash.cs
- DashStyle.cs
- CodeCatchClause.cs
- String.cs
- MyContact.cs
- MobileCategoryAttribute.cs
- SqlOuterApplyReducer.cs
- GridViewCellAutomationPeer.cs
- StringDictionary.cs
- ZoneIdentityPermission.cs
- DispatcherExceptionEventArgs.cs
- EntityContainerEmitter.cs
- EncodingTable.cs
- MetadataArtifactLoaderFile.cs
- ProgressPage.cs
- RegexCapture.cs
- PackWebResponse.cs
- OracleString.cs
- StructuralType.cs
- RegistryPermission.cs