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
- ProbeMatchesCD1.cs
- WindowsFormsHost.cs
- Sentence.cs
- LinkConverter.cs
- IPAddressCollection.cs
- FieldAccessException.cs
- UpDownBaseDesigner.cs
- WmlTextBoxAdapter.cs
- FontFamilyIdentifier.cs
- LocalBuilder.cs
- LoginView.cs
- JsonWriter.cs
- DataKeyArray.cs
- SqlLiftIndependentRowExpressions.cs
- Transactions.cs
- ExeContext.cs
- PngBitmapEncoder.cs
- FixedHyperLink.cs
- RadioButton.cs
- PropertyTabAttribute.cs
- Activity.cs
- Pair.cs
- mediaeventshelper.cs
- SystemWebCachingSectionGroup.cs
- SystemBrushes.cs
- SafeNativeMethods.cs
- XslVisitor.cs
- CodeDefaultValueExpression.cs
- LinkUtilities.cs
- ProfileProvider.cs
- TimeSpanConverter.cs
- EventMap.cs
- Soap12ProtocolReflector.cs
- SettingsSavedEventArgs.cs
- IProvider.cs
- ActivationArguments.cs
- ListViewAutomationPeer.cs
- PeerHelpers.cs
- BooleanSwitch.cs
- QuaternionAnimationUsingKeyFrames.cs
- XmlDataSourceNodeDescriptor.cs
- ProxyWebPartConnectionCollection.cs
- BindToObject.cs
- FlowDocument.cs
- DetailsViewPagerRow.cs
- EdmType.cs
- OleDbErrorCollection.cs
- ProfileServiceManager.cs
- ExpressionVisitorHelpers.cs
- BoundConstants.cs
- ChangeNode.cs
- MediaElement.cs
- EditorPartChrome.cs
- Semaphore.cs
- ProxyAttribute.cs
- EdmItemCollection.cs
- ComplexType.cs
- BrowserCapabilitiesCompiler.cs
- CursorInteropHelper.cs
- DisplayInformation.cs
- InvocationExpression.cs
- MouseDevice.cs
- MergeFilterQuery.cs
- LineBreak.cs
- AttributeSetAction.cs
- ByteAnimationUsingKeyFrames.cs
- TryCatchDesigner.xaml.cs
- SoapSchemaExporter.cs
- TypeConverterHelper.cs
- StrokeNodeOperations2.cs
- SystemIPAddressInformation.cs
- StorageRoot.cs
- DataGridColumnCollection.cs
- LineBreakRecord.cs
- baseaxisquery.cs
- AddInDeploymentState.cs
- linebase.cs
- ToolStripDropDownButton.cs
- Avt.cs
- Selector.cs
- ThreadWorkerController.cs
- SimpleTextLine.cs
- TableLayoutSettings.cs
- RenameRuleObjectDialog.cs
- CacheMemory.cs
- EmbeddedMailObjectsCollection.cs
- BufferedGraphicsManager.cs
- DocumentApplicationState.cs
- XpsFont.cs
- InvalidComObjectException.cs
- DebugController.cs
- EllipseGeometry.cs
- SmtpLoginAuthenticationModule.cs
- XmlSchemaRedefine.cs
- StoragePropertyMapping.cs
- SqlNodeAnnotation.cs
- ListViewInsertEventArgs.cs
- WebPartManagerDesigner.cs
- EventBuilder.cs
- EditingCoordinator.cs