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
- Point4DConverter.cs
- SynchronousReceiveBehavior.cs
- TextComposition.cs
- DataMisalignedException.cs
- GB18030Encoding.cs
- HandoffBehavior.cs
- RowSpanVector.cs
- _AutoWebProxyScriptHelper.cs
- ScriptRegistrationManager.cs
- BamlLocalizer.cs
- StyleXamlTreeBuilder.cs
- PassportAuthenticationEventArgs.cs
- DataRowView.cs
- ReachBasicContext.cs
- HttpListenerException.cs
- InfiniteIntConverter.cs
- Stylesheet.cs
- KeyboardEventArgs.cs
- StructuredTypeEmitter.cs
- SqlDataReader.cs
- TextChangedEventArgs.cs
- ParallelTimeline.cs
- AxImporter.cs
- SQLUtility.cs
- DataGridSortCommandEventArgs.cs
- BulletChrome.cs
- ThreadAttributes.cs
- UTF32Encoding.cs
- Decimal.cs
- AvTraceFormat.cs
- ResourceDescriptionAttribute.cs
- HScrollBar.cs
- HideDisabledControlAdapter.cs
- NullableLongAverageAggregationOperator.cs
- ExpressionBinding.cs
- AsyncContentLoadedEventArgs.cs
- RegisteredScript.cs
- WriterOutput.cs
- ScrollEventArgs.cs
- LogWriteRestartAreaAsyncResult.cs
- Composition.cs
- SchemaImporterExtensionsSection.cs
- UIElementParaClient.cs
- RegexParser.cs
- SatelliteContractVersionAttribute.cs
- QuaternionAnimation.cs
- EntitySqlQueryCacheEntry.cs
- Size.cs
- ItemCollection.cs
- Timeline.cs
- RadioButtonRenderer.cs
- DefaultTraceListener.cs
- UIElementCollection.cs
- BuildResultCache.cs
- MenuAutomationPeer.cs
- UInt64.cs
- IList.cs
- StatusBarItem.cs
- ErrorHandlingAcceptor.cs
- UnsafeNativeMethods.cs
- ToolboxDataAttribute.cs
- BamlResourceDeserializer.cs
- FileEnumerator.cs
- HierarchicalDataTemplate.cs
- TempFiles.cs
- Viewport3DAutomationPeer.cs
- CharacterString.cs
- SecurityKeyIdentifier.cs
- QueryRewriter.cs
- OpenTypeLayoutCache.cs
- SqlCacheDependencyDatabaseCollection.cs
- CombinedHttpChannel.cs
- SqlDependencyListener.cs
- BuiltInExpr.cs
- CacheOutputQuery.cs
- TemplateParser.cs
- WeakReferenceEnumerator.cs
- FontCollection.cs
- ApplicationCommands.cs
- RowParagraph.cs
- TrackPoint.cs
- ChtmlCommandAdapter.cs
- PointCollection.cs
- RowSpanVector.cs
- HttpModuleActionCollection.cs
- LZCodec.cs
- EastAsianLunisolarCalendar.cs
- DataMember.cs
- OleDbCommand.cs
- DrawItemEvent.cs
- ReservationNotFoundException.cs
- SessionParameter.cs
- SecurityUtils.cs
- ClassicBorderDecorator.cs
- Binding.cs
- SoapAttributes.cs
- XmlNavigatorStack.cs
- BulletedList.cs
- ListViewTableCell.cs
- TableStyle.cs