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
- MLangCodePageEncoding.cs
- SinglePhaseEnlistment.cs
- StateMachineWorkflow.cs
- CodeSubDirectory.cs
- BitmapCodecInfoInternal.cs
- DoubleLink.cs
- CornerRadiusConverter.cs
- StandardBindingOptionalReliableSessionElement.cs
- EdmEntityTypeAttribute.cs
- ISFTagAndGuidCache.cs
- ImageIndexConverter.cs
- RuntimeConfigurationRecord.cs
- Misc.cs
- BooleanKeyFrameCollection.cs
- GridItem.cs
- TransactionOptions.cs
- EventDescriptor.cs
- DataSourceProvider.cs
- SQLInt64Storage.cs
- GlyphInfoList.cs
- NameSpaceExtractor.cs
- ListenerAdapter.cs
- IisTraceWebEventProvider.cs
- XmlAttributeCollection.cs
- SmiEventSink_DeferedProcessing.cs
- XmlValueConverter.cs
- AppDomainProtocolHandler.cs
- IteratorDescriptor.cs
- Rotation3DAnimationBase.cs
- EdmValidator.cs
- QilTernary.cs
- PingReply.cs
- SecUtil.cs
- MenuAutoFormat.cs
- CodeDelegateCreateExpression.cs
- NavigationCommands.cs
- ToolZone.cs
- HttpProfileBase.cs
- SQLBoolean.cs
- ExpandCollapseProviderWrapper.cs
- ConfigurationProviderException.cs
- PointConverter.cs
- MetadataItem_Static.cs
- recordstatefactory.cs
- IsolatedStorageFile.cs
- LineProperties.cs
- SqlNodeAnnotation.cs
- SerializationInfo.cs
- UInt32.cs
- RangeValidator.cs
- XmlDsigSep2000.cs
- AQNBuilder.cs
- InternalBase.cs
- DiagnosticTrace.cs
- AdjustableArrowCap.cs
- QilInvoke.cs
- validationstate.cs
- LineProperties.cs
- DataMisalignedException.cs
- AutomationElement.cs
- DecimalFormatter.cs
- FactoryGenerator.cs
- Trustee.cs
- SchemaMerger.cs
- DependentList.cs
- SqlConnectionPoolProviderInfo.cs
- ImageListStreamer.cs
- ChangeDirector.cs
- assertwrapper.cs
- PointAnimationUsingKeyFrames.cs
- DataGridParentRows.cs
- ActivityValidationServices.cs
- RSAOAEPKeyExchangeFormatter.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- Typography.cs
- _NetworkingPerfCounters.cs
- AccessViolationException.cs
- RegexNode.cs
- GenericIdentity.cs
- Scanner.cs
- SendDesigner.xaml.cs
- X509Certificate2Collection.cs
- TextTreeDeleteContentUndoUnit.cs
- PageAdapter.cs
- DateTimeSerializationSection.cs
- WebBrowserSiteBase.cs
- ProxyWebPartManager.cs
- StringSource.cs
- MexTcpBindingElement.cs
- SimpleTypeResolver.cs
- QueryParameter.cs
- ConstraintConverter.cs
- CacheOutputQuery.cs
- AnimationException.cs
- ContextStaticAttribute.cs
- HttpEncoderUtility.cs
- DefaultHttpHandler.cs
- StorageMappingItemCollection.cs
- ObjectListCommandsPage.cs
- TemplateControl.cs