Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- MgmtConfigurationRecord.cs
- LZCodec.cs
- X509InitiatorCertificateClientElement.cs
- XPathEmptyIterator.cs
- AppSecurityManager.cs
- Automation.cs
- ParallelTimeline.cs
- ConfigurationManagerInternalFactory.cs
- EmitterCache.cs
- ServiceMetadataPublishingElement.cs
- ListBindingConverter.cs
- SafeThemeHandle.cs
- ServiceObjectContainer.cs
- EntityTypeBase.cs
- ReplyChannel.cs
- UIAgentAsyncBeginRequest.cs
- XmlAttribute.cs
- OdbcHandle.cs
- NameValuePermission.cs
- PathFigureCollectionValueSerializer.cs
- DataQuery.cs
- ProxyWebPartConnectionCollection.cs
- IdentitySection.cs
- FlowDocumentScrollViewer.cs
- DataSetUtil.cs
- XmlnsCache.cs
- VirtualDirectoryMapping.cs
- GcSettings.cs
- KeyedHashAlgorithm.cs
- DataListItem.cs
- WebWorkflowRole.cs
- ChildChangedEventArgs.cs
- PageRouteHandler.cs
- IndicShape.cs
- XmlWriter.cs
- CounterCreationData.cs
- XmlSchemaCompilationSettings.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- UnaryNode.cs
- ReceiveActivity.cs
- TimerElapsedEvenArgs.cs
- UserUseLicenseDictionaryLoader.cs
- EncoderExceptionFallback.cs
- ScriptIgnoreAttribute.cs
- DependencyPropertyKey.cs
- Matrix.cs
- ObjectCloneHelper.cs
- GridLengthConverter.cs
- LexicalChunk.cs
- AttributeUsageAttribute.cs
- AffineTransform3D.cs
- LicenseManager.cs
- DescendantQuery.cs
- SiteMapDataSource.cs
- BamlTreeUpdater.cs
- SpecialNameAttribute.cs
- UnsafeNativeMethods.cs
- BevelBitmapEffect.cs
- WindowProviderWrapper.cs
- EntityDataSourceStatementEditor.cs
- SymmetricAlgorithm.cs
- WizardSideBarListControlItem.cs
- MimeTypeMapper.cs
- DbDeleteCommandTree.cs
- ListItemConverter.cs
- TextElement.cs
- Conditional.cs
- TreeViewDesigner.cs
- ClientProtocol.cs
- ParameterInfo.cs
- SecurityMode.cs
- EdmType.cs
- SimpleHandlerBuildProvider.cs
- StubHelpers.cs
- DBCommand.cs
- FontNamesConverter.cs
- MLangCodePageEncoding.cs
- FlowLayoutPanel.cs
- WindowsRichEdit.cs
- CodeAccessSecurityEngine.cs
- XsltContext.cs
- XmlNamedNodeMap.cs
- InstanceHandle.cs
- SimplePropertyEntry.cs
- SmiRecordBuffer.cs
- StylusDevice.cs
- CacheVirtualItemsEvent.cs
- WindowsTab.cs
- SelectionList.cs
- TemplateAction.cs
- Transform.cs
- EntitySqlQueryCacheEntry.cs
- SubMenuStyleCollection.cs
- COM2PropertyBuilderUITypeEditor.cs
- EntityStoreSchemaFilterEntry.cs
- COM2PictureConverter.cs
- regiisutil.cs
- ItemsPanelTemplate.cs
- InkCanvasAutomationPeer.cs
- DataGridViewCellStyleChangedEventArgs.cs