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
- BamlRecordHelper.cs
- QilLiteral.cs
- DefaultBindingPropertyAttribute.cs
- XmlWrappingWriter.cs
- ButtonColumn.cs
- Set.cs
- ConstraintCollection.cs
- Stylus.cs
- relpropertyhelper.cs
- RootDesignerSerializerAttribute.cs
- ParseHttpDate.cs
- NamedElement.cs
- WebPartConnectionsCloseVerb.cs
- webclient.cs
- SqlCacheDependencySection.cs
- XPathDocument.cs
- FormClosingEvent.cs
- CatalogZoneBase.cs
- DocumentPageTextView.cs
- FormViewModeEventArgs.cs
- SiteIdentityPermission.cs
- AxisAngleRotation3D.cs
- SqlCaseSimplifier.cs
- TextEditorSelection.cs
- ValidationRule.cs
- ToolStripSystemRenderer.cs
- ValidationHelpers.cs
- IndexedSelectQueryOperator.cs
- ServiceInfo.cs
- ApplicationHost.cs
- FileSecurity.cs
- StyleModeStack.cs
- ZoneMembershipCondition.cs
- KnownBoxes.cs
- X509UI.cs
- InputReport.cs
- DocumentsTrace.cs
- Type.cs
- basecomparevalidator.cs
- IxmlLineInfo.cs
- InputManager.cs
- ScaleTransform3D.cs
- OptimalBreakSession.cs
- XmlSerializer.cs
- TransactionManager.cs
- ParameterCollection.cs
- MultiPageTextView.cs
- ControlCollection.cs
- NameTable.cs
- SqlGenerator.cs
- ValueType.cs
- AttributedMetaModel.cs
- PageParser.cs
- Animatable.cs
- DataServiceHostFactory.cs
- InvalidComObjectException.cs
- GridView.cs
- SecurityDocument.cs
- Vector3DCollectionConverter.cs
- Automation.cs
- ObjectSecurity.cs
- MenuItemCollection.cs
- TraceContextRecord.cs
- Exceptions.cs
- ContactManager.cs
- CultureInfoConverter.cs
- Int64AnimationBase.cs
- RoleServiceManager.cs
- RelationshipManager.cs
- DependencySource.cs
- ContentElement.cs
- XmlAttributes.cs
- Attributes.cs
- Menu.cs
- ExpressionVisitorHelpers.cs
- IdentityNotMappedException.cs
- EntityClientCacheEntry.cs
- DrawingContext.cs
- WCFServiceClientProxyGenerator.cs
- DecoratedNameAttribute.cs
- Hash.cs
- FrameworkContentElementAutomationPeer.cs
- TemplateColumn.cs
- XmlCodeExporter.cs
- NodeFunctions.cs
- OleDbEnumerator.cs
- RegionInfo.cs
- UIntPtr.cs
- SHA512CryptoServiceProvider.cs
- BaseProcessor.cs
- IxmlLineInfo.cs
- DiscardableAttribute.cs
- SiteIdentityPermission.cs
- FigureHelper.cs
- WhitespaceSignificantCollectionAttribute.cs
- RightsManagementInformation.cs
- SecurityHeader.cs
- GridViewDeletedEventArgs.cs
- COM2TypeInfoProcessor.cs
- OracleString.cs