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
- MarshalByValueComponent.cs
- DebugViewWriter.cs
- AxisAngleRotation3D.cs
- DescendantQuery.cs
- VoiceSynthesis.cs
- GifBitmapEncoder.cs
- SafeArrayRankMismatchException.cs
- _emptywebproxy.cs
- TextWriterEngine.cs
- SystemPens.cs
- DataServiceProviderMethods.cs
- ArrayList.cs
- FileChangesMonitor.cs
- OleDbDataReader.cs
- OutOfMemoryException.cs
- DataRowIndexBuffer.cs
- EllipseGeometry.cs
- ClosableStream.cs
- KoreanLunisolarCalendar.cs
- SQLBinaryStorage.cs
- HtmlElement.cs
- OdbcConnectionOpen.cs
- FileRecordSequenceHelper.cs
- SystemGatewayIPAddressInformation.cs
- GridToolTip.cs
- AnnotationDocumentPaginator.cs
- ZipIOCentralDirectoryBlock.cs
- ZipFileInfoCollection.cs
- RelationshipDetailsCollection.cs
- DataBoundLiteralControl.cs
- NumberSubstitution.cs
- TargetConverter.cs
- SamlAuthorizationDecisionClaimResource.cs
- DataStorage.cs
- DataGridViewMethods.cs
- DateTimeConstantAttribute.cs
- ThreadExceptionEvent.cs
- HostingEnvironment.cs
- XsltArgumentList.cs
- GridViewSelectEventArgs.cs
- SelectionPattern.cs
- FixedTextSelectionProcessor.cs
- XmlHierarchyData.cs
- XmlNode.cs
- MailAddress.cs
- AdjustableArrowCap.cs
- ConfigurationSectionCollection.cs
- BasicKeyConstraint.cs
- BitmapEffectDrawing.cs
- ObjectSet.cs
- CharEntityEncoderFallback.cs
- Terminate.cs
- PropertyMetadata.cs
- PauseStoryboard.cs
- SecurityElement.cs
- Quaternion.cs
- SizeConverter.cs
- RemotingClientProxy.cs
- assemblycache.cs
- SoapTypeAttribute.cs
- ServiceChannelProxy.cs
- ValidatorAttribute.cs
- WebBrowserNavigatedEventHandler.cs
- AutomationEventArgs.cs
- SQLDoubleStorage.cs
- Hash.cs
- ContentType.cs
- BoundsDrawingContextWalker.cs
- _ConnectStream.cs
- TraceShell.cs
- WaitForChangedResult.cs
- GroupItemAutomationPeer.cs
- XmlSchemaCollection.cs
- Win32.cs
- UnSafeCharBuffer.cs
- DSASignatureDeformatter.cs
- PropertyToken.cs
- CheckBox.cs
- TraceSection.cs
- BaseTreeIterator.cs
- Root.cs
- TemplateBamlRecordReader.cs
- DbSetClause.cs
- MouseGesture.cs
- ChannelPool.cs
- MessageQueue.cs
- WmlListAdapter.cs
- ToolTipAutomationPeer.cs
- XsltQilFactory.cs
- HttpProtocolImporter.cs
- ReferencedCollectionType.cs
- PropertyGeneratedEventArgs.cs
- ConfigXmlElement.cs
- BindingFormattingDialog.cs
- XmlSerializerVersionAttribute.cs
- CompilerCollection.cs
- StylusPlugin.cs
- ImageField.cs
- ISessionStateStore.cs
- TraceSource.cs