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
- Registration.cs
- XmlIgnoreAttribute.cs
- BitStream.cs
- IConvertible.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- ProxyElement.cs
- ClonableStack.cs
- Utils.cs
- RuntimeConfig.cs
- InteropEnvironment.cs
- WsdlImporterElementCollection.cs
- Int16AnimationBase.cs
- XPathArrayIterator.cs
- SqlSelectStatement.cs
- ClientProxyGenerator.cs
- DesignOnlyAttribute.cs
- Ops.cs
- XmlArrayItemAttributes.cs
- ScalarRestriction.cs
- TagPrefixCollection.cs
- XPathAxisIterator.cs
- AuthenticationSection.cs
- CodeBinaryOperatorExpression.cs
- ListParaClient.cs
- HtmlTableRowCollection.cs
- Types.cs
- DigestTraceRecordHelper.cs
- XmlNamespaceManager.cs
- HtmlTableRow.cs
- Bezier.cs
- TextSchema.cs
- DesignerSelectionListAdapter.cs
- Light.cs
- RangeExpression.cs
- DiagnosticStrings.cs
- ExpressionBindingCollection.cs
- PrintingPermission.cs
- SelectingProviderEventArgs.cs
- EqualityComparer.cs
- UIAgentAsyncEndRequest.cs
- XmlQueryTypeFactory.cs
- Cursor.cs
- AsyncPostBackTrigger.cs
- ClassImporter.cs
- ValidatingPropertiesEventArgs.cs
- ContentElementCollection.cs
- ScriptComponentDescriptor.cs
- QueueProcessor.cs
- ColorTranslator.cs
- MenuTracker.cs
- OLEDB_Util.cs
- WebServiceHostFactory.cs
- Vector.cs
- PageVisual.cs
- ObjectViewEntityCollectionData.cs
- smtppermission.cs
- printdlgexmarshaler.cs
- UnaryOperationBinder.cs
- RangeBase.cs
- BooleanAnimationUsingKeyFrames.cs
- ListComponentEditor.cs
- RubberbandSelector.cs
- Update.cs
- FrameworkElementFactory.cs
- ScrollChrome.cs
- SelectionProcessor.cs
- SchemaDeclBase.cs
- EpmTargetTree.cs
- WebPartCatalogAddVerb.cs
- XsltArgumentList.cs
- ColumnHeader.cs
- CodeSnippetCompileUnit.cs
- TextServicesManager.cs
- odbcmetadatacollectionnames.cs
- MemberHolder.cs
- FixedTextSelectionProcessor.cs
- StyleBamlTreeBuilder.cs
- FixedSOMPageElement.cs
- KeyNameIdentifierClause.cs
- DocumentStream.cs
- ContractsBCL.cs
- DeploymentSection.cs
- ImageSource.cs
- ConditionalAttribute.cs
- Rijndael.cs
- GeometryCollection.cs
- DbParameterHelper.cs
- RadioButtonList.cs
- CertificateManager.cs
- relpropertyhelper.cs
- LineServicesRun.cs
- ClientOptions.cs
- TextParentUndoUnit.cs
- AddDataControlFieldDialog.cs
- x509store.cs
- SHA1Managed.cs
- Translator.cs
- DiscoveryClientElement.cs
- PathSegmentCollection.cs
- XmlText.cs