Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- HierarchicalDataBoundControl.cs
- querybuilder.cs
- SessionEndingCancelEventArgs.cs
- SimpleBitVector32.cs
- OdbcDataReader.cs
- GeometryHitTestResult.cs
- DataGridViewCellCancelEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- ToolBarButton.cs
- XmlTextEncoder.cs
- CmsInterop.cs
- XmlFormatExtensionPrefixAttribute.cs
- filewebresponse.cs
- ImageBrush.cs
- DbConnectionPoolCounters.cs
- LineSegment.cs
- SessionParameter.cs
- TreeViewDataItemAutomationPeer.cs
- ADMembershipUser.cs
- TextServicesHost.cs
- Enum.cs
- StaticExtensionConverter.cs
- RecordBuilder.cs
- XmlUnspecifiedAttribute.cs
- Peer.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- Set.cs
- NotificationContext.cs
- PropertyEntry.cs
- ReaderWriterLockWrapper.cs
- EntityDataSourceContainerNameItem.cs
- ADConnectionHelper.cs
- AssertUtility.cs
- Qualifier.cs
- LocalTransaction.cs
- WebPartConnectionsDisconnectVerb.cs
- StructuralCache.cs
- PrintDocument.cs
- OLEDB_Util.cs
- BadImageFormatException.cs
- TreeNodeClickEventArgs.cs
- validationstate.cs
- String.cs
- CodeRemoveEventStatement.cs
- JsonByteArrayDataContract.cs
- NamedPipeChannelFactory.cs
- WindowsSpinner.cs
- CompilationLock.cs
- HiddenField.cs
- InputMethod.cs
- _SafeNetHandles.cs
- ActiveXContainer.cs
- LockCookie.cs
- ObfuscationAttribute.cs
- SqlClientWrapperSmiStreamChars.cs
- IDQuery.cs
- SystemDropShadowChrome.cs
- EnumUnknown.cs
- OdbcUtils.cs
- TextElement.cs
- RelationshipEntry.cs
- InputReferenceExpression.cs
- XmlDocument.cs
- unsafenativemethodstextservices.cs
- remotingproxy.cs
- XamlStream.cs
- DataObjectMethodAttribute.cs
- DataGridViewRowCancelEventArgs.cs
- TrackingServices.cs
- DayRenderEvent.cs
- EditorPartChrome.cs
- ValidatorAttribute.cs
- XmlName.cs
- UnmanagedMemoryStreamWrapper.cs
- GZipDecoder.cs
- SmiConnection.cs
- MenuStrip.cs
- TransactionScope.cs
- TransformGroup.cs
- WmlFormAdapter.cs
- FloatUtil.cs
- GetPageCompletedEventArgs.cs
- diagnosticsswitches.cs
- TitleStyle.cs
- SRDisplayNameAttribute.cs
- SelectiveScrollingGrid.cs
- EntityDataSourceDataSelectionPanel.cs
- WizardForm.cs
- Drawing.cs
- TextDpi.cs
- ClientData.cs
- ResXResourceWriter.cs
- SiteMapNodeCollection.cs
- ILGenerator.cs
- InputProcessorProfiles.cs
- Matrix.cs
- ZipIOFileItemStream.cs
- DocumentOrderQuery.cs
- ZeroOpNode.cs
- XmlFormatExtensionPointAttribute.cs