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
- ConfigXmlCDataSection.cs
- ImageDrawing.cs
- SpotLight.cs
- SafeCoTaskMem.cs
- DataGridViewTextBoxCell.cs
- ToolStripManager.cs
- MenuItem.cs
- HeaderedContentControl.cs
- WebPartUtil.cs
- QuerySafeNavigator.cs
- TrackingStringDictionary.cs
- ConstraintCollection.cs
- BuildResultCache.cs
- AutoGeneratedFieldProperties.cs
- UidManager.cs
- DbConnectionPoolGroup.cs
- Crc32.cs
- InvalidPropValue.cs
- MemoryMappedViewAccessor.cs
- Size3DValueSerializer.cs
- XhtmlBasicLinkAdapter.cs
- TextServicesCompartmentEventSink.cs
- InteropBitmapSource.cs
- XPathDocument.cs
- ListCollectionView.cs
- ColorConverter.cs
- ItemTypeToolStripMenuItem.cs
- DirtyTextRange.cs
- MimeTypeMapper.cs
- DropDownButton.cs
- DecimalAnimationBase.cs
- Brush.cs
- XmlSchemaElement.cs
- HierarchicalDataBoundControlAdapter.cs
- MatchNoneMessageFilter.cs
- _NegoState.cs
- VisualBrush.cs
- ContainerParagraph.cs
- UriParserTemplates.cs
- NetworkAddressChange.cs
- SoapConverter.cs
- TextComposition.cs
- StorageAssociationSetMapping.cs
- CultureSpecificCharacterBufferRange.cs
- Route.cs
- dbenumerator.cs
- CodeTypeReferenceExpression.cs
- ResponseBodyWriter.cs
- Comparer.cs
- BaseDataBoundControlDesigner.cs
- ListControl.cs
- ValidatedControlConverter.cs
- UsernameTokenFactoryCredential.cs
- InputProcessorProfiles.cs
- Encoder.cs
- SuppressMergeCheckAttribute.cs
- SurrogateSelector.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- ButtonAutomationPeer.cs
- ISFTagAndGuidCache.cs
- TreeChangeInfo.cs
- CatalogPartChrome.cs
- RuleValidation.cs
- SkewTransform.cs
- ListBoxAutomationPeer.cs
- CacheAxisQuery.cs
- ComplexObject.cs
- FontConverter.cs
- ClientSettingsSection.cs
- ReadOnlyHierarchicalDataSourceView.cs
- HtmlCalendarAdapter.cs
- TokenBasedSet.cs
- MapPathBasedVirtualPathProvider.cs
- TextElementAutomationPeer.cs
- QilFunction.cs
- ExceptionHelpers.cs
- AsyncMethodInvoker.cs
- XdrBuilder.cs
- COAUTHIDENTITY.cs
- CommandCollectionEditor.cs
- FontClient.cs
- ListBase.cs
- ServiceProviders.cs
- DBAsyncResult.cs
- CompiledRegexRunner.cs
- PeerInputChannelListener.cs
- IndicFontClient.cs
- DataServiceResponse.cs
- RectangleGeometry.cs
- OdbcConnectionPoolProviderInfo.cs
- ToolStripSeparator.cs
- Debug.cs
- CommittableTransaction.cs
- XmlSchemaComplexContentRestriction.cs
- ViewService.cs
- MenuItemBinding.cs
- QilBinary.cs
- Facet.cs
- basemetadatamappingvisitor.cs
- SortDescriptionCollection.cs