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
- RectAnimationUsingKeyFrames.cs
- PointAnimationUsingKeyFrames.cs
- ISAPIRuntime.cs
- EventWaitHandleSecurity.cs
- CriticalFinalizerObject.cs
- ConstraintConverter.cs
- AncestorChangedEventArgs.cs
- CompositeActivityCodeGenerator.cs
- XmlnsDictionary.cs
- MatchAttribute.cs
- LastQueryOperator.cs
- TransactionProtocolConverter.cs
- QueryConverter.cs
- PenCursorManager.cs
- TripleDESCryptoServiceProvider.cs
- SimpleBitVector32.cs
- Compiler.cs
- WpfWebRequestHelper.cs
- LicenseProviderAttribute.cs
- DayRenderEvent.cs
- TagPrefixInfo.cs
- RequestValidator.cs
- ComAdminWrapper.cs
- ICspAsymmetricAlgorithm.cs
- PointHitTestParameters.cs
- UrlMappingsSection.cs
- XmlArrayAttribute.cs
- EntityParameterCollection.cs
- DataBoundControlAdapter.cs
- ADMembershipUser.cs
- VarRemapper.cs
- ObjectDataSourceStatusEventArgs.cs
- LogicalExpressionEditor.cs
- AsyncContentLoadedEventArgs.cs
- safelinkcollection.cs
- OrthographicCamera.cs
- BamlLocalizableResource.cs
- BindingGroup.cs
- TableParaClient.cs
- SrgsRulesCollection.cs
- ValidatorCollection.cs
- SolidColorBrush.cs
- UnsafeNativeMethodsPenimc.cs
- GridView.cs
- TimeoutValidationAttribute.cs
- Base64Stream.cs
- MetadataElement.cs
- Pkcs7Signer.cs
- Signature.cs
- IRCollection.cs
- PageThemeBuildProvider.cs
- TreeSet.cs
- MgmtConfigurationRecord.cs
- PrintControllerWithStatusDialog.cs
- RoutedUICommand.cs
- SimpleMailWebEventProvider.cs
- PersonalizationProvider.cs
- HScrollBar.cs
- XsdValidatingReader.cs
- InternalMappingException.cs
- AutoGeneratedFieldProperties.cs
- XmlSchemaNotation.cs
- DataGridBoolColumn.cs
- DataBinder.cs
- NewItemsContextMenuStrip.cs
- OdbcParameter.cs
- ListViewItemSelectionChangedEvent.cs
- DbConnectionClosed.cs
- SoapIncludeAttribute.cs
- TextBoxView.cs
- PerfService.cs
- ScrollBar.cs
- XmlSerializerVersionAttribute.cs
- NameSpaceEvent.cs
- DataGridHyperlinkColumn.cs
- StateWorkerRequest.cs
- BitmapEffectGroup.cs
- SplashScreenNativeMethods.cs
- WebControlsSection.cs
- ToolboxDataAttribute.cs
- PerformanceCounterPermissionEntryCollection.cs
- GridViewCancelEditEventArgs.cs
- SecurityValidationBehavior.cs
- InfoCardTraceRecord.cs
- DirectionalLight.cs
- ObjectListItemCollection.cs
- EnumMemberAttribute.cs
- ProfileService.cs
- ObjectConverter.cs
- XpsS0ValidatingLoader.cs
- KerberosSecurityTokenAuthenticator.cs
- SymbolEqualComparer.cs
- MemberDomainMap.cs
- SystemIPInterfaceProperties.cs
- DesignerToolStripControlHost.cs
- BindingContext.cs
- PanelStyle.cs
- ViewStateException.cs
- DecimalSumAggregationOperator.cs
- SymDocumentType.cs