Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / Host / DesignSurfaceServiceContainer.cs / 1 / DesignSurfaceServiceContainer.cs
using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Design; namespace System.ComponentModel.Design { ////// A service container that supports "fixed" services. Fixed /// services cannot be removed. /// internal sealed class DesignSurfaceServiceContainer : ServiceContainer { private Hashtable _fixedServices; ////// We always add ourselves as a service. /// internal DesignSurfaceServiceContainer(IServiceProvider parentProvider) : base(parentProvider) { AddFixedService(typeof(DesignSurfaceServiceContainer), this); } ////// Removes the given service type from the service container. /// internal void AddFixedService(Type serviceType, object serviceInstance) { AddService(serviceType, serviceInstance); if (_fixedServices == null) { _fixedServices = new Hashtable(); } _fixedServices[serviceType] = serviceType; } ////// Removes a previously added fixed service. /// internal void RemoveFixedService(Type serviceType) { if (_fixedServices != null) { _fixedServices.Remove(serviceType); } RemoveService(serviceType); } ////// Removes the given service type from the service container. Throws /// an exception if the service is fixed. /// public override void RemoveService(Type serviceType, bool promote) { if (serviceType != null && _fixedServices != null && _fixedServices.ContainsKey(serviceType)) { throw new InvalidOperationException(SR.GetString(SR.DesignSurfaceServiceIsFixed, serviceType.Name)); } base.RemoveService(serviceType, promote); } } } // 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
- Repeater.cs
- TemplatePropertyEntry.cs
- WebPartManagerInternals.cs
- PtsPage.cs
- ErrorEventArgs.cs
- LineSegment.cs
- MsmqMessageProperty.cs
- WSTrustFeb2005.cs
- TextServicesCompartmentContext.cs
- TypeSystemHelpers.cs
- PropertyRecord.cs
- ReliableDuplexSessionChannel.cs
- ListComponentEditor.cs
- WebPartCatalogCloseVerb.cs
- XmlCharCheckingWriter.cs
- Sequence.cs
- Journaling.cs
- EntityDataSourceChangingEventArgs.cs
- QueryConverter.cs
- SimpleNameService.cs
- ParameterToken.cs
- KeysConverter.cs
- MultiPropertyDescriptorGridEntry.cs
- DbDataReader.cs
- WebBrowsableAttribute.cs
- ObjectQuery_EntitySqlExtensions.cs
- TypeUnloadedException.cs
- CursorEditor.cs
- AttachedPropertyBrowsableAttribute.cs
- BaseHashHelper.cs
- LogWriteRestartAreaAsyncResult.cs
- Publisher.cs
- ArrangedElementCollection.cs
- DBParameter.cs
- Substitution.cs
- Convert.cs
- BitHelper.cs
- DetailsViewCommandEventArgs.cs
- LayoutTableCell.cs
- WindowsContainer.cs
- CopyAction.cs
- Parser.cs
- OpacityConverter.cs
- HttpWebRequest.cs
- CompilerGeneratedAttribute.cs
- PersonalizationState.cs
- StreamGeometryContext.cs
- PerformanceCounter.cs
- UserControl.cs
- XPathParser.cs
- BindingExpressionBase.cs
- XmlDocumentFragment.cs
- XPathNodeIterator.cs
- SHA384Managed.cs
- SortQuery.cs
- HelpProvider.cs
- OutputCacheProfile.cs
- SiblingIterators.cs
- SelectorAutomationPeer.cs
- ObjectCacheHost.cs
- Oid.cs
- WinFormsUtils.cs
- IndexedString.cs
- DataGridCellEditEndingEventArgs.cs
- X509WindowsSecurityToken.cs
- WorkflowMessageEventArgs.cs
- LiteralTextContainerControlBuilder.cs
- TableDetailsRow.cs
- BasicExpandProvider.cs
- webclient.cs
- InvariantComparer.cs
- TextClipboardData.cs
- ModuleConfigurationInfo.cs
- odbcmetadatafactory.cs
- Point3DIndependentAnimationStorage.cs
- SelectedDatesCollection.cs
- FixedSOMPageConstructor.cs
- FloatUtil.cs
- CodeSnippetTypeMember.cs
- BlurEffect.cs
- ResourcesBuildProvider.cs
- Icon.cs
- XPathSingletonIterator.cs
- TypeBuilderInstantiation.cs
- DataGridViewCellStyle.cs
- FontUnit.cs
- UnsafeNativeMethods.cs
- BulletedListDesigner.cs
- DataGridViewButtonColumn.cs
- CachedResourceDictionaryExtension.cs
- MetafileHeader.cs
- LineServices.cs
- MailWebEventProvider.cs
- DataGridViewColumn.cs
- EventLogPermissionEntry.cs
- TokenDescriptor.cs
- NonBatchDirectoryCompiler.cs
- WebContext.cs
- ArrayListCollectionBase.cs
- NamedObject.cs