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
- EdmType.cs
- PlatformNotSupportedException.cs
- BrowserCapabilitiesCodeGenerator.cs
- AnnotationComponentChooser.cs
- WebPartZone.cs
- CodeCatchClauseCollection.cs
- ProxyElement.cs
- ResourcePool.cs
- NaturalLanguageHyphenator.cs
- BindableAttribute.cs
- Version.cs
- WpfMemberInvoker.cs
- GifBitmapEncoder.cs
- EventWaitHandle.cs
- ProtocolsConfigurationEntry.cs
- SqlClientPermission.cs
- AnonymousIdentificationSection.cs
- EmptyImpersonationContext.cs
- webbrowsersite.cs
- ZoneLinkButton.cs
- SoapFormatterSinks.cs
- SafeCryptoHandles.cs
- MonitorWrapper.cs
- DependencyPropertyValueSerializer.cs
- NullNotAllowedCollection.cs
- MasterPageParser.cs
- CodeStatement.cs
- AssemblyHash.cs
- GridSplitter.cs
- FileBasedResourceGroveler.cs
- TrackingServices.cs
- IItemProperties.cs
- MimeMultiPart.cs
- BaseTemplateParser.cs
- WorkflowRuntimeServicesBehavior.cs
- Select.cs
- DbBuffer.cs
- altserialization.cs
- ElementHost.cs
- MatrixStack.cs
- MemoryFailPoint.cs
- Size.cs
- XmlSchemaNotation.cs
- StringOutput.cs
- HebrewCalendar.cs
- ListView.cs
- LassoHelper.cs
- TakeOrSkipQueryOperator.cs
- X509Certificate2.cs
- CollectionConverter.cs
- AutomationAttributeInfo.cs
- TemplateControlCodeDomTreeGenerator.cs
- OuterGlowBitmapEffect.cs
- Soap11ServerProtocol.cs
- BasicExpandProvider.cs
- UriExt.cs
- NestedContainer.cs
- DataGridViewComboBoxCell.cs
- BaseParaClient.cs
- XmlDataSourceNodeDescriptor.cs
- TextServicesDisplayAttribute.cs
- ImageBrush.cs
- HttpConfigurationSystem.cs
- HtmlTableRowCollection.cs
- KeyedHashAlgorithm.cs
- DataGridViewCell.cs
- MergablePropertyAttribute.cs
- MulticastOption.cs
- MembershipSection.cs
- ToolCreatedEventArgs.cs
- TextEffectResolver.cs
- RuntimeHandles.cs
- WS2007HttpBindingCollectionElement.cs
- Propagator.Evaluator.cs
- UserNameSecurityTokenAuthenticator.cs
- ValueConversionAttribute.cs
- DetailsViewPageEventArgs.cs
- Vector3D.cs
- SynchronizationLockException.cs
- TextTreeObjectNode.cs
- UserControlAutomationPeer.cs
- BinHexEncoder.cs
- SafeRightsManagementEnvironmentHandle.cs
- MailWriter.cs
- DynamicResourceExtensionConverter.cs
- odbcmetadatacollectionnames.cs
- Manipulation.cs
- TextServicesDisplayAttribute.cs
- XmlSerializerAssemblyAttribute.cs
- SqlConnectionFactory.cs
- EncryptionUtility.cs
- Point3DAnimationBase.cs
- Compensate.cs
- RSAPKCS1SignatureFormatter.cs
- XomlDesignerLoader.cs
- ObjectStateEntryDbDataRecord.cs
- EncoderReplacementFallback.cs
- __ConsoleStream.cs
- SettingsAttributeDictionary.cs
- ModelMemberCollection.cs