Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / System / Windows / Markup / ServiceProviders.cs / 1305600 / 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; using MS.Internal.WindowsBase; ///////////////////////////////////////////////////////////////////////////////////////// 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
- OutputScopeManager.cs
- ObjectTag.cs
- GeneralTransform2DTo3DTo2D.cs
- CommentEmitter.cs
- XmlLinkedNode.cs
- Point.cs
- MouseButtonEventArgs.cs
- DirtyTextRange.cs
- DataRelationPropertyDescriptor.cs
- PerformanceCounterPermission.cs
- CustomPopupPlacement.cs
- ProcessInputEventArgs.cs
- AssociatedControlConverter.cs
- DbConnectionInternal.cs
- GetLedgerRequest.cs
- SessionParameter.cs
- ToolZone.cs
- AuthenticationManager.cs
- OutputCacheProfile.cs
- StatusBar.cs
- DateTimeSerializationSection.cs
- ActivationArguments.cs
- initElementDictionary.cs
- Floater.cs
- DockPanel.cs
- WorkflowRuntimeSection.cs
- DBCSCodePageEncoding.cs
- MatrixCamera.cs
- BitmapEncoder.cs
- ChannelManager.cs
- HttpCapabilitiesEvaluator.cs
- COAUTHIDENTITY.cs
- VideoDrawing.cs
- SoapFault.cs
- DesignUtil.cs
- MenuAdapter.cs
- Point3DCollection.cs
- UrlPath.cs
- XmlSchemaElement.cs
- CodePrimitiveExpression.cs
- DrawingContextDrawingContextWalker.cs
- UIElementParagraph.cs
- BitmapScalingModeValidation.cs
- SiteMapNode.cs
- ApplyHostConfigurationBehavior.cs
- WindowCollection.cs
- SerializationFieldInfo.cs
- ClickablePoint.cs
- ReadOnlyObservableCollection.cs
- SetState.cs
- NavigatorInput.cs
- ToolboxComponentsCreatingEventArgs.cs
- ThreadSafeMessageFilterTable.cs
- BindingOperations.cs
- ValidatingReaderNodeData.cs
- TextTreeRootTextBlock.cs
- DateTimeFormatInfoScanner.cs
- IDReferencePropertyAttribute.cs
- VerticalAlignConverter.cs
- PromptEventArgs.cs
- RefreshPropertiesAttribute.cs
- LiteralText.cs
- XmlWrappingReader.cs
- XsltSettings.cs
- WindowsProgressbar.cs
- OpCodes.cs
- Line.cs
- DiscriminatorMap.cs
- TabControl.cs
- CollectionExtensions.cs
- DecoratedNameAttribute.cs
- LineGeometry.cs
- PackageProperties.cs
- QilStrConcatenator.cs
- DeadCharTextComposition.cs
- CollectionsUtil.cs
- PolicyChain.cs
- TextFormatterImp.cs
- SqlConnectionHelper.cs
- Html32TextWriter.cs
- BrushValueSerializer.cs
- DuplicateWaitObjectException.cs
- IndicFontClient.cs
- FileDialog.cs
- Floater.cs
- RichTextBox.cs
- HandleCollector.cs
- IgnoreFileBuildProvider.cs
- SQLInt16Storage.cs
- StyleSelector.cs
- util.cs
- MethodImplAttribute.cs
- DbSetClause.cs
- WindowsListView.cs
- HMACMD5.cs
- WebExceptionStatus.cs
- IdentitySection.cs
- CodeMethodInvokeExpression.cs
- AbstractDataSvcMapFileLoader.cs
- TypeSystemProvider.cs