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
- ProfileServiceManager.cs
- WorkflowOwnershipException.cs
- ConcatQueryOperator.cs
- DataPagerField.cs
- DataGridViewToolTip.cs
- DataGridColumnCollection.cs
- TreeBuilder.cs
- _UncName.cs
- _StreamFramer.cs
- MemberRelationshipService.cs
- ToolTipAutomationPeer.cs
- DebugHandleTracker.cs
- _ScatterGatherBuffers.cs
- DataBindingsDialog.cs
- TrackingStringDictionary.cs
- ConfigurationElementProperty.cs
- AncestorChangedEventArgs.cs
- OAVariantLib.cs
- OleDbSchemaGuid.cs
- DataGridViewRowEventArgs.cs
- UDPClient.cs
- LoadedEvent.cs
- FacetDescription.cs
- TypefaceMap.cs
- Vector3DAnimationUsingKeyFrames.cs
- CodeEntryPointMethod.cs
- MaxValueConverter.cs
- RoutedEventArgs.cs
- ValidationManager.cs
- Nodes.cs
- DbParameterCollectionHelper.cs
- ZipPackagePart.cs
- OuterGlowBitmapEffect.cs
- CqlWriter.cs
- EntityDataSourceReferenceGroup.cs
- ImageList.cs
- DiagnosticsConfigurationHandler.cs
- Stacktrace.cs
- InvokeBinder.cs
- XmlNodeChangedEventManager.cs
- ImportOptions.cs
- EasingKeyFrames.cs
- PathFigure.cs
- SqlParameter.cs
- FixedTextSelectionProcessor.cs
- XmlTextReaderImplHelpers.cs
- CollectionEditVerbManager.cs
- ProgramPublisher.cs
- WebDescriptionAttribute.cs
- DiffuseMaterial.cs
- SoapTypeAttribute.cs
- OrderingExpression.cs
- baseaxisquery.cs
- EventLogEntryCollection.cs
- EmbeddedMailObject.cs
- UpWmlPageAdapter.cs
- DbConnectionFactory.cs
- FlowDocumentPaginator.cs
- ProfileGroupSettings.cs
- TraceRecord.cs
- MessageRpc.cs
- ByteKeyFrameCollection.cs
- printdlgexmarshaler.cs
- CompleteWizardStep.cs
- ExpressionBuilderCollection.cs
- InvokeAction.cs
- Vector3DCollectionConverter.cs
- HtmlHead.cs
- VisualStyleRenderer.cs
- TextEndOfSegment.cs
- SelectedDatesCollection.cs
- AlphabeticalEnumConverter.cs
- GenericPrincipal.cs
- DataFieldEditor.cs
- StartUpEventArgs.cs
- ParagraphVisual.cs
- CharUnicodeInfo.cs
- DataGridColumnHeaderCollection.cs
- TagPrefixAttribute.cs
- SmiEventSink_Default.cs
- SqlCacheDependencyDatabaseCollection.cs
- RtfNavigator.cs
- XmlBindingWorker.cs
- EDesignUtil.cs
- ObjectItemAttributeAssemblyLoader.cs
- WebResponse.cs
- TypedMessageConverter.cs
- SuppressMessageAttribute.cs
- DeclaredTypeValidator.cs
- StreamGeometryContext.cs
- TextServicesManager.cs
- EdmSchemaError.cs
- BidPrivateBase.cs
- EventSinkActivity.cs
- ExpressionBuilderCollection.cs
- ArraySet.cs
- Errors.cs
- WebPartConnectionsCancelEventArgs.cs
- UnaryExpression.cs
- EntityAdapter.cs