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
- BitmapSourceSafeMILHandle.cs
- NumericExpr.cs
- TableCell.cs
- Scheduling.cs
- PersistenceException.cs
- XamlPoint3DCollectionSerializer.cs
- ConsoleCancelEventArgs.cs
- XAMLParseException.cs
- Queue.cs
- ACL.cs
- IDispatchConstantAttribute.cs
- ServiceActivationException.cs
- UpdatePanel.cs
- TreeNodeStyle.cs
- ColorMap.cs
- SqlUtil.cs
- RSAProtectedConfigurationProvider.cs
- SingleAnimationBase.cs
- XPathNavigatorKeyComparer.cs
- XmlSignatureManifest.cs
- ZipIOExtraField.cs
- MetadataUtil.cs
- TextBoxDesigner.cs
- SqlDependencyUtils.cs
- BitmapMetadataEnumerator.cs
- Config.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- HandlerFactoryWrapper.cs
- CreateSequence.cs
- FileChangeNotifier.cs
- ReadingWritingEntityEventArgs.cs
- InputBinder.cs
- TrackingProfile.cs
- NativeMethods.cs
- TableAdapterManagerHelper.cs
- MemoryMappedView.cs
- SqlCommandBuilder.cs
- WsatAdminException.cs
- ParamArrayAttribute.cs
- IconBitmapDecoder.cs
- GlyphInfoList.cs
- XslException.cs
- TraceRecord.cs
- OperandQuery.cs
- LockedHandleGlyph.cs
- Internal.cs
- HandledMouseEvent.cs
- DocumentViewerBase.cs
- HashCodeCombiner.cs
- ItemMap.cs
- ContractCodeDomInfo.cs
- StorageMappingItemLoader.cs
- FormattedTextSymbols.cs
- UserValidatedEventArgs.cs
- GridViewSortEventArgs.cs
- ReverseInheritProperty.cs
- NetSectionGroup.cs
- HttpListenerPrefixCollection.cs
- DefinitionBase.cs
- LayoutManager.cs
- XmlAttributeAttribute.cs
- PropertyMap.cs
- XamlClipboardData.cs
- TextWriterEngine.cs
- XmlSchemaValidator.cs
- ToolStripAdornerWindowService.cs
- DataGridPagerStyle.cs
- WebBrowserNavigatingEventHandler.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- QueryReaderSettings.cs
- BamlBinaryReader.cs
- BindingBase.cs
- CLSCompliantAttribute.cs
- RecordBuilder.cs
- StaticFileHandler.cs
- Point4DValueSerializer.cs
- AdPostCacheSubstitution.cs
- TaiwanCalendar.cs
- FloaterParaClient.cs
- PropertyStore.cs
- Image.cs
- VirtualPathData.cs
- DateTimeStorage.cs
- DataStorage.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- CodeArrayCreateExpression.cs
- TextServicesManager.cs
- HashCodeCombiner.cs
- StreamInfo.cs
- UrlMappingsModule.cs
- PasswordBox.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- DocumentViewerAutomationPeer.cs
- DragStartedEventArgs.cs
- WebBrowserHelper.cs
- HandlerBase.cs
- DataGridViewColumnStateChangedEventArgs.cs
- Figure.cs
- BamlLocalizabilityResolver.cs
- EditorPart.cs