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
- EventProvider.cs
- Stroke2.cs
- Compiler.cs
- ConnectionsZoneDesigner.cs
- ScrollBar.cs
- ExpressionStringBuilder.cs
- TextBoxAutoCompleteSourceConverter.cs
- ThreadNeutralSemaphore.cs
- wgx_commands.cs
- SHA384Managed.cs
- ValidatingPropertiesEventArgs.cs
- DataGridItemCollection.cs
- CompModSwitches.cs
- DelegateArgumentReference.cs
- TargetParameterCountException.cs
- SqlWorkflowPersistenceService.cs
- HostProtectionPermission.cs
- DefaultDialogButtons.cs
- PointCollectionConverter.cs
- SystemWebSectionGroup.cs
- BoolExpression.cs
- ConditionalAttribute.cs
- MatrixAnimationBase.cs
- XamlToRtfWriter.cs
- SEHException.cs
- TemplatePropertyEntry.cs
- TemplatePartAttribute.cs
- PartialClassGenerationTaskInternal.cs
- Label.cs
- DataGridViewRowConverter.cs
- FileSystemWatcher.cs
- dataobject.cs
- __Filters.cs
- _AuthenticationState.cs
- BlobPersonalizationState.cs
- AppDomainResourcePerfCounters.cs
- MD5.cs
- EntityCommandDefinition.cs
- SQLBinary.cs
- ArrayExtension.cs
- CodeSnippetStatement.cs
- RijndaelManagedTransform.cs
- DataGridViewRowCancelEventArgs.cs
- WsdlServiceChannelBuilder.cs
- SimpleWebHandlerParser.cs
- Compiler.cs
- CacheChildrenQuery.cs
- SupportsPreviewControlAttribute.cs
- AppDomainProtocolHandler.cs
- ServiceDefaults.cs
- InternalResources.cs
- SoapWriter.cs
- VisualTreeUtils.cs
- ActiveDocumentEvent.cs
- Itemizer.cs
- TemplatedAdorner.cs
- WebPartEventArgs.cs
- DrawItemEvent.cs
- UTF8Encoding.cs
- SplitterCancelEvent.cs
- PermissionSetEnumerator.cs
- DomainConstraint.cs
- RtfControls.cs
- Collection.cs
- TreeView.cs
- WindowsFont.cs
- StackOverflowException.cs
- CapabilitiesSection.cs
- BaseValidator.cs
- Types.cs
- ISessionStateStore.cs
- Zone.cs
- WindowsIPAddress.cs
- QilXmlWriter.cs
- BaseInfoTable.cs
- EdmConstants.cs
- SpotLight.cs
- EntityDataSourceContextDisposingEventArgs.cs
- ApplicationFileCodeDomTreeGenerator.cs
- MasterPageBuildProvider.cs
- IgnorePropertiesAttribute.cs
- NullableLongSumAggregationOperator.cs
- System.Data_BID.cs
- Roles.cs
- safePerfProviderHandle.cs
- PointValueSerializer.cs
- FrameworkRichTextComposition.cs
- FormViewModeEventArgs.cs
- OdbcParameter.cs
- DataErrorValidationRule.cs
- LocationSectionRecord.cs
- ConsoleKeyInfo.cs
- GenericTextProperties.cs
- PopupRoot.cs
- DocumentPageHost.cs
- IDQuery.cs
- WindowsFormsHelpers.cs
- SettingsPropertyValueCollection.cs
- FileLogRecordEnumerator.cs
- UTF32Encoding.cs