Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- PropertyInfoSet.cs
- BreakRecordTable.cs
- CompareValidator.cs
- CryptographicAttribute.cs
- SrgsGrammarCompiler.cs
- ProfilePropertySettings.cs
- Parser.cs
- SqlStream.cs
- LogicalTreeHelper.cs
- WebPartConnection.cs
- ProfilePropertyNameValidator.cs
- CodeSubDirectory.cs
- VariableBinder.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- TextSegment.cs
- RootProfilePropertySettingsCollection.cs
- BevelBitmapEffect.cs
- ControlBuilder.cs
- MediaContext.cs
- XmlIlVisitor.cs
- DictionaryEntry.cs
- DiscoveryEndpointElement.cs
- ContentHostHelper.cs
- ClientTargetSection.cs
- DBSqlParserTableCollection.cs
- WCFServiceClientProxyGenerator.cs
- OdbcConnectionHandle.cs
- LinearGradientBrush.cs
- MemberPath.cs
- ListViewGroup.cs
- EntityParameterCollection.cs
- ProviderIncompatibleException.cs
- PersistChildrenAttribute.cs
- LinqDataSourceInsertEventArgs.cs
- figurelengthconverter.cs
- Privilege.cs
- AttributeProviderAttribute.cs
- SqlClientWrapperSmiStreamChars.cs
- ServiceModelExtensionCollectionElement.cs
- DefaultTraceListener.cs
- OdbcConnectionStringbuilder.cs
- Activator.cs
- OdbcRowUpdatingEvent.cs
- APCustomTypeDescriptor.cs
- SystemIcmpV6Statistics.cs
- TextTreeDeleteContentUndoUnit.cs
- XmlText.cs
- PathTooLongException.cs
- MethodRental.cs
- CompensationExtension.cs
- ThreadStaticAttribute.cs
- ScrollEventArgs.cs
- EntityDesignerUtils.cs
- ToolStripDropDownItem.cs
- SamlAuthenticationClaimResource.cs
- ReachDocumentReferenceSerializerAsync.cs
- ExpanderAutomationPeer.cs
- DirectoryInfo.cs
- VectorCollection.cs
- ProcessHostMapPath.cs
- CharacterString.cs
- TableCellCollection.cs
- coordinatorscratchpad.cs
- DataGridViewTopRowAccessibleObject.cs
- SelectionEditor.cs
- CustomActivityDesigner.cs
- TraceContextEventArgs.cs
- PropertiesTab.cs
- ListParaClient.cs
- ComponentEvent.cs
- KnownTypeDataContractResolver.cs
- ElementHostPropertyMap.cs
- FolderBrowserDialog.cs
- RequestQueue.cs
- KeyValueSerializer.cs
- TextCharacters.cs
- Validator.cs
- LayoutTableCell.cs
- FormsIdentity.cs
- RenderCapability.cs
- WindowsBrush.cs
- TraceSource.cs
- SecurityDescriptor.cs
- MimeTextImporter.cs
- StylusPointPropertyInfoDefaults.cs
- ProgressBar.cs
- Transform3DGroup.cs
- TableLayoutPanel.cs
- Attachment.cs
- ReadOnlyCollectionBase.cs
- StreamGeometryContext.cs
- FrameworkElementFactoryMarkupObject.cs
- MD5HashHelper.cs
- DataColumnChangeEvent.cs
- SafeFileMapViewHandle.cs
- GridViewDeleteEventArgs.cs
- StrokeCollectionDefaultValueFactory.cs
- SocketInformation.cs
- ZipIOCentralDirectoryBlock.cs
- ZoneIdentityPermission.cs