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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TemplateBindingExpression.cs
- TransformValueSerializer.cs
- XmlBinaryReader.cs
- ObjectStorage.cs
- ParserHooks.cs
- LinkClickEvent.cs
- NavigationProperty.cs
- DbgUtil.cs
- EnumUnknown.cs
- ImageSourceValueSerializer.cs
- SqlInfoMessageEvent.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- MobileTextWriter.cs
- SizeAnimationUsingKeyFrames.cs
- DispatcherOperation.cs
- ProvidersHelper.cs
- ResourceBinder.cs
- ListenerElementsCollection.cs
- MailDefinitionBodyFileNameEditor.cs
- Deserializer.cs
- XmlArrayItemAttributes.cs
- Span.cs
- PathBox.cs
- CustomCategoryAttribute.cs
- ClonableStack.cs
- PropertyGridEditorPart.cs
- SortAction.cs
- PagedDataSource.cs
- XmlSchemaSimpleContentRestriction.cs
- MediaContextNotificationWindow.cs
- TimeSpanStorage.cs
- BounceEase.cs
- SizeConverter.cs
- QueryOptionExpression.cs
- SequentialUshortCollection.cs
- TextTreeInsertUndoUnit.cs
- NominalTypeEliminator.cs
- TextBoxView.cs
- ResourceManager.cs
- BindingEditor.xaml.cs
- LogAppendAsyncResult.cs
- WrappedKeySecurityToken.cs
- CompilationUtil.cs
- TempFiles.cs
- OuterGlowBitmapEffect.cs
- ScaleTransform.cs
- StructuredTypeEmitter.cs
- TransportationConfigurationTypeInstallComponent.cs
- DataBindEngine.cs
- HebrewNumber.cs
- DocumentXmlWriter.cs
- OperationAbortedException.cs
- DesignerAutoFormat.cs
- DataGridPreparingCellForEditEventArgs.cs
- DirectoryObjectSecurity.cs
- TextElementAutomationPeer.cs
- WebPartCatalogAddVerb.cs
- OutKeywords.cs
- HtmlTableRow.cs
- ImageInfo.cs
- TableStyle.cs
- SuspendDesigner.cs
- TextWriterEngine.cs
- TypeUsageBuilder.cs
- StructuredType.cs
- DescendantQuery.cs
- TracedNativeMethods.cs
- ComboBoxItem.cs
- WebHostScriptMappingsInstallComponent.cs
- IPipelineRuntime.cs
- ListItemCollection.cs
- HandledMouseEvent.cs
- PrimitiveXmlSerializers.cs
- Automation.cs
- StreamingContext.cs
- ObjectSelectorEditor.cs
- ValueTable.cs
- EDesignUtil.cs
- WinFormsUtils.cs
- Drawing.cs
- MemberPath.cs
- TypeConverter.cs
- MouseCaptureWithinProperty.cs
- TextLineResult.cs
- DataGridViewMethods.cs
- Invariant.cs
- UTF32Encoding.cs
- ToolTip.cs
- ExpressionNode.cs
- ProviderSettings.cs
- WebPartUtil.cs
- XpsSerializationManager.cs
- DbProviderFactoriesConfigurationHandler.cs
- EventProviderTraceListener.cs
- RemotingException.cs
- StaticSiteMapProvider.cs
- CommandDevice.cs
- SqlInternalConnectionSmi.cs
- FrameworkTemplate.cs
- ValidationSummary.cs