Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ParallelTimeline.cs
- XmlAttributeCollection.cs
- DataGridViewComboBoxColumn.cs
- TextBox.cs
- GeneratedContractType.cs
- PreservationFileWriter.cs
- TransformedBitmap.cs
- HostingEnvironmentSection.cs
- ListViewItem.cs
- ProtocolsSection.cs
- ConnectionConsumerAttribute.cs
- CodeTypeConstructor.cs
- RtType.cs
- ResourceReferenceExpression.cs
- UIAgentRequest.cs
- HttpCookieCollection.cs
- DependencyObject.cs
- PointAnimationClockResource.cs
- TripleDESCryptoServiceProvider.cs
- EntityModelSchemaGenerator.cs
- FileDetails.cs
- TextFormatter.cs
- AsnEncodedData.cs
- PropertyMappingExceptionEventArgs.cs
- Label.cs
- rsa.cs
- MetadataPropertyAttribute.cs
- RichTextBox.cs
- PaintEvent.cs
- WriteableBitmap.cs
- ServiceEndpoint.cs
- DateTimeOffsetConverter.cs
- DataSourceView.cs
- ConnectionStringSettingsCollection.cs
- LoginStatusDesigner.cs
- BuildProviderUtils.cs
- InputBinding.cs
- DataGridViewTopLeftHeaderCell.cs
- SqlBulkCopy.cs
- InkCanvas.cs
- XPathDocumentNavigator.cs
- VisualBrush.cs
- TreeViewAutomationPeer.cs
- TimeZone.cs
- ConsoleTraceListener.cs
- WebPartHelpVerb.cs
- AnimationStorage.cs
- WindowCollection.cs
- ILGenerator.cs
- PatternMatcher.cs
- MenuScrollingVisibilityConverter.cs
- ReadWriteSpinLock.cs
- _FixedSizeReader.cs
- TraceSwitch.cs
- XmlSortKeyAccumulator.cs
- X509Certificate2Collection.cs
- ProcessHostMapPath.cs
- WebControlAdapter.cs
- PointCollection.cs
- BrowserCapabilitiesFactoryBase.cs
- ClientSettingsProvider.cs
- StringSource.cs
- EventMappingSettingsCollection.cs
- CodeDOMUtility.cs
- XmlSchemaImport.cs
- ButtonBase.cs
- SimpleMailWebEventProvider.cs
- DesignerVerb.cs
- LambdaCompiler.Logical.cs
- PolyBezierSegment.cs
- UIElement3D.cs
- RuntimeHandles.cs
- XPathQilFactory.cs
- CmsInterop.cs
- FileSystemWatcher.cs
- FileNameEditor.cs
- RequiredFieldValidator.cs
- ComponentFactoryHelpers.cs
- DesignerValidationSummaryAdapter.cs
- SqlDataSourceStatusEventArgs.cs
- Vector3DAnimationBase.cs
- TextDecoration.cs
- _RequestCacheProtocol.cs
- InProcStateClientManager.cs
- ToolBarButtonDesigner.cs
- SecurityException.cs
- iisPickupDirectory.cs
- Win32Native.cs
- RealProxy.cs
- IMembershipProvider.cs
- RenderOptions.cs
- XmlSchemaInclude.cs
- SHA384.cs
- FileNotFoundException.cs
- Grid.cs
- StructuredCompositeActivityDesigner.cs
- _WebProxyDataBuilder.cs
- StringReader.cs
- ProtectedConfigurationProviderCollection.cs
- WebPartConnectionsConfigureVerb.cs