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
- ComponentChangingEvent.cs
- Console.cs
- TrustManager.cs
- MenuItem.cs
- DynamicILGenerator.cs
- TimeSpanSecondsConverter.cs
- ConnectionString.cs
- CompositeCollection.cs
- TableColumn.cs
- ByteKeyFrameCollection.cs
- Random.cs
- TemplateEditingFrame.cs
- ProgressBarBrushConverter.cs
- DataTableCollection.cs
- SortDescription.cs
- Transform.cs
- ItemMap.cs
- NetworkCredential.cs
- MD5HashHelper.cs
- CompareValidator.cs
- Semaphore.cs
- EFDataModelProvider.cs
- ObjectFullSpanRewriter.cs
- CatalogPart.cs
- login.cs
- ColumnCollection.cs
- OptimizedTemplateContentHelper.cs
- ValidationErrorCollection.cs
- ListViewContainer.cs
- OverrideMode.cs
- InputScope.cs
- ValidationEventArgs.cs
- NotSupportedException.cs
- util.cs
- RadioButton.cs
- PrintPageEvent.cs
- SrgsText.cs
- CursorConverter.cs
- EndEvent.cs
- CodeSnippetStatement.cs
- CompilerScopeManager.cs
- AsymmetricSignatureFormatter.cs
- ADConnectionHelper.cs
- PropertyIDSet.cs
- CompareInfo.cs
- NonVisualControlAttribute.cs
- WeakReferenceList.cs
- InlineUIContainer.cs
- TableHeaderCell.cs
- StreamReader.cs
- LinqDataView.cs
- DbConnectionOptions.cs
- DateTimeStorage.cs
- SmiRequestExecutor.cs
- MSHTMLHost.cs
- KeyValuePair.cs
- WebSysDisplayNameAttribute.cs
- XPathEmptyIterator.cs
- XmlNode.cs
- BitmapPalettes.cs
- LongValidatorAttribute.cs
- SubMenuStyleCollectionEditor.cs
- ImageSourceConverter.cs
- EntitySqlQueryState.cs
- StatusBar.cs
- TerminatorSinks.cs
- Size3DValueSerializer.cs
- TimeZone.cs
- AttachedPropertyInfo.cs
- DataControlHelper.cs
- NameValuePair.cs
- OraclePermission.cs
- AuthenticationException.cs
- ControlAdapter.cs
- SectionRecord.cs
- ConditionalWeakTable.cs
- VectorAnimationBase.cs
- CommandConverter.cs
- SafeLocalMemHandle.cs
- ZipFileInfoCollection.cs
- XmlObjectSerializerReadContext.cs
- RandomNumberGenerator.cs
- MsmqIntegrationSecurityMode.cs
- VisemeEventArgs.cs
- ThreadAttributes.cs
- SslSecurityTokenParameters.cs
- ElementUtil.cs
- Int16Animation.cs
- RoutingBehavior.cs
- ProcessHostServerConfig.cs
- FormViewCommandEventArgs.cs
- NativeCompoundFileAPIs.cs
- PageAsyncTask.cs
- DataFieldCollectionEditor.cs
- SecurityState.cs
- XmlExtensionFunction.cs
- IndicFontClient.cs
- XamlInterfaces.cs
- AttributeXamlType.cs
- StdValidatorsAndConverters.cs