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
- MappingModelBuildProvider.cs
- RoutedUICommand.cs
- CommandHelper.cs
- SingleAnimationBase.cs
- SpeechAudioFormatInfo.cs
- mediaeventargs.cs
- ConnectorSelectionGlyph.cs
- CachedFontFamily.cs
- SpotLight.cs
- TemplateBuilder.cs
- PageContentAsyncResult.cs
- ResourceReferenceExpressionConverter.cs
- NetDataContractSerializer.cs
- BinaryFormatter.cs
- FrugalList.cs
- XmlValidatingReader.cs
- AnnotationMap.cs
- MailBnfHelper.cs
- DictionaryBase.cs
- StateWorkerRequest.cs
- EdmEntityTypeAttribute.cs
- RequestCachingSection.cs
- formatter.cs
- ResolveCriteriaCD1.cs
- StatusBarItem.cs
- ProxyWebPartConnectionCollection.cs
- MatrixTransform.cs
- BitConverter.cs
- UriWriter.cs
- NativeMethods.cs
- CancellationToken.cs
- Span.cs
- GroupBox.cs
- DesignerSerializationOptionsAttribute.cs
- ByteKeyFrameCollection.cs
- DesignTimeTemplateParser.cs
- HMACSHA256.cs
- Padding.cs
- PersonalizationDictionary.cs
- TextElementAutomationPeer.cs
- TimeoutException.cs
- ServiceOperationParameter.cs
- PriorityChain.cs
- FormViewRow.cs
- CodeSubDirectory.cs
- VirtualizingPanel.cs
- BinaryNode.cs
- TreeNodeBindingCollection.cs
- SqlMethods.cs
- ByteStreamGeometryContext.cs
- WizardPanel.cs
- CodePageUtils.cs
- InvalidPropValue.cs
- BufferBuilder.cs
- UInt64.cs
- TextWriterTraceListener.cs
- EditorPart.cs
- DataFieldCollectionEditor.cs
- NativeMethodsCLR.cs
- BinaryMessageFormatter.cs
- ByteArrayHelperWithString.cs
- SelectedDatesCollection.cs
- _DisconnectOverlappedAsyncResult.cs
- SoapSchemaMember.cs
- SQLDateTime.cs
- ExceptionUtil.cs
- ProcessHost.cs
- DefaultPrintController.cs
- RectangleConverter.cs
- Configuration.cs
- KeyProperty.cs
- GenericQueueSurrogate.cs
- TemplateLookupAction.cs
- Int16Converter.cs
- SymbolResolver.cs
- InArgumentConverter.cs
- ToolboxItem.cs
- XmlValidatingReader.cs
- ImageSource.cs
- WebSysDescriptionAttribute.cs
- CalendarDayButton.cs
- DataGridViewImageColumn.cs
- VirtualizedItemProviderWrapper.cs
- UserControl.cs
- ObservableCollection.cs
- LineInfo.cs
- FaultBookmark.cs
- login.cs
- RulePatternOps.cs
- RegionData.cs
- XmlDataSource.cs
- TypefaceCollection.cs
- XmlMembersMapping.cs
- DocumentPaginator.cs
- TextAutomationPeer.cs
- CodeExpressionStatement.cs
- ContainerUtilities.cs
- IndexedEnumerable.cs
- RawStylusActions.cs
- QueryOptionExpression.cs