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
- Menu.cs
- ThrowHelper.cs
- CqlParserHelpers.cs
- UpdateManifestForBrowserApplication.cs
- WinEventQueueItem.cs
- SelectingProviderEventArgs.cs
- ImageField.cs
- Root.cs
- Application.cs
- OracleCommandSet.cs
- DbReferenceCollection.cs
- Facet.cs
- BuildResultCache.cs
- DataGrid.cs
- JsonStringDataContract.cs
- AudioSignalProblemOccurredEventArgs.cs
- CompModSwitches.cs
- HttpProfileBase.cs
- RefreshPropertiesAttribute.cs
- StringCollection.cs
- ReplyChannelBinder.cs
- BroadcastEventHelper.cs
- SoapProtocolReflector.cs
- GiveFeedbackEvent.cs
- TextEditorCopyPaste.cs
- DrawListViewItemEventArgs.cs
- CodeTypeDeclaration.cs
- TextEditorContextMenu.cs
- DataViewSettingCollection.cs
- HitTestWithPointDrawingContextWalker.cs
- ItemChangedEventArgs.cs
- StandardToolWindows.cs
- ResizeGrip.cs
- XPathPatternParser.cs
- Deflater.cs
- TabRenderer.cs
- SqlBooleanizer.cs
- HttpConfigurationContext.cs
- DragDropHelper.cs
- Rect.cs
- WebPartDisplayModeEventArgs.cs
- FormsAuthenticationEventArgs.cs
- PageCatalogPart.cs
- DataGridViewRowEventArgs.cs
- Rect.cs
- BitmapFrameEncode.cs
- AutoResizedEvent.cs
- ThreadSafeList.cs
- AsyncOperationManager.cs
- DataGridComponentEditor.cs
- PropertyIDSet.cs
- ContextMenuStripGroupCollection.cs
- ExceptionUtil.cs
- RangeBase.cs
- RegistryKey.cs
- WebHttpBinding.cs
- UICuesEvent.cs
- Switch.cs
- TraceFilter.cs
- ImageKeyConverter.cs
- AllMembershipCondition.cs
- HttpConfigurationSystem.cs
- ExtensionQuery.cs
- TableLayoutPanelCellPosition.cs
- HostingEnvironment.cs
- AppendHelper.cs
- ChannelManager.cs
- TableLayoutPanelCellPosition.cs
- TextRangeSerialization.cs
- RecordConverter.cs
- HtmlInputSubmit.cs
- XamlReader.cs
- ColorConverter.cs
- _UriTypeConverter.cs
- ConcurrentQueue.cs
- State.cs
- XmlIgnoreAttribute.cs
- Calendar.cs
- ParallelTimeline.cs
- StreamUpgradeProvider.cs
- Point3DAnimationBase.cs
- SourceFileBuildProvider.cs
- Point3DValueSerializer.cs
- SmtpReplyReaderFactory.cs
- PropertyFilterAttribute.cs
- ObfuscationAttribute.cs
- WebDescriptionAttribute.cs
- TagNameToTypeMapper.cs
- TextEditorTables.cs
- RegexCaptureCollection.cs
- TextRenderer.cs
- NamespaceCollection.cs
- NaturalLanguageHyphenator.cs
- HyperLinkDataBindingHandler.cs
- SQLInt64Storage.cs
- Matrix.cs
- ConfigurationValidatorBase.cs
- HtmlTableCell.cs
- ExpressionVisitor.cs
- SqlComparer.cs