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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OrderedDictionaryStateHelper.cs
- XmlDocumentType.cs
- MappingException.cs
- TypedAsyncResult.cs
- BamlRecordHelper.cs
- EventLogPermission.cs
- ServiceErrorHandler.cs
- SystemNetHelpers.cs
- CodeDOMProvider.cs
- MembershipUser.cs
- TemplatePropertyEntry.cs
- Manipulation.cs
- XmlSchemaAnnotated.cs
- PropertyOrder.cs
- GZipDecoder.cs
- VisualStyleInformation.cs
- DataControlFieldCell.cs
- OleDbConnection.cs
- StorageInfo.cs
- CommunicationException.cs
- TextElementCollection.cs
- KoreanCalendar.cs
- StylusPointPropertyId.cs
- CalendarButtonAutomationPeer.cs
- HtmlProps.cs
- cookiecontainer.cs
- StatusBarPanel.cs
- ExternalFile.cs
- ExceptionHandlers.cs
- KeyGestureConverter.cs
- XmlSchemaExporter.cs
- IdentityNotMappedException.cs
- AttributeQuery.cs
- TemplatingOptionsDialog.cs
- GeneralTransformGroup.cs
- _FtpDataStream.cs
- ControlValuePropertyAttribute.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- ProfilePropertySettingsCollection.cs
- DataControlLinkButton.cs
- RangeContentEnumerator.cs
- FileSystemEventArgs.cs
- MimeTypeMapper.cs
- ObjectComplexPropertyMapping.cs
- SqlNodeAnnotation.cs
- _TransmitFileOverlappedAsyncResult.cs
- Win32SafeHandles.cs
- TreeViewHitTestInfo.cs
- XmlnsPrefixAttribute.cs
- GroupBoxRenderer.cs
- ScriptRegistrationManager.cs
- XdrBuilder.cs
- SqlVisitor.cs
- RankException.cs
- XmlEnumAttribute.cs
- cryptoapiTransform.cs
- DockAndAnchorLayout.cs
- NamespaceMapping.cs
- FloaterBaseParaClient.cs
- ISAPIApplicationHost.cs
- ObjectConverter.cs
- DllNotFoundException.cs
- DeploymentSectionCache.cs
- NavigateEvent.cs
- ConfigXmlComment.cs
- AsyncPostBackErrorEventArgs.cs
- VisualBrush.cs
- TerminatingOperationBehavior.cs
- UIInitializationException.cs
- ScaleTransform3D.cs
- TransformerInfo.cs
- FixedSOMSemanticBox.cs
- NullEntityWrapper.cs
- GetWinFXPath.cs
- TreeNodeEventArgs.cs
- AutomationPeer.cs
- InkPresenter.cs
- DelegatingConfigHost.cs
- DecoderReplacementFallback.cs
- ReversePositionQuery.cs
- ScaleTransform.cs
- ValueUnavailableException.cs
- UnsafeNativeMethodsMilCoreApi.cs
- COM2Properties.cs
- RSAPKCS1SignatureFormatter.cs
- ProfileParameter.cs
- FormViewCommandEventArgs.cs
- DataGridViewCellStyleBuilderDialog.cs
- AsymmetricSignatureDeformatter.cs
- DataComponentMethodGenerator.cs
- exports.cs
- TextContainerChangeEventArgs.cs
- PolyLineSegmentFigureLogic.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ExpressionBuilder.cs
- MailWebEventProvider.cs
- DataObjectFieldAttribute.cs
- EventHandlersStore.cs
- _FtpControlStream.cs
- Highlights.cs