Code:
/ FX-1434 / FX-1434 / 1.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
- COSERVERINFO.cs
- PartialTrustValidationBehavior.cs
- EmptyCollection.cs
- DrawListViewColumnHeaderEventArgs.cs
- EntityDataSourceChangingEventArgs.cs
- SmtpFailedRecipientsException.cs
- Scripts.cs
- Matrix.cs
- RoutedEventArgs.cs
- Emitter.cs
- XPathNavigatorKeyComparer.cs
- AdvancedBindingEditor.cs
- DataServiceRequestOfT.cs
- AttributeData.cs
- SpeechRecognizer.cs
- DBAsyncResult.cs
- SapiInterop.cs
- CannotUnloadAppDomainException.cs
- Interlocked.cs
- RoleManagerSection.cs
- panel.cs
- ToolboxComponentsCreatingEventArgs.cs
- NativeMethods.cs
- VirtualizedCellInfoCollection.cs
- Typography.cs
- TextBox.cs
- SerializableAttribute.cs
- BoundingRectTracker.cs
- WebUtil.cs
- XmlBinaryReader.cs
- AttachedAnnotation.cs
- ConfigXmlComment.cs
- IntegerCollectionEditor.cs
- StringAnimationUsingKeyFrames.cs
- StorageModelBuildProvider.cs
- ValidationError.cs
- RandomNumberGenerator.cs
- ValidationHelper.cs
- DataControlLinkButton.cs
- NumberFormatInfo.cs
- XslAst.cs
- EventlogProvider.cs
- _SecureChannel.cs
- SplitterEvent.cs
- CultureNotFoundException.cs
- BuilderElements.cs
- AttributeEmitter.cs
- RightsManagementEncryptedStream.cs
- ByteRangeDownloader.cs
- SimpleHandlerFactory.cs
- ECDsaCng.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- EventPropertyMap.cs
- HttpRuntimeSection.cs
- RemoteWebConfigurationHostStream.cs
- PropertySourceInfo.cs
- SiteIdentityPermission.cs
- isolationinterop.cs
- RootProfilePropertySettingsCollection.cs
- DomNameTable.cs
- SecureConversationDriver.cs
- xml.cs
- ClientApiGenerator.cs
- FormViewUpdateEventArgs.cs
- EntityModelBuildProvider.cs
- AutoScrollExpandMessageFilter.cs
- RowParagraph.cs
- WebPartCollection.cs
- ConfigXmlWhitespace.cs
- SectionUpdates.cs
- ListViewUpdatedEventArgs.cs
- FormClosingEvent.cs
- WinFormsUtils.cs
- BindingList.cs
- CodeTypeReferenceCollection.cs
- ForceCopyBuildProvider.cs
- RowUpdatedEventArgs.cs
- MetabaseServerConfig.cs
- ValueQuery.cs
- Page.cs
- PropertyDescriptorComparer.cs
- SoapServerProtocol.cs
- NamedPipeWorkerProcess.cs
- ResourcePermissionBaseEntry.cs
- RuleDefinitions.cs
- FormViewDeletedEventArgs.cs
- AmbientEnvironment.cs
- AppDomainShutdownMonitor.cs
- ListControlConvertEventArgs.cs
- CaseInsensitiveHashCodeProvider.cs
- Query.cs
- WindowCollection.cs
- unsafenativemethodstextservices.cs
- DataGridViewImageColumn.cs
- ComplexPropertyEntry.cs
- DataControlButton.cs
- XmlConvert.cs
- PolicyManager.cs
- StaticContext.cs
- ProxyWebPartConnectionCollection.cs