Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / TargetControlTypeCache.cs / 1305376 / 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
- ExecutionProperties.cs
- InvalidProgramException.cs
- CompressionTracing.cs
- DbRetry.cs
- ObjectPropertyMapping.cs
- MimeParameters.cs
- ArrayExtension.cs
- ObjectDataSourceSelectingEventArgs.cs
- recordstate.cs
- WindowPatternIdentifiers.cs
- WindowsListViewGroupSubsetLink.cs
- SqlInternalConnectionSmi.cs
- UserPreferenceChangedEventArgs.cs
- RC2.cs
- VarInfo.cs
- TableLayout.cs
- AssemblyNameProxy.cs
- CalendarDateRange.cs
- List.cs
- JournalEntryListConverter.cs
- TextFormatter.cs
- PackageRelationship.cs
- UpDownEvent.cs
- serverconfig.cs
- ServerValidateEventArgs.cs
- Wizard.cs
- PrimitiveDataContract.cs
- FactoryGenerator.cs
- Calendar.cs
- FontStretch.cs
- ToolStripContainerActionList.cs
- SiteIdentityPermission.cs
- DbProviderFactories.cs
- IDQuery.cs
- HttpCapabilitiesSectionHandler.cs
- LongSumAggregationOperator.cs
- TrackingProvider.cs
- CodeGen.cs
- PackWebResponse.cs
- HtmlTableCellCollection.cs
- LinearGradientBrush.cs
- IPipelineRuntime.cs
- InputElement.cs
- XmlWriter.cs
- ActiveXMessageFormatter.cs
- _IPv6Address.cs
- SearchForVirtualItemEventArgs.cs
- AppDomainShutdownMonitor.cs
- Utils.cs
- ChannelPoolSettings.cs
- Int32Rect.cs
- TraversalRequest.cs
- DefaultExpression.cs
- TrackingExtract.cs
- ToolboxComponentsCreatingEventArgs.cs
- WindowsMenu.cs
- UserPreferenceChangingEventArgs.cs
- DropSource.cs
- TextDecorationCollection.cs
- NamespaceQuery.cs
- Int32Converter.cs
- RelationshipSet.cs
- AttributeQuery.cs
- StrongNamePublicKeyBlob.cs
- DeferredReference.cs
- DynamicControl.cs
- UnsafeNativeMethods.cs
- ListViewCommandEventArgs.cs
- AttributeCollection.cs
- BitStream.cs
- PolicyUnit.cs
- _SSPISessionCache.cs
- Geometry.cs
- PublisherMembershipCondition.cs
- GradientStop.cs
- WsatTransactionFormatter.cs
- TextBounds.cs
- WebPartTransformerCollection.cs
- AbstractDataSvcMapFileLoader.cs
- DropShadowEffect.cs
- DSASignatureFormatter.cs
- StatusBarItem.cs
- ReflectionPermission.cs
- FixedSOMFixedBlock.cs
- OverflowException.cs
- HealthMonitoringSectionHelper.cs
- DataBindingExpressionBuilder.cs
- DrawingDrawingContext.cs
- DoubleCollectionConverter.cs
- PreparingEnlistment.cs
- StrongNameUtility.cs
- KeyFrames.cs
- HostingEnvironment.cs
- _ListenerResponseStream.cs
- CacheDependency.cs
- Win32.cs
- CommandConverter.cs
- UrlPropertyAttribute.cs
- MeshGeometry3D.cs
- BehaviorEditorPart.cs