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
- DefaultAuthorizationContext.cs
- TargetControlTypeAttribute.cs
- PingOptions.cs
- TransactionInterop.cs
- ManualResetEvent.cs
- ArgumentDesigner.xaml.cs
- TypeDelegator.cs
- DataGridViewRowsAddedEventArgs.cs
- CommandEventArgs.cs
- WizardPanelChangingEventArgs.cs
- AmbientLight.cs
- WeakReferenceKey.cs
- OracleBFile.cs
- MLangCodePageEncoding.cs
- FormParameter.cs
- HandlerFactoryWrapper.cs
- WebPartDisplayModeCancelEventArgs.cs
- HWStack.cs
- GridViewSelectEventArgs.cs
- ExpressionsCollectionEditor.cs
- Vector3DIndependentAnimationStorage.cs
- StrokeRenderer.cs
- QueryCursorEventArgs.cs
- IOException.cs
- UInt64.cs
- Token.cs
- PathParser.cs
- AttributeProviderAttribute.cs
- ConfigurationStrings.cs
- TrackingProfileCache.cs
- DependencySource.cs
- GetWorkflowTree.cs
- WebPartZone.cs
- ChildChangedEventArgs.cs
- SatelliteContractVersionAttribute.cs
- ZipIORawDataFileBlock.cs
- CultureTableRecord.cs
- BuiltInExpr.cs
- EventLogWatcher.cs
- SocketException.cs
- EntityStoreSchemaGenerator.cs
- SafeNativeMethods.cs
- SystemUnicastIPAddressInformation.cs
- WizardDesigner.cs
- EllipseGeometry.cs
- ToolboxItemFilterAttribute.cs
- IIS7WorkerRequest.cs
- DataRowComparer.cs
- TemplateBamlRecordReader.cs
- SevenBitStream.cs
- ToolTipAutomationPeer.cs
- SemanticResultKey.cs
- baseaxisquery.cs
- PauseStoryboard.cs
- VoiceSynthesis.cs
- ReflectionServiceProvider.cs
- XpsFilter.cs
- TaiwanLunisolarCalendar.cs
- WrappedIUnknown.cs
- PictureBox.cs
- RubberbandSelector.cs
- WebBrowserProgressChangedEventHandler.cs
- WpfMemberInvoker.cs
- DataTableExtensions.cs
- EventLogRecord.cs
- DataGridViewAdvancedBorderStyle.cs
- QueryContinueDragEventArgs.cs
- ExpressionHelper.cs
- OrCondition.cs
- AssociatedControlConverter.cs
- StylusEditingBehavior.cs
- DbDataReader.cs
- StreamWithDictionary.cs
- EntityType.cs
- TableItemPatternIdentifiers.cs
- HttpRequestTraceRecord.cs
- PathTooLongException.cs
- MSAAWinEventWrap.cs
- RolePrincipal.cs
- DecimalMinMaxAggregationOperator.cs
- CompilerGlobalScopeAttribute.cs
- ResolvedKeyFrameEntry.cs
- CodeThrowExceptionStatement.cs
- SystemWebCachingSectionGroup.cs
- WebServiceResponseDesigner.cs
- CodeComment.cs
- SafeRightsManagementQueryHandle.cs
- Light.cs
- DetailsViewModeEventArgs.cs
- CompensationHandlingFilter.cs
- ProcessThread.cs
- FormatStringEditor.cs
- UnionExpr.cs
- LocationUpdates.cs
- WinCategoryAttribute.cs
- PathFigure.cs
- WebPartRestoreVerb.cs
- MemberMemberBinding.cs
- FontCacheLogic.cs
- UnmanagedMarshal.cs