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
- TransformGroup.cs
- ToolBarButtonClickEvent.cs
- Subset.cs
- MobileListItem.cs
- PreDigestedSignedInfo.cs
- ListViewDeleteEventArgs.cs
- CookieParameter.cs
- ConfigurationSectionHelper.cs
- CheckBoxField.cs
- SecurityException.cs
- InvalidCastException.cs
- NavigatorOutput.cs
- ClipboardData.cs
- DragDropHelper.cs
- OletxVolatileEnlistment.cs
- StrokeCollection.cs
- DataGridBeginningEditEventArgs.cs
- PageClientProxyGenerator.cs
- AnnotationObservableCollection.cs
- UpdatePanelTrigger.cs
- UnsafePeerToPeerMethods.cs
- SkewTransform.cs
- UpdateCommandGenerator.cs
- MessageQueueConverter.cs
- ItemCollection.cs
- DecoratedNameAttribute.cs
- TimerEventSubscription.cs
- Image.cs
- Int16.cs
- DockAndAnchorLayout.cs
- RIPEMD160Managed.cs
- DropDownList.cs
- PkcsMisc.cs
- ManagementPath.cs
- ReadOnlyHierarchicalDataSource.cs
- DataGridViewSelectedCellCollection.cs
- Polyline.cs
- DocumentPageViewAutomationPeer.cs
- IsolatedStoragePermission.cs
- InstanceDescriptor.cs
- GacUtil.cs
- SourceItem.cs
- CodeCastExpression.cs
- CompositeScriptReferenceEventArgs.cs
- DataFormats.cs
- HttpRequestCacheValidator.cs
- SuppressMessageAttribute.cs
- ParseElement.cs
- FileReservationCollection.cs
- BindingList.cs
- SqlWriter.cs
- ConfigurationValues.cs
- ArgumentValue.cs
- VirtualPathUtility.cs
- CqlIdentifiers.cs
- DataList.cs
- ObjectDisposedException.cs
- DurableErrorHandler.cs
- Scanner.cs
- SqlCacheDependencyDatabase.cs
- EditorPart.cs
- DupHandleConnectionReader.cs
- MemoryMappedFile.cs
- HttpContextBase.cs
- SupportsEventValidationAttribute.cs
- NameTable.cs
- CompilerParameters.cs
- WorkflowPageSetupDialog.cs
- EventHandlersStore.cs
- ClientSettingsProvider.cs
- IndexedString.cs
- DetailsViewInsertEventArgs.cs
- GeometryConverter.cs
- WebExceptionStatus.cs
- BlurEffect.cs
- DragDrop.cs
- SystemIPInterfaceStatistics.cs
- Helpers.cs
- CodeTypeParameterCollection.cs
- AlternateViewCollection.cs
- SymbolEqualComparer.cs
- InvalidDocumentContentsException.cs
- EventData.cs
- ReflectTypeDescriptionProvider.cs
- SqlErrorCollection.cs
- DataObjectSettingDataEventArgs.cs
- ControlSerializer.cs
- CacheAxisQuery.cs
- ClassData.cs
- GeometryCombineModeValidation.cs
- SqlConnectionPoolProviderInfo.cs
- Content.cs
- StateMachine.cs
- MessagePartDescription.cs
- IriParsingElement.cs
- DbProviderSpecificTypePropertyAttribute.cs
- AncillaryOps.cs
- TextBoxRenderer.cs
- HttpClientCertificate.cs
- LogEntryHeaderv1Deserializer.cs