Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- COM2PictureConverter.cs
- TranslateTransform.cs
- TraceRecord.cs
- ContextStack.cs
- ButtonAutomationPeer.cs
- ButtonBase.cs
- ContextMarshalException.cs
- SpeechSynthesizer.cs
- WebServiceTypeData.cs
- CompoundFileStreamReference.cs
- TrackBarRenderer.cs
- CacheForPrimitiveTypes.cs
- ACE.cs
- StateDesigner.Layouts.cs
- RunInstallerAttribute.cs
- DocumentSchemaValidator.cs
- OleDbRowUpdatedEvent.cs
- HttpCookieCollection.cs
- DirectionalLight.cs
- FontNameEditor.cs
- DirectoryInfo.cs
- AstTree.cs
- MatrixConverter.cs
- BamlRecordHelper.cs
- Debugger.cs
- NetWebProxyFinder.cs
- Vector3DCollection.cs
- DetailsViewDeletedEventArgs.cs
- BindingGroup.cs
- MobileCapabilities.cs
- FontUnitConverter.cs
- StringToken.cs
- ThicknessKeyFrameCollection.cs
- ClientFormsAuthenticationCredentials.cs
- DataRow.cs
- ComboBoxRenderer.cs
- AnnotationAdorner.cs
- TraceLevelStore.cs
- CharStorage.cs
- XsltException.cs
- PrincipalPermissionMode.cs
- ProgressBar.cs
- SecurityIdentifierElement.cs
- DataGridViewRowStateChangedEventArgs.cs
- CapabilitiesRule.cs
- Switch.cs
- XhtmlConformanceSection.cs
- EventEntry.cs
- TraceSection.cs
- InputLanguageProfileNotifySink.cs
- ValueTypeFixupInfo.cs
- GeometryHitTestResult.cs
- Bidi.cs
- IntegerFacetDescriptionElement.cs
- WebPartCancelEventArgs.cs
- CodeAttributeArgument.cs
- DataRow.cs
- BindingExpressionUncommonField.cs
- ConcatQueryOperator.cs
- FixedSOMPageElement.cs
- FileRecordSequenceHelper.cs
- ItemChangedEventArgs.cs
- OrderedHashRepartitionStream.cs
- MiniMapControl.xaml.cs
- VisualTreeUtils.cs
- ArgumentNullException.cs
- SmiXetterAccessMap.cs
- DBConcurrencyException.cs
- GridViewDeleteEventArgs.cs
- ListView.cs
- BlockCollection.cs
- DataControlField.cs
- RtfControls.cs
- EdmEntityTypeAttribute.cs
- AssemblyBuilder.cs
- Region.cs
- ConfigurationSettings.cs
- InstanceCreationEditor.cs
- DeviceSpecificChoiceCollection.cs
- ErrorRuntimeConfig.cs
- DataGridViewImageColumn.cs
- CqlLexerHelpers.cs
- ServicesUtilities.cs
- LinqDataSourceContextEventArgs.cs
- StylusShape.cs
- SafeThemeHandle.cs
- OutputScopeManager.cs
- TextPointerBase.cs
- FolderBrowserDialog.cs
- ByteStorage.cs
- RtType.cs
- WebPartsSection.cs
- CallSiteBinder.cs
- CategoryAttribute.cs
- GridEntryCollection.cs
- smtpconnection.cs
- TransformerTypeCollection.cs
- _DigestClient.cs
- Range.cs
- UnmanagedMemoryStream.cs