Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / TargetControlTypeCache.cs / 1305376 / 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
- MouseEventArgs.cs
- IndexerNameAttribute.cs
- SplineQuaternionKeyFrame.cs
- GroupByQueryOperator.cs
- DefaultSettingsSection.cs
- MessageBox.cs
- GlobalEventManager.cs
- ToolStripPanelRow.cs
- SQLGuidStorage.cs
- Speller.cs
- Rule.cs
- VerificationException.cs
- RootBrowserWindow.cs
- InstalledFontCollection.cs
- CriticalFileToken.cs
- ActiveXHost.cs
- ImageClickEventArgs.cs
- DataGridViewCellStyleConverter.cs
- FormDocumentDesigner.cs
- XamlPathDataSerializer.cs
- ValidatorCollection.cs
- RequestResponse.cs
- OutOfProcStateClientManager.cs
- WpfXamlMember.cs
- StrokeRenderer.cs
- Attributes.cs
- ImagingCache.cs
- ContentIterators.cs
- DataGridViewCellConverter.cs
- TableRowCollection.cs
- ContextMenu.cs
- URLMembershipCondition.cs
- GridItem.cs
- XmlIlTypeHelper.cs
- Color.cs
- UnsafeNativeMethodsMilCoreApi.cs
- CodeEntryPointMethod.cs
- OlePropertyStructs.cs
- MasterPage.cs
- UInt32.cs
- CompilerWrapper.cs
- Quaternion.cs
- LZCodec.cs
- Container.cs
- NameSpaceEvent.cs
- GiveFeedbackEvent.cs
- Point3DAnimationBase.cs
- ProcessMonitor.cs
- DbTransaction.cs
- TranslateTransform3D.cs
- FixedSOMTable.cs
- InputLanguageSource.cs
- DataGridViewIntLinkedList.cs
- CreateUserWizardStep.cs
- Selection.cs
- MenuItem.cs
- CodeValidator.cs
- RelationshipNavigation.cs
- FrameworkObject.cs
- DataGridViewColumnHeaderCell.cs
- TransactionFlowElement.cs
- ClientRolePrincipal.cs
- GetCryptoTransformRequest.cs
- EUCJPEncoding.cs
- BinaryReader.cs
- ConfigXmlWhitespace.cs
- ComponentDispatcher.cs
- Transactions.cs
- ScaleTransform.cs
- ResourceDescriptionAttribute.cs
- XmlIlVisitor.cs
- TextEffect.cs
- ToggleButtonAutomationPeer.cs
- InvalidCastException.cs
- RelationshipEndMember.cs
- Transform3DGroup.cs
- HtmlMeta.cs
- InstanceStoreQueryResult.cs
- AnnotationElement.cs
- Codec.cs
- ScaleTransform3D.cs
- Tablet.cs
- XmlSchemaImport.cs
- EncodingNLS.cs
- Bidi.cs
- EditorPartCollection.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- AuthorizationRule.cs
- RangeValueProviderWrapper.cs
- DeferredElementTreeState.cs
- SqlUserDefinedAggregateAttribute.cs
- RtfToXamlLexer.cs
- entityreference_tresulttype.cs
- SchemaTypeEmitter.cs
- TextEditorSpelling.cs
- XmlSchemaImport.cs
- Effect.cs
- Asn1IntegerConverter.cs
- LifetimeManager.cs
- FrugalMap.cs