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
- EqualityComparer.cs
- SQLRoleProvider.cs
- FileDialog_Vista_Interop.cs
- ComAdminInterfaces.cs
- OverflowException.cs
- Collection.cs
- FixedTextPointer.cs
- FilterFactory.cs
- ToolStripOverflow.cs
- BindingUtils.cs
- ObjectNavigationPropertyMapping.cs
- HandoffBehavior.cs
- Exceptions.cs
- BypassElement.cs
- PanelStyle.cs
- PassportPrincipal.cs
- OrElse.cs
- ToolboxItemSnapLineBehavior.cs
- XmlSchemaSimpleTypeRestriction.cs
- Pointer.cs
- ScriptingProfileServiceSection.cs
- StylusButton.cs
- TypeConverterHelper.cs
- wgx_sdk_version.cs
- CompoundFileDeflateTransform.cs
- Boolean.cs
- StylusButtonCollection.cs
- dbenumerator.cs
- _ContextAwareResult.cs
- DataGridViewRowCancelEventArgs.cs
- ProfessionalColorTable.cs
- WriteTimeStream.cs
- ScriptingSectionGroup.cs
- DictionaryEditChange.cs
- XmlArrayAttribute.cs
- MetadataExchangeClient.cs
- FolderLevelBuildProviderCollection.cs
- DataTableTypeConverter.cs
- HttpResponseHeader.cs
- OleDbCommand.cs
- ContractInferenceHelper.cs
- CompressStream.cs
- DocumentSchemaValidator.cs
- TypeLibConverter.cs
- XmlSchemaAttributeGroup.cs
- BypassElementCollection.cs
- PenContext.cs
- WebPartConnectionsCancelEventArgs.cs
- DllNotFoundException.cs
- PathSegment.cs
- JsonEncodingStreamWrapper.cs
- TextTreeUndo.cs
- AuthorizationSection.cs
- StringValueSerializer.cs
- RequiredAttributeAttribute.cs
- ReadOnlyState.cs
- SafeNativeMethods.cs
- SecurityManager.cs
- SynchronizationLockException.cs
- X509CertificateValidator.cs
- ServiceDeploymentInfo.cs
- CalculatedColumn.cs
- OSEnvironmentHelper.cs
- NativeActivityFaultContext.cs
- Serializer.cs
- Size.cs
- ValidatingPropertiesEventArgs.cs
- ImageFormatConverter.cs
- NavigationService.cs
- InvalidateEvent.cs
- CharacterString.cs
- DropSource.cs
- SafeCertificateContext.cs
- SqlDependencyListener.cs
- ErrorWrapper.cs
- DrawingContextWalker.cs
- XmlNodeChangedEventManager.cs
- SqlUserDefinedAggregateAttribute.cs
- Header.cs
- HGlobalSafeHandle.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- ObjectAnimationUsingKeyFrames.cs
- TextFormatterImp.cs
- OutOfMemoryException.cs
- DataGridViewHitTestInfo.cs
- RulePatternOps.cs
- TextTreeTextBlock.cs
- SqlDataSourceCommandEventArgs.cs
- Decorator.cs
- WebUtil.cs
- RegionIterator.cs
- Exceptions.cs
- SqlMultiplexer.cs
- ClientTargetCollection.cs
- XmlUtil.cs
- RelatedCurrencyManager.cs
- XPathAncestorIterator.cs
- ListBox.cs
- InternalBase.cs
- HostingEnvironment.cs