Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / ui / TargetControlTypeCache.cs / 1 / TargetControlTypeCache.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Collections; // Cache TargetControlTypeAttributes to improve performance internal static class TargetControlTypeCache { // Maps Type (extender control) to Type[] (valid target control types) private static readonly Hashtable _targetControlTypeCache = Hashtable.Synchronized(new Hashtable()); public static Type[] GetTargetControlTypes(Type extenderControlType) { Type[] types = (Type[])_targetControlTypeCache[extenderControlType]; if (types == null) { types = GetTargetControlTypesInternal(extenderControlType); _targetControlTypeCache[extenderControlType] = types; } return types; } private static Type[] GetTargetControlTypesInternal(Type extenderControlType) { object[] attrs = extenderControlType.GetCustomAttributes(typeof(TargetControlTypeAttribute), true); Type[] types = new Type[attrs.Length]; for (int i = 0; i < attrs.Length; i++) { types[i] = ((TargetControlTypeAttribute)attrs[i]).TargetControlType; } return types; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Collections; // Cache TargetControlTypeAttributes to improve performance internal static class TargetControlTypeCache { // Maps Type (extender control) to Type[] (valid target control types) private static readonly Hashtable _targetControlTypeCache = Hashtable.Synchronized(new Hashtable()); public static Type[] GetTargetControlTypes(Type extenderControlType) { Type[] types = (Type[])_targetControlTypeCache[extenderControlType]; if (types == null) { types = GetTargetControlTypesInternal(extenderControlType); _targetControlTypeCache[extenderControlType] = types; } return types; } private static Type[] GetTargetControlTypesInternal(Type extenderControlType) { object[] attrs = extenderControlType.GetCustomAttributes(typeof(TargetControlTypeAttribute), true); Type[] types = new Type[attrs.Length]; for (int i = 0; i < attrs.Length; i++) { types[i] = ((TargetControlTypeAttribute)attrs[i]).TargetControlType; } return types; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RecommendedAsConfigurableAttribute.cs
- ObjectDisposedException.cs
- DataGridTablesFactory.cs
- CompilerState.cs
- DelegatingTypeDescriptionProvider.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- XamlSerializer.cs
- AspCompat.cs
- BamlRecordReader.cs
- SqlResolver.cs
- GeometryCollection.cs
- SamlAssertion.cs
- PropertyBuilder.cs
- ViewSimplifier.cs
- BordersPage.cs
- ProfileModule.cs
- ImageEditor.cs
- AssemblyAssociatedContentFileAttribute.cs
- ThrowHelper.cs
- ProxyAttribute.cs
- XamlInt32CollectionSerializer.cs
- TableLayoutPanelBehavior.cs
- TripleDES.cs
- IndexOutOfRangeException.cs
- SynthesizerStateChangedEventArgs.cs
- MetadataUtilsSmi.cs
- MenuItemBinding.cs
- SqlServices.cs
- unsafeIndexingFilterStream.cs
- ApplicationActivator.cs
- SoapIgnoreAttribute.cs
- SmiEventSink_DeferedProcessing.cs
- TimeoutException.cs
- CompressionTransform.cs
- BeginStoryboard.cs
- ToolStripItemRenderEventArgs.cs
- ScrollBar.cs
- BrowserCapabilitiesFactoryBase.cs
- XmlQuerySequence.cs
- IChannel.cs
- PropertySourceInfo.cs
- SerialErrors.cs
- SelectingProviderEventArgs.cs
- ToolStripItemRenderEventArgs.cs
- ReachFixedPageSerializer.cs
- ECDiffieHellmanPublicKey.cs
- StreamGeometry.cs
- GridSplitter.cs
- ProxyWebPartConnectionCollection.cs
- RefreshPropertiesAttribute.cs
- NamedPermissionSet.cs
- CompensationTokenData.cs
- PostBackOptions.cs
- ArgumentOutOfRangeException.cs
- SoapEnumAttribute.cs
- ApplicationGesture.cs
- RepeatBehavior.cs
- PropVariant.cs
- CodeTypeReferenceCollection.cs
- BulletedListEventArgs.cs
- DispatchWrapper.cs
- IndexingContentUnit.cs
- LineBreak.cs
- WebPartZoneCollection.cs
- RenderContext.cs
- GenericWebPart.cs
- StorageInfo.cs
- DateTimePicker.cs
- InterleavedZipPartStream.cs
- Function.cs
- SQLDouble.cs
- MergeFailedEvent.cs
- SqlConnectionHelper.cs
- TrackingServices.cs
- Rect.cs
- RangeContentEnumerator.cs
- PriorityQueue.cs
- XmlNavigatorFilter.cs
- RuntimeConfig.cs
- InlineCollection.cs
- SoapAttributeAttribute.cs
- DesignerOptionService.cs
- SqlInternalConnection.cs
- HuffModule.cs
- AnnotationAuthorChangedEventArgs.cs
- ComponentRenameEvent.cs
- SubMenuStyle.cs
- ToolBarButton.cs
- InkCanvasInnerCanvas.cs
- PointHitTestParameters.cs
- MatrixKeyFrameCollection.cs
- WMIInterop.cs
- WinEventQueueItem.cs
- MessageQueuePermissionEntry.cs
- EpmSyndicationContentSerializer.cs
- AuthenticationManager.cs
- CqlParser.cs
- Attributes.cs
- OdbcTransaction.cs
- TreeView.cs