Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / System / Windows / Markup / ServiceProviders.cs / 1 / 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; ///////////////////////////////////////////////////////////////////////////////////////// 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
- TextSpan.cs
- GroupByQueryOperator.cs
- FixedSOMTableCell.cs
- Constants.cs
- CommandSet.cs
- BroadcastEventHelper.cs
- PresentationTraceSources.cs
- CompositeDuplexElement.cs
- WebPartManagerInternals.cs
- CryptoStream.cs
- WebPartVerbCollection.cs
- BaseCollection.cs
- SafeEventLogWriteHandle.cs
- Win32Exception.cs
- InfiniteTimeSpanConverter.cs
- Int16KeyFrameCollection.cs
- SuppressIldasmAttribute.cs
- SqlNotificationRequest.cs
- WsdlBuildProvider.cs
- ColorTranslator.cs
- GetChildSubtree.cs
- FilterableAttribute.cs
- ConfigurationSectionCollection.cs
- Control.cs
- SimpleWebHandlerParser.cs
- WindowsListViewGroup.cs
- CaseKeyBox.ViewModel.cs
- ProfileEventArgs.cs
- StorageInfo.cs
- SettingsBase.cs
- WindowsPrincipal.cs
- FieldDescriptor.cs
- ToolZone.cs
- HttpProfileBase.cs
- XslNumber.cs
- PhonemeConverter.cs
- TimeIntervalCollection.cs
- CrossContextChannel.cs
- PnrpPermission.cs
- CustomAttributeSerializer.cs
- FlowDocument.cs
- PrintingPermission.cs
- MarshalByRefObject.cs
- SQLDecimalStorage.cs
- ImageClickEventArgs.cs
- RecommendedAsConfigurableAttribute.cs
- URIFormatException.cs
- ZipIORawDataFileBlock.cs
- StorageSetMapping.cs
- MenuItemCollection.cs
- MemberPath.cs
- Imaging.cs
- QuaternionRotation3D.cs
- CombinedGeometry.cs
- DbConnectionStringCommon.cs
- EventToken.cs
- RightsManagementProvider.cs
- XslCompiledTransform.cs
- LineMetrics.cs
- RequestDescription.cs
- CheckBoxList.cs
- XmlNodeReader.cs
- ItemCollection.cs
- UnhandledExceptionEventArgs.cs
- XhtmlTextWriter.cs
- EntityEntry.cs
- AssemblyInfo.cs
- WorkflowInstanceExtensionManager.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ForceCopyBuildProvider.cs
- TagPrefixInfo.cs
- ImagingCache.cs
- GraphicsPath.cs
- LayoutSettings.cs
- EntityClientCacheEntry.cs
- ClientFormsAuthenticationCredentials.cs
- ExecutionContext.cs
- StopStoryboard.cs
- PreparingEnlistment.cs
- ApplicationProxyInternal.cs
- ApplicationServiceManager.cs
- FileDialogPermission.cs
- MyContact.cs
- sqlser.cs
- IntranetCredentialPolicy.cs
- SqlUnionizer.cs
- PartManifestEntry.cs
- FileVersionInfo.cs
- CustomAttributeBuilder.cs
- RIPEMD160Managed.cs
- Color.cs
- InvalidOleVariantTypeException.cs
- ThreadSafeList.cs
- DataSourceBooleanViewSchemaConverter.cs
- SelectedDatesCollection.cs
- SerializationFieldInfo.cs
- SystemPens.cs
- mda.cs
- TableItemPatternIdentifiers.cs
- NetStream.cs