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
- DEREncoding.cs
- HelpOperationInvoker.cs
- BridgeDataReader.cs
- ColorConvertedBitmap.cs
- Rectangle.cs
- ToolStripComboBox.cs
- DateTimeSerializationSection.cs
- PropertyConverter.cs
- SmtpLoginAuthenticationModule.cs
- ViewManager.cs
- QilTypeChecker.cs
- RightsManagementResourceHelper.cs
- RegexBoyerMoore.cs
- ComAdminWrapper.cs
- PartialCachingAttribute.cs
- DataPagerField.cs
- SymbolMethod.cs
- LazyTextWriterCreator.cs
- EventLogger.cs
- XmlMemberMapping.cs
- ProgressPage.cs
- TrustManagerPromptUI.cs
- PropertyEmitterBase.cs
- WebPartUserCapability.cs
- WebReferencesBuildProvider.cs
- ExtendedTransformFactory.cs
- UrlPropertyAttribute.cs
- SqlFileStream.cs
- ProviderConnectionPoint.cs
- XmlSchemaAll.cs
- TypeUsageBuilder.cs
- ThreadStartException.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- FormatVersion.cs
- MultiView.cs
- JavaScriptSerializer.cs
- GridViewSortEventArgs.cs
- safelinkcollection.cs
- DataGridViewCellCollection.cs
- CollectionChangedEventManager.cs
- BypassElementCollection.cs
- WebPartsPersonalization.cs
- WebPartZone.cs
- XmlCharacterData.cs
- HelpKeywordAttribute.cs
- BooleanSwitch.cs
- CounterSample.cs
- PathGeometry.cs
- BitVec.cs
- IndexingContentUnit.cs
- CryptoStream.cs
- MouseEventArgs.cs
- GridView.cs
- IDQuery.cs
- AlgoModule.cs
- AxisAngleRotation3D.cs
- Context.cs
- HostSecurityManager.cs
- ControlParameter.cs
- DynamicScriptObject.cs
- ImageField.cs
- Model3DGroup.cs
- ContentPlaceHolder.cs
- EntitySetBase.cs
- Error.cs
- CodeSnippetTypeMember.cs
- QilTernary.cs
- Listbox.cs
- LogReserveAndAppendState.cs
- CombinedGeometry.cs
- SqlCacheDependency.cs
- Parsers.cs
- x509store.cs
- Enum.cs
- StatusBar.cs
- GridViewCellAutomationPeer.cs
- DataGridViewElement.cs
- BulletChrome.cs
- AutoGeneratedFieldProperties.cs
- SemanticBasicElement.cs
- Location.cs
- CompiledRegexRunnerFactory.cs
- AppDomainUnloadedException.cs
- NameNode.cs
- DetailsViewPagerRow.cs
- FixedSOMTableCell.cs
- CodeMemberProperty.cs
- ResourceReader.cs
- ProcessHost.cs
- Model3DGroup.cs
- ConfigXmlText.cs
- TemplateManager.cs
- MenuAutomationPeer.cs
- SessionViewState.cs
- PointValueSerializer.cs
- TypeGeneratedEventArgs.cs
- PrintPreviewGraphics.cs
- AssociationTypeEmitter.cs
- SerialStream.cs
- FlowDocumentView.cs