Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- ReceiveCompletedEventArgs.cs
- Popup.cs
- ArgumentValidation.cs
- SystemBrushes.cs
- DateTimePicker.cs
- SimpleApplicationHost.cs
- XmlTextReaderImpl.cs
- MultipleFilterMatchesException.cs
- Label.cs
- TextElementEnumerator.cs
- TargetPerspective.cs
- WindowPattern.cs
- SessionStateModule.cs
- AuthenticatingEventArgs.cs
- AxisAngleRotation3D.cs
- SubpageParaClient.cs
- FaultDescription.cs
- PeerPresenceInfo.cs
- DataTableMapping.cs
- ProxyWebPartManager.cs
- Point4DConverter.cs
- DataGridViewTextBoxColumn.cs
- Error.cs
- KeyValueInternalCollection.cs
- AssociationSetEnd.cs
- IsolatedStorageFilePermission.cs
- DirtyTextRange.cs
- UnionCodeGroup.cs
- VectorValueSerializer.cs
- MatrixCamera.cs
- Point3DCollection.cs
- AuthenticationModuleElement.cs
- DescendentsWalkerBase.cs
- ContextStack.cs
- ChangePasswordAutoFormat.cs
- TableParagraph.cs
- ParameterToken.cs
- TextPattern.cs
- SHA384Managed.cs
- UnaryNode.cs
- SqlCacheDependencyDatabaseCollection.cs
- cookie.cs
- pingexception.cs
- HtmlEmptyTagControlBuilder.cs
- TransferRequestHandler.cs
- MessageDesigner.cs
- DocumentPage.cs
- XmlComplianceUtil.cs
- XmlConvert.cs
- CustomLineCap.cs
- InstalledFontCollection.cs
- TypeReference.cs
- UnsafeNativeMethods.cs
- X509WindowsSecurityToken.cs
- KeyboardDevice.cs
- WindowsListViewGroup.cs
- Point3D.cs
- RuntimeCompatibilityAttribute.cs
- MonitoringDescriptionAttribute.cs
- Border.cs
- IfAction.cs
- TransactionContext.cs
- ToolStripItemRenderEventArgs.cs
- DependencyObjectPropertyDescriptor.cs
- PageCodeDomTreeGenerator.cs
- FormattedTextSymbols.cs
- TextRangeEdit.cs
- DiagnosticTrace.cs
- StdRegProviderWrapper.cs
- FilteredDataSetHelper.cs
- RadioButton.cs
- BinaryWriter.cs
- MemberInfoSerializationHolder.cs
- XmlException.cs
- HostedHttpRequestAsyncResult.cs
- HtmlShim.cs
- AttributeSetAction.cs
- BitmapCache.cs
- Baml2006Reader.cs
- HttpResponseHeader.cs
- SocketInformation.cs
- CorrelationTokenInvalidatedHandler.cs
- StyleTypedPropertyAttribute.cs
- InstanceCreationEditor.cs
- CharacterHit.cs
- CustomLineCap.cs
- SRGSCompiler.cs
- StateWorkerRequest.cs
- Literal.cs
- XmlSchemaRedefine.cs
- XamlInt32CollectionSerializer.cs
- ArrayExtension.cs
- IgnoreFlushAndCloseStream.cs
- ExpressionList.cs
- SqlStatistics.cs
- DesignerActionUIService.cs
- QilTargetType.cs
- DataBoundLiteralControl.cs
- UnmanagedMemoryStreamWrapper.cs
- PropertyChangedEventManager.cs