Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlControlPersistable.cs
- StateMachineWorkflowDesigner.cs
- BindingContext.cs
- IDQuery.cs
- FunctionImportElement.cs
- RegexInterpreter.cs
- WebDescriptionAttribute.cs
- GrammarBuilderDictation.cs
- ImageConverter.cs
- Propagator.ExtentPlaceholderCreator.cs
- SystemMulticastIPAddressInformation.cs
- OdbcCommand.cs
- UInt64.cs
- FlowSwitchDesigner.xaml.cs
- LockedAssemblyCache.cs
- webclient.cs
- ToolboxItemSnapLineBehavior.cs
- Convert.cs
- DisposableCollectionWrapper.cs
- IChannel.cs
- TemplateParser.cs
- InsufficientMemoryException.cs
- TextBoxBase.cs
- BinaryMethodMessage.cs
- OptimisticConcurrencyException.cs
- Floater.cs
- OutputWindow.cs
- XmlSchemaAttributeGroup.cs
- XmlUnspecifiedAttribute.cs
- DefaultHttpHandler.cs
- FilterableAttribute.cs
- Context.cs
- Roles.cs
- MulticastDelegate.cs
- CodeMemberField.cs
- Monitor.cs
- DataObjectMethodAttribute.cs
- UnitySerializationHolder.cs
- WebPartsPersonalization.cs
- FigureParagraph.cs
- ConfigXmlWhitespace.cs
- XmlReflectionImporter.cs
- CheckedPointers.cs
- SmtpNegotiateAuthenticationModule.cs
- ValidatorCompatibilityHelper.cs
- TextEditorSpelling.cs
- NoClickablePointException.cs
- PinnedBufferMemoryStream.cs
- ExternalFile.cs
- AccessDataSourceView.cs
- ModifierKeysConverter.cs
- PropertyEmitter.cs
- ActiveXHelper.cs
- SEHException.cs
- TemplatedControlDesigner.cs
- AssemblyCache.cs
- SocketPermission.cs
- ClientConvert.cs
- EdmSchemaAttribute.cs
- NameValuePair.cs
- ToolZone.cs
- TraceSection.cs
- WebEventCodes.cs
- WindowsAuthenticationModule.cs
- DataGridColumn.cs
- DataPointer.cs
- EventMap.cs
- Link.cs
- ExpressionBuilder.cs
- StrokeDescriptor.cs
- LinqDataSourceDeleteEventArgs.cs
- PackWebResponse.cs
- TableCell.cs
- ReaderWriterLockSlim.cs
- ReflectEventDescriptor.cs
- XPathItem.cs
- PasswordPropertyTextAttribute.cs
- ConfigXmlElement.cs
- ContextStaticAttribute.cs
- SplitterPanelDesigner.cs
- IDReferencePropertyAttribute.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- PageParserFilter.cs
- PageAdapter.cs
- X509ChainElement.cs
- XmlILTrace.cs
- EncryptedPackage.cs
- LineGeometry.cs
- ContentAlignmentEditor.cs
- TrackBarRenderer.cs
- SqlMetaData.cs
- DataGridColumnCollection.cs
- ConfigurationElementCollection.cs
- ClientBuildManager.cs
- GroupItemAutomationPeer.cs
- DetailsViewModeEventArgs.cs
- ExpressionPrefixAttribute.cs
- SoapEnumAttribute.cs
- ButtonAutomationPeer.cs
- Pkcs9Attribute.cs