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
- MimeReflector.cs
- ByteFacetDescriptionElement.cs
- ProviderConnectionPoint.cs
- VerticalAlignConverter.cs
- ServiceDescriptionData.cs
- PathFigure.cs
- StringFreezingAttribute.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- BackgroundWorker.cs
- InstanceNotReadyException.cs
- URI.cs
- PeerTransportElement.cs
- TypeTypeConverter.cs
- metadatamappinghashervisitor.cs
- FieldTemplateUserControl.cs
- OrderedDictionary.cs
- DCSafeHandle.cs
- LoginName.cs
- StreamWithDictionary.cs
- PageStatePersister.cs
- FormClosedEvent.cs
- Keywords.cs
- PrintDocument.cs
- CurrencyManager.cs
- DrawingGroup.cs
- CompilerGeneratedAttribute.cs
- XmlSchemaIdentityConstraint.cs
- SqlInternalConnectionTds.cs
- CustomCategoryAttribute.cs
- CacheEntry.cs
- StreamingContext.cs
- HostingEnvironmentSection.cs
- ScrollChrome.cs
- Model3DGroup.cs
- BinaryParser.cs
- MobileRedirect.cs
- VariableDesigner.xaml.cs
- RsaSecurityKey.cs
- DataObject.cs
- DataReaderContainer.cs
- XPathItem.cs
- DictionaryItemsCollection.cs
- ExcludePathInfo.cs
- DynamicILGenerator.cs
- TreeViewImageKeyConverter.cs
- JsonGlobals.cs
- ScrollBarAutomationPeer.cs
- TextRangeBase.cs
- LocalBuilder.cs
- XmlAnyAttributeAttribute.cs
- HttpGetProtocolImporter.cs
- connectionpool.cs
- PlainXmlWriter.cs
- CheckBoxBaseAdapter.cs
- WindowsBrush.cs
- OperatingSystem.cs
- BrowserCapabilitiesFactoryBase.cs
- HtmlInputPassword.cs
- XamlClipboardData.cs
- CircleHotSpot.cs
- RawStylusInputCustomData.cs
- OutputScope.cs
- X509ChainPolicy.cs
- ProtocolsConfigurationHandler.cs
- EventManager.cs
- QilXmlWriter.cs
- StorageInfo.cs
- CompilerErrorCollection.cs
- PropertyMapper.cs
- Registration.cs
- XpsS0ValidatingLoader.cs
- safesecurityhelperavalon.cs
- FaultImportOptions.cs
- FormViewModeEventArgs.cs
- StorageModelBuildProvider.cs
- ObjectDisposedException.cs
- HtmlInputText.cs
- DataRecordInternal.cs
- SiteMapSection.cs
- DataGridViewColumn.cs
- NativeMethods.cs
- SynchronizedDispatch.cs
- FileChangesMonitor.cs
- DateTimeFormatInfo.cs
- MessageProtectionOrder.cs
- FunctionNode.cs
- ColumnClickEvent.cs
- DataControlFieldHeaderCell.cs
- ContextDataSourceContextData.cs
- ReachFixedDocumentSerializer.cs
- ClientUtils.cs
- Utils.cs
- DataServiceQuery.cs
- BuildProviderCollection.cs
- HttpSocketManager.cs
- ConnectionInterfaceCollection.cs
- TextBoxBase.cs
- panel.cs
- SqlParameter.cs
- ValidatedControlConverter.cs