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
- TraceListeners.cs
- CursorEditor.cs
- OperationInvokerTrace.cs
- RuntimeArgumentHandle.cs
- ApplicationTrust.cs
- DbDataSourceEnumerator.cs
- NestPullup.cs
- WebServiceAttribute.cs
- MatrixTransform3D.cs
- XmlComment.cs
- PathData.cs
- WebPartExportVerb.cs
- TypeValidationEventArgs.cs
- Visual.cs
- ColorContextHelper.cs
- AliasExpr.cs
- ConnectorMovedEventArgs.cs
- StaticFileHandler.cs
- AnnotationResourceCollection.cs
- DebugHandleTracker.cs
- SafeHandles.cs
- ResetableIterator.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- SystemInfo.cs
- DataObject.cs
- Point3DAnimationUsingKeyFrames.cs
- GenerateHelper.cs
- XPathArrayIterator.cs
- ResourcesChangeInfo.cs
- Vector3DCollection.cs
- SystemIPGlobalProperties.cs
- SmuggledIUnknown.cs
- EncodingStreamWrapper.cs
- DispatcherSynchronizationContext.cs
- AttachmentService.cs
- CharacterString.cs
- SmiGettersStream.cs
- ConsoleTraceListener.cs
- CreateUserWizardAutoFormat.cs
- MasterPageCodeDomTreeGenerator.cs
- ValidationService.cs
- WebBrowsableAttribute.cs
- DataTemplateSelector.cs
- FormsAuthenticationModule.cs
- SpotLight.cs
- StyleCollectionEditor.cs
- ActivityScheduledRecord.cs
- DataGridTableCollection.cs
- ApplicationHost.cs
- FormatConvertedBitmap.cs
- Delegate.cs
- GC.cs
- WebFormDesignerActionService.cs
- ClientScriptManager.cs
- KeySplineConverter.cs
- PropertyToken.cs
- AuthenticationModeHelper.cs
- MethodImplAttribute.cs
- ChildDocumentBlock.cs
- _emptywebproxy.cs
- OpenTypeLayout.cs
- LinkTarget.cs
- DataConnectionHelper.cs
- GiveFeedbackEvent.cs
- EntityUtil.cs
- NativeMethods.cs
- HttpRequest.cs
- TemplatedControlDesigner.cs
- DataSourceUtil.cs
- LayoutTableCell.cs
- AccessText.cs
- TableDetailsRow.cs
- PropertyCondition.cs
- GridViewSelectEventArgs.cs
- PathGradientBrush.cs
- SoapHttpTransportImporter.cs
- SubpageParaClient.cs
- OpenTypeCommon.cs
- SystemIcmpV6Statistics.cs
- WebFormDesignerActionService.cs
- ForAllOperator.cs
- RadioButtonPopupAdapter.cs
- SystemUdpStatistics.cs
- X509ClientCertificateAuthenticationElement.cs
- BitVec.cs
- GlyphCache.cs
- XmlEntityReference.cs
- RtfToken.cs
- DocumentViewerConstants.cs
- ColorTypeConverter.cs
- DependencyObjectProvider.cs
- HistoryEventArgs.cs
- TdsParserStaticMethods.cs
- WebPartCollection.cs
- XmlSchemaAnnotated.cs
- ThreadExceptionDialog.cs
- InternalConfigSettingsFactory.cs
- Empty.cs
- HandlerBase.cs
- BaseCAMarshaler.cs