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
- Size.cs
- PieceNameHelper.cs
- GPStream.cs
- HttpStreamMessage.cs
- StartFileNameEditor.cs
- DetectRunnableInstancesTask.cs
- PhysicalOps.cs
- ColumnMapProcessor.cs
- SlotInfo.cs
- MatchingStyle.cs
- TextEffect.cs
- COMException.cs
- TextServicesDisplayAttribute.cs
- PlatformCulture.cs
- TypeElement.cs
- BindingCollection.cs
- HtmlTextArea.cs
- FollowerQueueCreator.cs
- PriorityBinding.cs
- ApplicationInfo.cs
- MediaCommands.cs
- AssemblyFilter.cs
- ProviderSettingsCollection.cs
- ICollection.cs
- ValidatedControlConverter.cs
- ApplicationInfo.cs
- assertwrapper.cs
- DbCommandDefinition.cs
- DataControlCommands.cs
- BindingList.cs
- RoleGroupCollection.cs
- UserValidatedEventArgs.cs
- PreservationFileReader.cs
- ToolStripDesignerUtils.cs
- SafeSecurityHelper.cs
- InvokeHandlers.cs
- NativeBuffer.cs
- DataBoundControlActionList.cs
- FileLevelControlBuilderAttribute.cs
- XmlSiteMapProvider.cs
- LinqToSqlWrapper.cs
- CodePrimitiveExpression.cs
- NavigatorOutput.cs
- ResourceContainer.cs
- Geometry.cs
- SetStoryboardSpeedRatio.cs
- Token.cs
- StringTraceRecord.cs
- RequestCachePolicyConverter.cs
- Policy.cs
- MenuEventArgs.cs
- DoubleCollectionConverter.cs
- FileLoadException.cs
- DaylightTime.cs
- StrongTypingException.cs
- DBDataPermissionAttribute.cs
- TimeSpanStorage.cs
- CurrentChangingEventManager.cs
- XamlReader.cs
- SmiEventStream.cs
- XmlDocumentFragment.cs
- ObjectFullSpanRewriter.cs
- JavaScriptObjectDeserializer.cs
- AssemblyBuilder.cs
- XmlnsCache.cs
- BitmapPalette.cs
- EngineSiteSapi.cs
- CommonObjectSecurity.cs
- InkCanvasFeedbackAdorner.cs
- KeySpline.cs
- FormsAuthenticationUserCollection.cs
- AutoSizeToolBoxItem.cs
- RegexStringValidator.cs
- ValueConversionAttribute.cs
- ColorKeyFrameCollection.cs
- SmiMetaDataProperty.cs
- NoClickablePointException.cs
- WmpBitmapEncoder.cs
- ArraySubsetEnumerator.cs
- WaitHandle.cs
- StreamWithDictionary.cs
- TypeExtensionConverter.cs
- PerformanceCounterCategory.cs
- WCFModelStrings.Designer.cs
- SetterBaseCollection.cs
- Slider.cs
- XMLDiffLoader.cs
- DefaultParameterValueAttribute.cs
- TransactionFlowBindingElement.cs
- _ContextAwareResult.cs
- FixedSOMTableRow.cs
- DataGridViewToolTip.cs
- DictionaryTraceRecord.cs
- EntitySetDataBindingList.cs
- Directory.cs
- BufferedStream2.cs
- EntityViewGenerationAttribute.cs
- FontDriver.cs
- LocalizedNameDescriptionPair.cs
- WebPartDescriptionCollection.cs