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
- BatchStream.cs
- TypeLoadException.cs
- StructuredProperty.cs
- ValidatorUtils.cs
- WindowInteractionStateTracker.cs
- UpdateProgress.cs
- SpotLight.cs
- InternalBufferOverflowException.cs
- Aggregates.cs
- ShaderEffect.cs
- DefaultPrintController.cs
- XamlTemplateSerializer.cs
- StaticSiteMapProvider.cs
- SetterTriggerConditionValueConverter.cs
- CodeValidator.cs
- ProfileSettingsCollection.cs
- Geometry.cs
- _SpnDictionary.cs
- Size.cs
- ActivitySurrogate.cs
- PenThreadWorker.cs
- RuntimeEnvironment.cs
- FormViewUpdatedEventArgs.cs
- DataGridLinkButton.cs
- DBSqlParserTable.cs
- SynchronousReceiveBehavior.cs
- NonClientArea.cs
- TrustLevel.cs
- ToolStripRenderer.cs
- TagMapCollection.cs
- Misc.cs
- Inflater.cs
- EventLogPermissionAttribute.cs
- Win32.cs
- StringArrayConverter.cs
- Soap12ProtocolReflector.cs
- Separator.cs
- Win32PrintDialog.cs
- NamedObject.cs
- ModelTreeEnumerator.cs
- TableSectionStyle.cs
- ObjectDataSource.cs
- x509utils.cs
- MembershipSection.cs
- SimpleHandlerFactory.cs
- LoginName.cs
- Rectangle.cs
- CodeTypeMember.cs
- RewritingSimplifier.cs
- ConnectionPoolManager.cs
- PeerToPeerException.cs
- EnumValAlphaComparer.cs
- EditingCommands.cs
- StringUtil.cs
- ActionMessageFilter.cs
- CodeMemberProperty.cs
- DependencyObjectCodeDomSerializer.cs
- ExpandSegmentCollection.cs
- CommandField.cs
- TileBrush.cs
- OracleRowUpdatingEventArgs.cs
- TextElementEditingBehaviorAttribute.cs
- CreateUserWizardStep.cs
- ObjectManager.cs
- CssTextWriter.cs
- IHttpResponseInternal.cs
- ConstraintCollection.cs
- CompilerScopeManager.cs
- WebEventCodes.cs
- TextWriterTraceListener.cs
- XmlSchemaValidator.cs
- DocumentViewerHelper.cs
- ResolvedKeyFrameEntry.cs
- FixedPageAutomationPeer.cs
- EqualityComparer.cs
- FontFamilyConverter.cs
- EntityClientCacheKey.cs
- MimeWriter.cs
- thaishape.cs
- Typography.cs
- DesignerTransactionCloseEvent.cs
- CopyOfAction.cs
- AssemblyFilter.cs
- BamlCollectionHolder.cs
- DecimalAnimationUsingKeyFrames.cs
- DataSourceControl.cs
- Stackframe.cs
- ServiceProviders.cs
- InkPresenter.cs
- ItemCollection.cs
- SoapFormatterSinks.cs
- PathFigureCollection.cs
- ReachObjectContext.cs
- CompressStream.cs
- SectionInput.cs
- TextAction.cs
- StreamGeometry.cs
- IncomingWebRequestContext.cs
- DefaultObjectMappingItemCollection.cs
- ExpressionVisitorHelpers.cs