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
- WindowsFormsSectionHandler.cs
- AssertFilter.cs
- NativeMethods.cs
- HttpResponseWrapper.cs
- PkcsMisc.cs
- Rss20ItemFormatter.cs
- XmlWellformedWriter.cs
- ReadOnlyMetadataCollection.cs
- ListenDesigner.cs
- DetailsViewDeletedEventArgs.cs
- ExceptionValidationRule.cs
- SQLInt32Storage.cs
- PolyBezierSegment.cs
- EventMap.cs
- TextTreeUndoUnit.cs
- SourceSwitch.cs
- IncrementalReadDecoders.cs
- XmlComment.cs
- XmlSerializerFaultFormatter.cs
- Misc.cs
- Pkcs7Recipient.cs
- TextServicesLoader.cs
- ResourceLoader.cs
- ImageCodecInfo.cs
- EnvironmentPermission.cs
- Utils.cs
- Task.cs
- DataServiceExpressionVisitor.cs
- DataGridLength.cs
- Subset.cs
- BindMarkupExtensionSerializer.cs
- MatrixKeyFrameCollection.cs
- MostlySingletonList.cs
- Point4DValueSerializer.cs
- AdapterDictionary.cs
- AccessedThroughPropertyAttribute.cs
- OutputScopeManager.cs
- SQlBooleanStorage.cs
- XmlSchemaType.cs
- BindingManagerDataErrorEventArgs.cs
- VBIdentifierName.cs
- CheckedListBox.cs
- tooltip.cs
- SqlCacheDependencySection.cs
- BitmapEffectDrawing.cs
- ChangeDirector.cs
- StdValidatorsAndConverters.cs
- HttpRequestContext.cs
- WebBrowserNavigatedEventHandler.cs
- SystemGatewayIPAddressInformation.cs
- HorizontalAlignConverter.cs
- Matrix.cs
- SizeConverter.cs
- ExecutionEngineException.cs
- FixedHyperLink.cs
- AppDomainAttributes.cs
- EncodingDataItem.cs
- AuthenticatedStream.cs
- Parameter.cs
- SortedList.cs
- CustomAttributeFormatException.cs
- SectionRecord.cs
- TdsParserSafeHandles.cs
- FamilyTypefaceCollection.cs
- InternalBufferManager.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- AutomationAttributeInfo.cs
- Vector3DCollection.cs
- ValuePattern.cs
- Helpers.cs
- PersonalizationProvider.cs
- RoutedEventConverter.cs
- WebPartCatalogAddVerb.cs
- IsolatedStorageFileStream.cs
- Vector.cs
- RSAOAEPKeyExchangeFormatter.cs
- SignedXml.cs
- ProcessModule.cs
- HttpModuleAction.cs
- TextParagraphCache.cs
- StoryFragments.cs
- TrackingAnnotationCollection.cs
- PrintDialogDesigner.cs
- DependencyProperty.cs
- IndexedDataBuffer.cs
- DataTableClearEvent.cs
- OleDbPropertySetGuid.cs
- TextViewSelectionProcessor.cs
- QueryCacheKey.cs
- OverflowException.cs
- DomainConstraint.cs
- EncoderNLS.cs
- FormatPage.cs
- SafeNativeMethodsOther.cs
- ComAdminInterfaces.cs
- PipelineModuleStepContainer.cs
- ObjectMemberMapping.cs
- PrivacyNoticeBindingElementImporter.cs
- ValidationSummaryDesigner.cs
- HttpBindingExtension.cs