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
- ReadOnlyCollectionBase.cs
- ValidationErrorInfo.cs
- Models.cs
- CodeThrowExceptionStatement.cs
- BrowsableAttribute.cs
- ClrProviderManifest.cs
- ExpressionConverter.cs
- PerformanceCounterLib.cs
- InputProcessorProfiles.cs
- Token.cs
- HScrollProperties.cs
- SQLResource.cs
- BaseDataList.cs
- HtmlLink.cs
- WebScriptEnablingElement.cs
- AccessViolationException.cs
- Helpers.cs
- ExtensionWindowResizeGrip.cs
- InlineCollection.cs
- ControlCollection.cs
- TreeViewImageIndexConverter.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- DocumentApplication.cs
- DataGridViewRowsAddedEventArgs.cs
- DynamicDocumentPaginator.cs
- CqlQuery.cs
- DPCustomTypeDescriptor.cs
- UpdatePanel.cs
- XPathNavigator.cs
- VerticalAlignConverter.cs
- ValuePattern.cs
- TableSectionStyle.cs
- CodeTypeReferenceExpression.cs
- ExpressionEditorAttribute.cs
- ParameterInfo.cs
- Socket.cs
- RemoteEndpointMessageProperty.cs
- LocalizedNameDescriptionPair.cs
- AppSettingsReader.cs
- WindowsGraphicsWrapper.cs
- HtmlInputCheckBox.cs
- CodeAttachEventStatement.cs
- BindingManagerDataErrorEventArgs.cs
- ReadContentAsBinaryHelper.cs
- _SslSessionsCache.cs
- TiffBitmapEncoder.cs
- UmAlQuraCalendar.cs
- TypeSystem.cs
- TextMarkerSource.cs
- Border.cs
- WebPartsPersonalizationAuthorization.cs
- elementinformation.cs
- DataGridViewElement.cs
- Context.cs
- ResourceDescriptionAttribute.cs
- PreDigestedSignedInfo.cs
- CheckBoxPopupAdapter.cs
- XmlReader.cs
- Adorner.cs
- BackgroundWorker.cs
- HandlerBase.cs
- HttpFileCollectionWrapper.cs
- ComplexBindingPropertiesAttribute.cs
- XmlEncoding.cs
- DrawItemEvent.cs
- SafeRightsManagementEnvironmentHandle.cs
- DataControlFieldCollection.cs
- ClientTargetCollection.cs
- HashMembershipCondition.cs
- UpdatableWrapper.cs
- AnonymousIdentificationSection.cs
- ErrorHandler.cs
- TagMapCollection.cs
- Graphics.cs
- ExceptionUtil.cs
- DocumentSchemaValidator.cs
- HandledMouseEvent.cs
- PolyBezierSegment.cs
- CompletionCallbackWrapper.cs
- ObjectTag.cs
- GACMembershipCondition.cs
- FileSystemEnumerable.cs
- UnsafeNetInfoNativeMethods.cs
- ImageAttributes.cs
- BitmapMetadataBlob.cs
- XmlLoader.cs
- GeometryGroup.cs
- TextParentUndoUnit.cs
- ActivationArguments.cs
- SurrogateDataContract.cs
- CheckBox.cs
- BookmarkResumptionRecord.cs
- LeaseManager.cs
- CodeObject.cs
- XmlUtil.cs
- ActiveXHelper.cs
- SqlPersonalizationProvider.cs
- ResourcePermissionBase.cs
- XmlWrappingWriter.cs
- UnsafeNativeMethods.cs