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
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- Win32.cs
- ExtensionFile.cs
- HostingMessageProperty.cs
- ResourceLoader.cs
- ActivatableWorkflowsQueryResult.cs
- SqlXmlStorage.cs
- WebPartTransformerCollection.cs
- ZipIOModeEnforcingStream.cs
- WebPartTracker.cs
- SafeHandle.cs
- SQlBooleanStorage.cs
- TableParagraph.cs
- MissingMethodException.cs
- SortedDictionary.cs
- AggregateNode.cs
- ProxyWebPartConnectionCollection.cs
- DataGridHeaderBorder.cs
- FileLogRecordHeader.cs
- SeparatorAutomationPeer.cs
- HtmlLink.cs
- SecurityManager.cs
- RuleSettingsCollection.cs
- SafeCoTaskMem.cs
- DoubleLink.cs
- UriTemplateEquivalenceComparer.cs
- TextRangeEditLists.cs
- ToolStripSeparatorRenderEventArgs.cs
- DataFieldEditor.cs
- CommandManager.cs
- ServiceDocument.cs
- BamlRecordWriter.cs
- PhonemeConverter.cs
- ButtonBaseAutomationPeer.cs
- IndexerReference.cs
- WindowPatternIdentifiers.cs
- MenuItemStyle.cs
- DrawingImage.cs
- Section.cs
- Condition.cs
- FamilyTypeface.cs
- ContentFileHelper.cs
- LoginCancelEventArgs.cs
- HelpExampleGenerator.cs
- ContentDefinition.cs
- FixedDocument.cs
- ContractType.cs
- CommentEmitter.cs
- RightsManagementErrorHandler.cs
- GregorianCalendarHelper.cs
- BindingCompleteEventArgs.cs
- JsonServiceDocumentSerializer.cs
- COM2PropertyDescriptor.cs
- _HTTPDateParse.cs
- FieldTemplateFactory.cs
- OleCmdHelper.cs
- LogConverter.cs
- SchemaTableOptionalColumn.cs
- WindowsGraphics.cs
- WebPartConnectVerb.cs
- RawKeyboardInputReport.cs
- BindingContext.cs
- ActivityScheduledRecord.cs
- EdmProperty.cs
- ConsumerConnectionPoint.cs
- DelegateHelpers.cs
- QueryOperationResponseOfT.cs
- ZoneButton.cs
- EndpointConfigContainer.cs
- WindowsPrincipal.cs
- unsafenativemethodstextservices.cs
- WhitespaceSignificantCollectionAttribute.cs
- Animatable.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- FileSystemInfo.cs
- AssemblyBuilderData.cs
- ConfigurationStrings.cs
- StateChangeEvent.cs
- OleDbError.cs
- ControlDesigner.cs
- ComboBox.cs
- Encoder.cs
- Mappings.cs
- ColorTranslator.cs
- SafeArrayTypeMismatchException.cs
- OpenTypeCommon.cs
- ResourceIDHelper.cs
- ListViewGroupCollectionEditor.cs
- DeadCharTextComposition.cs
- MessageContractAttribute.cs
- MatrixAnimationUsingKeyFrames.cs
- CodeCommentStatementCollection.cs
- SystemPens.cs
- _ConnectOverlappedAsyncResult.cs
- PinnedBufferMemoryStream.cs
- SwitchCase.cs
- AssemblyNameProxy.cs
- SchemaSetCompiler.cs
- TemplatePartAttribute.cs
- PublishLicense.cs