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
- EntityDataSourceStatementEditor.cs
- GenericXmlSecurityTokenAuthenticator.cs
- PropertyItemInternal.cs
- PageAdapter.cs
- SslStream.cs
- SqlTransaction.cs
- codemethodreferenceexpression.cs
- SqlGenerator.cs
- ReadOnlyHierarchicalDataSource.cs
- Serializer.cs
- ToolBarTray.cs
- InheritedPropertyChangedEventArgs.cs
- SourceLocation.cs
- ApplicationBuildProvider.cs
- FlagPanel.cs
- CultureInfoConverter.cs
- StringAnimationBase.cs
- FontClient.cs
- HtmlDocument.cs
- ClonableStack.cs
- BuildResult.cs
- XPathQilFactory.cs
- SynchronizationLockException.cs
- TranslateTransform3D.cs
- ConnectionConsumerAttribute.cs
- _KerberosClient.cs
- Selector.cs
- CodeChecksumPragma.cs
- TraceProvider.cs
- TCPListener.cs
- XmlCustomFormatter.cs
- ClearTypeHintValidation.cs
- DBNull.cs
- oledbmetadatacolumnnames.cs
- _ConnectStream.cs
- FixedTextPointer.cs
- DataControlImageButton.cs
- ProcessMonitor.cs
- EntityDataSourceColumn.cs
- TextProviderWrapper.cs
- BaseDataListPage.cs
- DataGridViewCellCollection.cs
- WebPartEditorApplyVerb.cs
- Image.cs
- XmlNodeChangedEventArgs.cs
- CodeBlockBuilder.cs
- SequenceQuery.cs
- ListControl.cs
- LicenseManager.cs
- WorkflowItemPresenter.cs
- ExpressionBuilderCollection.cs
- NavigationWindow.cs
- CultureSpecificStringDictionary.cs
- AddInPipelineAttributes.cs
- ResXResourceReader.cs
- StrongNamePublicKeyBlob.cs
- RotateTransform.cs
- SvcMapFileSerializer.cs
- TransformCollection.cs
- IconBitmapDecoder.cs
- NameGenerator.cs
- WebScriptServiceHostFactory.cs
- ProfessionalColorTable.cs
- WSSecurityPolicy12.cs
- UpdateCompiler.cs
- OutputCacheSettings.cs
- StringCollection.cs
- COM2ExtendedBrowsingHandler.cs
- QuaternionRotation3D.cs
- TextAnchor.cs
- WebControlAdapter.cs
- TypefaceCollection.cs
- JsonReader.cs
- ObjectContext.cs
- FontStretches.cs
- WpfWebRequestHelper.cs
- SecurityPermission.cs
- PathGeometry.cs
- FlowDocument.cs
- TextShapeableCharacters.cs
- SafeNativeMethods.cs
- GlobalizationAssembly.cs
- SqlServices.cs
- DataRowComparer.cs
- HandlerWithFactory.cs
- MethodBody.cs
- DoubleCollectionConverter.cs
- SoundPlayer.cs
- WebConfigurationHost.cs
- IRCollection.cs
- ResourceLoader.cs
- SoapSchemaExporter.cs
- ElementUtil.cs
- ExpressionConverter.cs
- MetafileHeaderWmf.cs
- DataGridAutoFormat.cs
- TraceProvider.cs
- Control.cs
- IndentedWriter.cs
- WebPartsSection.cs