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
- FormsIdentity.cs
- LoginCancelEventArgs.cs
- HostExecutionContextManager.cs
- FocusTracker.cs
- RemotingAttributes.cs
- ObjectConverter.cs
- CacheManager.cs
- Set.cs
- ContentPlaceHolder.cs
- TabControlCancelEvent.cs
- ApplicationProxyInternal.cs
- ValueTypeIndexerReference.cs
- ResourceExpression.cs
- OperationInvokerBehavior.cs
- DesignerForm.cs
- EventMappingSettings.cs
- ExtensibleSyndicationObject.cs
- BaseTypeViewSchema.cs
- FullTextLine.cs
- TextModifierScope.cs
- CommonDialog.cs
- OutputCacheProfileCollection.cs
- ObjectPersistData.cs
- HttpContextBase.cs
- MissingManifestResourceException.cs
- XmlQueryType.cs
- BaseCAMarshaler.cs
- PolyLineSegment.cs
- HttpCookieCollection.cs
- PreservationFileWriter.cs
- GatewayIPAddressInformationCollection.cs
- DesignerPerfEventProvider.cs
- XmlUtf8RawTextWriter.cs
- ProgressBarAutomationPeer.cs
- Expression.cs
- ZoneLinkButton.cs
- Pen.cs
- SystemParameters.cs
- FontSourceCollection.cs
- CompositeFontFamily.cs
- TraceSection.cs
- SqlMetaData.cs
- MouseGestureValueSerializer.cs
- XmlSiteMapProvider.cs
- Operand.cs
- EncodingNLS.cs
- ImportOptions.cs
- CodeDomConfigurationHandler.cs
- DeferredReference.cs
- XmlWriter.cs
- ConsoleEntryPoint.cs
- XPathSelectionIterator.cs
- oledbmetadatacollectionnames.cs
- CaseCqlBlock.cs
- PriorityQueue.cs
- Inflater.cs
- OracleConnection.cs
- StringFreezingAttribute.cs
- CompModSwitches.cs
- TdsParserSafeHandles.cs
- FixedPageStructure.cs
- BrowserDefinitionCollection.cs
- NegatedConstant.cs
- Decorator.cs
- DataServiceHost.cs
- CompiledRegexRunnerFactory.cs
- IndentTextWriter.cs
- BuildManager.cs
- ToolStripDropDownMenu.cs
- EmbeddedMailObjectCollectionEditor.cs
- MgmtConfigurationRecord.cs
- TableChangeProcessor.cs
- XmlDeclaration.cs
- PermissionToken.cs
- FixedSOMTextRun.cs
- ScriptManager.cs
- XmlSchemaAnnotated.cs
- DbConnectionFactory.cs
- RegexGroupCollection.cs
- DataGridItemCollection.cs
- CodeAccessSecurityEngine.cs
- SmtpLoginAuthenticationModule.cs
- CollaborationHelperFunctions.cs
- SerializerDescriptor.cs
- TableAdapterManagerNameHandler.cs
- ActivationServices.cs
- XmlAnyElementAttributes.cs
- Window.cs
- CreateWorkflowOwnerCommand.cs
- DataRowCollection.cs
- CodeDomDesignerLoader.cs
- PersonalizableTypeEntry.cs
- GeometryHitTestResult.cs
- ComEventsHelper.cs
- XmlUtf8RawTextWriter.cs
- InheritablePropertyChangeInfo.cs
- DataControlButton.cs
- DataGridViewRowCancelEventArgs.cs
- PaintValueEventArgs.cs
- SqlRetyper.cs