Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / System / Windows / Markup / ServiceProviders.cs / 1305600 / ServiceProviders.cs
//---------------------------------------------------------------------------- // // File: ServiceProviders.cs // // Description: // Proivde a implementation for IServiceProvider and method to add services // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Collections.Generic; using System.Security.Permissions; using MS.Internal.WindowsBase; ///////////////////////////////////////////////////////////////////////////////////////// namespace System.Windows.Markup { ////// Proivde a implementation for IServiceProvider and method to add services /// ///Restrict public access until M8.2 //CASRemoval:[StrongNameIdentityPermission(SecurityAction.LinkDemand, PublicKey = Microsoft.Internal.BuildInfo.WCP_PUBLIC_KEY_STRING)] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] [System.ComponentModel.Browsable(false)] public class ServiceProviders : IServiceProvider { #region Implement IServiceProvider interface ////// Implement IServiceProvider.GetSevice /// /// ///public Object GetService(Type serviceType) { if (_objDict.ContainsKey(serviceType)) { return _objDict[serviceType]; } return null; } #endregion /// /// Add a new service /// /// /// public void AddService(Type serviceType, Object service) { if (serviceType == null) { throw new ArgumentNullException("serviceType"); } if (service == null) { throw new ArgumentNullException("service"); } if (_objDict.ContainsKey(serviceType) == false) { _objDict.Add(serviceType, service); } else if (_objDict[serviceType] != service) { throw new ArgumentException(SR.Get(SRID.ServiceTypeAlreadyAdded), "serviceType"); } } private Dictionary_objDict = new Dictionary (); } } // 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
- CssClassPropertyAttribute.cs
- DataGridViewIntLinkedList.cs
- CodeTypeReference.cs
- CommandHelper.cs
- DockAndAnchorLayout.cs
- DefaultDialogButtons.cs
- RandomNumberGenerator.cs
- CountdownEvent.cs
- FontNamesConverter.cs
- _SingleItemRequestCache.cs
- StateMachineAction.cs
- XmlSchemaAttributeGroupRef.cs
- ResolveResponse.cs
- Match.cs
- AtomEntry.cs
- WmlMobileTextWriter.cs
- SchemaExporter.cs
- SqlParameterCollection.cs
- ProcessRequestArgs.cs
- DeferredTextReference.cs
- ExpandCollapsePatternIdentifiers.cs
- TimeZone.cs
- DefaultClaimSet.cs
- CodeSubDirectory.cs
- autovalidator.cs
- SoapBinding.cs
- X509Certificate.cs
- DtdParser.cs
- UnsignedPublishLicense.cs
- SystemUnicastIPAddressInformation.cs
- AuthenticationServiceManager.cs
- WebPartPersonalization.cs
- DriveNotFoundException.cs
- ProtocolElement.cs
- MobileControlDesigner.cs
- RichTextBoxConstants.cs
- MenuItem.cs
- TypeForwardedToAttribute.cs
- Identity.cs
- ProcessModuleDesigner.cs
- Events.cs
- SafeNativeMethodsMilCoreApi.cs
- Marshal.cs
- DataBindingHandlerAttribute.cs
- OracleLob.cs
- PointValueSerializer.cs
- ResourcePart.cs
- SamlAuthorityBinding.cs
- ExtentCqlBlock.cs
- DataGridViewCellCancelEventArgs.cs
- Point.cs
- DesignerAutoFormatCollection.cs
- DoubleLinkListEnumerator.cs
- GreenMethods.cs
- SerializableTypeCodeDomSerializer.cs
- ToolBarOverflowPanel.cs
- LinearKeyFrames.cs
- WebPartDisplayMode.cs
- ObjectDataProvider.cs
- SchemaImporter.cs
- DataObjectEventArgs.cs
- LoadRetryHandler.cs
- Application.cs
- ReaderWriterLock.cs
- NameValuePair.cs
- SeverityFilter.cs
- CursorConverter.cs
- ReadOnlyPropertyMetadata.cs
- SelectionHighlightInfo.cs
- InternalPermissions.cs
- DataGridViewColumnCollection.cs
- Focus.cs
- ByteRangeDownloader.cs
- TableSectionStyle.cs
- WebPartDeleteVerb.cs
- MetadataExchangeClient.cs
- HostedElements.cs
- PointConverter.cs
- AuthenticateEventArgs.cs
- ControlEvent.cs
- Random.cs
- AssemblyAttributesGoHere.cs
- Encoder.cs
- CollectionViewGroupInternal.cs
- AddIn.cs
- TiffBitmapDecoder.cs
- GroupBoxAutomationPeer.cs
- XmlILStorageConverter.cs
- XmlIlVisitor.cs
- SplitterPanel.cs
- ThreadStartException.cs
- securitycriticaldataClass.cs
- AlphabetConverter.cs
- KeyFrames.cs
- IdentityReference.cs
- SchemaMapping.cs
- ItemsPresenter.cs
- BinarySerializer.cs
- RequestUriProcessor.cs
- ResourceIDHelper.cs