Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WindowsSolidBrush.cs
- Assert.cs
- EdmComplexTypeAttribute.cs
- XmlSchemaSimpleType.cs
- XmlQueryOutput.cs
- ClientConfigPaths.cs
- PassportAuthenticationEventArgs.cs
- XpsManager.cs
- TextBox.cs
- SemaphoreSecurity.cs
- SizeChangedEventArgs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DataSourceXmlAttributeAttribute.cs
- PrintEvent.cs
- XmlAnyElementAttribute.cs
- CompositeCollection.cs
- GradientStop.cs
- FieldAccessException.cs
- DrawingBrush.cs
- DrawingAttributeSerializer.cs
- IdentityManager.cs
- ObjectSecurityT.cs
- AxHost.cs
- ProxyWebPart.cs
- BindStream.cs
- OutputScope.cs
- EntityDataSourceEntitySetNameItem.cs
- DropDownList.cs
- DLinqTableProvider.cs
- QueryHandler.cs
- DictionaryEditChange.cs
- SmtpCommands.cs
- DrawingVisualDrawingContext.cs
- HttpGetClientProtocol.cs
- GenericUriParser.cs
- MultiAsyncResult.cs
- EditorPartChrome.cs
- OverlappedContext.cs
- ArrayMergeHelper.cs
- UnmanagedHandle.cs
- ResourceDictionaryCollection.cs
- webclient.cs
- Query.cs
- Menu.cs
- RangeValidator.cs
- StandardToolWindows.cs
- XamlToRtfParser.cs
- WizardPanel.cs
- RijndaelCryptoServiceProvider.cs
- MinimizableAttributeTypeConverter.cs
- FontStyles.cs
- PageSettings.cs
- IPEndPoint.cs
- HyperLinkColumn.cs
- ExtentJoinTreeNode.cs
- DirectionalLight.cs
- PolicyStatement.cs
- ConfigXmlWhitespace.cs
- RegexCapture.cs
- WebPartEventArgs.cs
- HtmlInputRadioButton.cs
- MenuItemBindingCollection.cs
- Transform.cs
- Thumb.cs
- WindowsScrollBar.cs
- ColumnBinding.cs
- Events.cs
- CharacterHit.cs
- Rect3DConverter.cs
- XmlSchemaAnyAttribute.cs
- IsolatedStoragePermission.cs
- SafeRightsManagementEnvironmentHandle.cs
- XsdCachingReader.cs
- HttpCookie.cs
- Material.cs
- TouchesOverProperty.cs
- TypeExtension.cs
- CollectionViewSource.cs
- MenuStrip.cs
- QilInvokeEarlyBound.cs
- CalendarAutoFormatDialog.cs
- MatrixAnimationBase.cs
- LineUtil.cs
- ReturnType.cs
- HtmlDocument.cs
- ParameterCollectionEditor.cs
- SynthesizerStateChangedEventArgs.cs
- SvcMapFileSerializer.cs
- FileBasedResourceGroveler.cs
- PrimaryKeyTypeConverter.cs
- KeyboardEventArgs.cs
- MouseGestureConverter.cs
- InstancePersistence.cs
- TakeOrSkipWhileQueryOperator.cs
- DifferencingCollection.cs
- WindowsButton.cs
- TextEmbeddedObject.cs
- AtlasWeb.Designer.cs
- DynamicResourceExtension.cs
- RootAction.cs