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
- HandlerBase.cs
- TextRangeBase.cs
- CustomValidator.cs
- Utils.cs
- filewebrequest.cs
- ScrollableControl.cs
- CaseExpr.cs
- SymLanguageVendor.cs
- PrintController.cs
- ChangeDirector.cs
- SubclassTypeValidatorAttribute.cs
- AvTraceDetails.cs
- SerialPinChanges.cs
- BitmapEffectGroup.cs
- LogEntry.cs
- BindingGroup.cs
- WorkflowPageSetupDialog.cs
- ManifestResourceInfo.cs
- WebCategoryAttribute.cs
- PolicyValidationException.cs
- DataGridSortingEventArgs.cs
- PermissionRequestEvidence.cs
- ViewStateModeByIdAttribute.cs
- SecureEnvironment.cs
- SignerInfo.cs
- ConnectionPointCookie.cs
- DynamicDataResources.Designer.cs
- TypeSystem.cs
- Formatter.cs
- BlurEffect.cs
- ApplySecurityAndSendAsyncResult.cs
- ResourceExpressionEditorSheet.cs
- COMException.cs
- WebChannelFactory.cs
- LogWriteRestartAreaAsyncResult.cs
- MemberMemberBinding.cs
- EUCJPEncoding.cs
- KeyConstraint.cs
- TextEffect.cs
- TextElementEnumerator.cs
- GridViewColumnHeader.cs
- ConditionalDesigner.cs
- BrowserDefinition.cs
- MetadataArtifactLoaderFile.cs
- MdiWindowListStrip.cs
- MethodBody.cs
- ChildDocumentBlock.cs
- HttpChannelListener.cs
- Native.cs
- ResolvePPIDRequest.cs
- KeyGestureConverter.cs
- glyphs.cs
- ChangeBlockUndoRecord.cs
- InstanceData.cs
- DataSourceDesigner.cs
- TransformerTypeCollection.cs
- IgnoreFileBuildProvider.cs
- EmptyCollection.cs
- UInt32.cs
- Quaternion.cs
- UnsafeNativeMethodsTablet.cs
- PenThreadWorker.cs
- arc.cs
- WebExceptionStatus.cs
- HandlerBase.cs
- Geometry.cs
- graph.cs
- X500Name.cs
- ToolStripItemTextRenderEventArgs.cs
- RowUpdatingEventArgs.cs
- ContainsRowNumberChecker.cs
- Keywords.cs
- IApplicationTrustManager.cs
- EncodingDataItem.cs
- CacheHelper.cs
- WindowsSolidBrush.cs
- RepeatBehaviorConverter.cs
- CodeExpressionStatement.cs
- HierarchicalDataBoundControl.cs
- WMICapabilities.cs
- Form.cs
- PropertyGridCommands.cs
- DataGridViewCellLinkedList.cs
- ArraySegment.cs
- CryptoSession.cs
- DownloadProgressEventArgs.cs
- SqlTrackingWorkflowInstance.cs
- DataGridViewDataConnection.cs
- HandleCollector.cs
- Subtree.cs
- CodeAttributeDeclarationCollection.cs
- ObjectConverter.cs
- ContentPropertyAttribute.cs
- Literal.cs
- ReaderOutput.cs
- WpfKnownType.cs
- ToolStripRenderer.cs
- GPPOINTF.cs
- DataColumnMapping.cs
- MatchingStyle.cs