Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // // 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
- PerfService.cs
- PersonalizationStateInfo.cs
- XPathNavigatorKeyComparer.cs
- ExtendedProtectionPolicy.cs
- BamlResourceDeserializer.cs
- ProjectionNode.cs
- EndOfStreamException.cs
- TypeForwardedFromAttribute.cs
- HttpCapabilitiesBase.cs
- securitycriticaldataClass.cs
- BitmapEffectGeneralTransform.cs
- PrintDialog.cs
- XmlSchemaParticle.cs
- AtlasWeb.Designer.cs
- _TLSstream.cs
- InstalledFontCollection.cs
- HtmlInputButton.cs
- Point3DAnimationBase.cs
- HttpCapabilitiesSectionHandler.cs
- TypeContext.cs
- VisualStyleTypesAndProperties.cs
- SelectionEditor.cs
- SHA512.cs
- Floater.cs
- DataGridViewDataErrorEventArgs.cs
- WindowInteractionStateTracker.cs
- ControlPaint.cs
- DataSourceControl.cs
- ISFClipboardData.cs
- XslTransformFileEditor.cs
- SQLInt32.cs
- sqlpipe.cs
- GridViewAutomationPeer.cs
- DataFormats.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- EditorZone.cs
- Evidence.cs
- AppModelKnownContentFactory.cs
- DbCommandDefinition.cs
- SectionRecord.cs
- ChangePassword.cs
- HttpConfigurationSystem.cs
- ELinqQueryState.cs
- Quaternion.cs
- DragEventArgs.cs
- IdentityNotMappedException.cs
- ApplicationBuildProvider.cs
- ObjectCache.cs
- UIAgentMonitor.cs
- SamlNameIdentifierClaimResource.cs
- PerformanceCountersBase.cs
- OleDbParameterCollection.cs
- CompositeKey.cs
- PeerCollaboration.cs
- HttpCapabilitiesBase.cs
- MsmqInputChannel.cs
- FixedDocumentSequencePaginator.cs
- NonVisualControlAttribute.cs
- NumberFunctions.cs
- NodeLabelEditEvent.cs
- ListView.cs
- BrushValueSerializer.cs
- cache.cs
- PolicyUnit.cs
- Effect.cs
- ConnectionStringSettingsCollection.cs
- BitmapCodecInfo.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- WebCategoryAttribute.cs
- WebCategoryAttribute.cs
- LayoutDump.cs
- DesignerLoader.cs
- SHA1Managed.cs
- GridViewSelectEventArgs.cs
- DeferredBinaryDeserializerExtension.cs
- ListViewInsertedEventArgs.cs
- DbProviderFactoriesConfigurationHandler.cs
- PlanCompiler.cs
- SymLanguageVendor.cs
- securitymgrsite.cs
- FileSystemEnumerable.cs
- PersistenceTask.cs
- HttpPostedFileWrapper.cs
- HitTestParameters3D.cs
- PublisherMembershipCondition.cs
- activationcontext.cs
- DisplayNameAttribute.cs
- MatrixCamera.cs
- Selection.cs
- ConnectionsZoneDesigner.cs
- FrameworkContentElement.cs
- WorkflowRuntimeServiceElement.cs
- XamlFigureLengthSerializer.cs
- AttributeProviderAttribute.cs
- GlyphCache.cs
- DocumentPageHost.cs
- CroppedBitmap.cs
- List.cs
- DefaultBindingPropertyAttribute.cs
- EncoderFallback.cs