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
- X509Utils.cs
- InsufficientExecutionStackException.cs
- GregorianCalendar.cs
- ButtonFieldBase.cs
- InertiaExpansionBehavior.cs
- CodeEventReferenceExpression.cs
- PointValueSerializer.cs
- NativeBuffer.cs
- Size.cs
- DataServiceHostWrapper.cs
- DATA_BLOB.cs
- ServiceBehaviorElement.cs
- CssTextWriter.cs
- ConstantProjectedSlot.cs
- PathFigureCollectionValueSerializer.cs
- TableItemPattern.cs
- FieldNameLookup.cs
- ConfigurationSettings.cs
- BuilderInfo.cs
- AppDomainProtocolHandler.cs
- HwndSource.cs
- _ProxyChain.cs
- ObjectSelectorEditor.cs
- Repeater.cs
- CommandConverter.cs
- NativeWrapper.cs
- DataGridRelationshipRow.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- PowerStatus.cs
- InheritablePropertyChangeInfo.cs
- DataControlPagerLinkButton.cs
- SharedPerformanceCounter.cs
- VisualStyleInformation.cs
- ObjectQuery_EntitySqlExtensions.cs
- ProxyHwnd.cs
- Suspend.cs
- EmptyEnumerable.cs
- EventPropertyMap.cs
- SafeFileHandle.cs
- ChangeProcessor.cs
- DebugHandleTracker.cs
- CryptoKeySecurity.cs
- DataGridViewBindingCompleteEventArgs.cs
- CodeGenerator.cs
- TextElementCollectionHelper.cs
- Multiply.cs
- DataBoundControlAdapter.cs
- Stylus.cs
- Mapping.cs
- MemoryMappedView.cs
- CodeGotoStatement.cs
- DataControlPagerLinkButton.cs
- SerializationStore.cs
- QuarticEase.cs
- StructuredTypeEmitter.cs
- WhiteSpaceTrimStringConverter.cs
- WorkItem.cs
- TypeElement.cs
- PermissionSetEnumerator.cs
- EnumerableValidator.cs
- ToolZone.cs
- SrgsNameValueTag.cs
- PagesSection.cs
- CursorConverter.cs
- PackageRelationshipSelector.cs
- TableDetailsCollection.cs
- DataSet.cs
- SqlDeflator.cs
- HttpContext.cs
- COM2PictureConverter.cs
- SrgsNameValueTag.cs
- DataGridViewColumnCollection.cs
- securitymgrsite.cs
- ZipIOBlockManager.cs
- XsltArgumentList.cs
- ParallelTimeline.cs
- GenericNameHandler.cs
- FormsAuthentication.cs
- LocalBuilder.cs
- Clock.cs
- ThicknessAnimation.cs
- UserNameSecurityTokenAuthenticator.cs
- WindowsScrollBar.cs
- AvTrace.cs
- _IPv6Address.cs
- SR.cs
- HopperCache.cs
- OdbcCommandBuilder.cs
- TransformerConfigurationWizardBase.cs
- TextRange.cs
- SettingsPropertyWrongTypeException.cs
- SqlBulkCopyColumnMappingCollection.cs
- ConstNode.cs
- ExpressionsCollectionConverter.cs
- WindowsAuthenticationEventArgs.cs
- XPathNodePointer.cs
- ParameterExpression.cs
- DataViewManager.cs
- MonitorWrapper.cs
- SendParametersContent.cs