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
- HasRunnableWorkflowEvent.cs
- FormViewActionList.cs
- OdbcHandle.cs
- PrefixHandle.cs
- Avt.cs
- ParserExtension.cs
- ProfileProvider.cs
- TableRow.cs
- Header.cs
- ASCIIEncoding.cs
- SequentialOutput.cs
- DbParameterHelper.cs
- SafeSecurityHandles.cs
- ExpandableObjectConverter.cs
- TabControl.cs
- HistoryEventArgs.cs
- PreviewKeyDownEventArgs.cs
- BaseParser.cs
- TableRowsCollectionEditor.cs
- HtmlInputRadioButton.cs
- InvalidEnumArgumentException.cs
- ContentFilePart.cs
- CapiNative.cs
- HitTestResult.cs
- DesignTimeTemplateParser.cs
- RemoteHelper.cs
- TableDetailsRow.cs
- ReliableRequestSessionChannel.cs
- EnvelopedSignatureTransform.cs
- TemplatedAdorner.cs
- DispatchOperationRuntime.cs
- ObjectDataSourceView.cs
- DynamicDiscoSearcher.cs
- ActionMessageFilter.cs
- ProfilePropertySettings.cs
- ActivitySurrogate.cs
- SQLRoleProvider.cs
- SQLBoolean.cs
- LayoutEngine.cs
- WebPartCollection.cs
- SystemDiagnosticsSection.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- BaseAppDomainProtocolHandler.cs
- HScrollBar.cs
- MD5HashHelper.cs
- ViewCellRelation.cs
- TextElementEditingBehaviorAttribute.cs
- ZipIOExtraFieldElement.cs
- SerializerProvider.cs
- Automation.cs
- DataGridItemCollection.cs
- MdiWindowListItemConverter.cs
- UrlMappingCollection.cs
- ProtocolImporter.cs
- IFlowDocumentViewer.cs
- SizeChangedInfo.cs
- DataObjectAttribute.cs
- WindowsRebar.cs
- OleDbCommandBuilder.cs
- Material.cs
- TextContainerChangeEventArgs.cs
- ToolStripItemTextRenderEventArgs.cs
- DiscoveryRequestHandler.cs
- SuppressMergeCheckAttribute.cs
- SafeTokenHandle.cs
- PointF.cs
- FtpRequestCacheValidator.cs
- ItemsControl.cs
- AddInIpcChannel.cs
- AlphabetConverter.cs
- InputBindingCollection.cs
- BitConverter.cs
- ProgressiveCrcCalculatingStream.cs
- RequestStatusBarUpdateEventArgs.cs
- ObjectStateFormatter.cs
- TextFormatter.cs
- FormViewInsertEventArgs.cs
- EpmSyndicationContentSerializer.cs
- FileSecurity.cs
- ErrorHandler.cs
- RadioButtonPopupAdapter.cs
- SeverityFilter.cs
- ListItemCollection.cs
- TreeNodeBindingCollection.cs
- IsolatedStorageFileStream.cs
- SharedPerformanceCounter.cs
- MetadataItem_Static.cs
- AutoGeneratedFieldProperties.cs
- Visual3D.cs
- ListViewGroupCollectionEditor.cs
- GetPageCompletedEventArgs.cs
- MissingManifestResourceException.cs
- safemediahandle.cs
- SByte.cs
- DataGridHeaderBorder.cs
- InputScope.cs
- XamlDesignerSerializationManager.cs
- MULTI_QI.cs
- TypeBuilderInstantiation.cs
- BitmapMetadataBlob.cs