Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / 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. //---------------------------------------------------------------------------- // // 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
- storepermission.cs
- XmlKeywords.cs
- FolderBrowserDialog.cs
- StaticContext.cs
- KeyNotFoundException.cs
- ActiveXHelper.cs
- GuidelineCollection.cs
- PhysicalAddress.cs
- ThreadTrace.cs
- cookieexception.cs
- CLSCompliantAttribute.cs
- ProtocolsConfigurationHandler.cs
- DataGridPagerStyle.cs
- PartialArray.cs
- HtmlToClrEventProxy.cs
- CommonXSendMessage.cs
- DataGridTableCollection.cs
- WebPartConnectionsCloseVerb.cs
- SecurityCriticalDataForSet.cs
- LocalizationCodeDomSerializer.cs
- RegionIterator.cs
- HtmlHistory.cs
- InputScopeConverter.cs
- METAHEADER.cs
- HashMembershipCondition.cs
- WorkflowTransactionOptions.cs
- Typeface.cs
- SoapTypeAttribute.cs
- WebBrowserSiteBase.cs
- BooleanAnimationUsingKeyFrames.cs
- CopyNodeSetAction.cs
- Duration.cs
- EventLogPermission.cs
- WindowsTokenRoleProvider.cs
- NativeRightsManagementAPIsStructures.cs
- TaskHelper.cs
- WorkflowInstance.cs
- brushes.cs
- XsdCachingReader.cs
- Utility.cs
- LabelEditEvent.cs
- ListViewDeletedEventArgs.cs
- CustomExpressionEventArgs.cs
- hresults.cs
- DescendantBaseQuery.cs
- ExpandoObject.cs
- XPathNavigator.cs
- AsyncOperationManager.cs
- _ConnectOverlappedAsyncResult.cs
- RoleGroup.cs
- PageOutputQuality.cs
- SecurityKeyIdentifierClause.cs
- ControlPropertyNameConverter.cs
- RemoveStoryboard.cs
- DependencyObjectType.cs
- ProfileModule.cs
- RequestCacheValidator.cs
- PenThreadPool.cs
- BufferedStream.cs
- EventlogProvider.cs
- RsaKeyIdentifierClause.cs
- GeometryHitTestParameters.cs
- Matrix3DConverter.cs
- HotCommands.cs
- Content.cs
- SiteOfOriginContainer.cs
- HttpListenerElement.cs
- AssemblyResourceLoader.cs
- Unit.cs
- ReferencedType.cs
- ObjectStateFormatter.cs
- COM2TypeInfoProcessor.cs
- PackagePartCollection.cs
- GroupBoxAutomationPeer.cs
- XmlElementAttribute.cs
- HotCommands.cs
- TemporaryBitmapFile.cs
- TdsValueSetter.cs
- CorrelationExtension.cs
- MoveSizeWinEventHandler.cs
- XpsDigitalSignature.cs
- ByteAnimationUsingKeyFrames.cs
- ItemDragEvent.cs
- PointConverter.cs
- FieldNameLookup.cs
- FloaterParagraph.cs
- SecurityElement.cs
- InvalidDataContractException.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- PointLight.cs
- NonBatchDirectoryCompiler.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- GeneralTransform3D.cs
- ProgressiveCrcCalculatingStream.cs
- TokenFactoryFactory.cs
- WebPartZoneBase.cs
- ItemList.cs
- ThicknessAnimation.cs
- BaseCAMarshaler.cs
- RealProxy.cs