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
- SmtpException.cs
- ToolStripPanelRenderEventArgs.cs
- ConnectionPoolRegistry.cs
- contentDescriptor.cs
- HtmlTableCellCollection.cs
- StackOverflowException.cs
- NetworkInformationException.cs
- XslNumber.cs
- HelpKeywordAttribute.cs
- DotExpr.cs
- JsonFaultDetail.cs
- Visitors.cs
- listviewsubitemcollectioneditor.cs
- Label.cs
- RefType.cs
- ThreadStartException.cs
- FixedSOMElement.cs
- SqlErrorCollection.cs
- RSACryptoServiceProvider.cs
- MetadataCacheItem.cs
- UrlAuthFailureHandler.cs
- EventSinkActivityDesigner.cs
- DataGridTablesFactory.cs
- ConfigXmlWhitespace.cs
- EventLogPermissionAttribute.cs
- RbTree.cs
- Validator.cs
- EventLog.cs
- _CacheStreams.cs
- CodeEntryPointMethod.cs
- RelationshipDetailsRow.cs
- XMLSyntaxException.cs
- FlatButtonAppearance.cs
- ClientScriptManagerWrapper.cs
- GlobalizationSection.cs
- PaintValueEventArgs.cs
- IResourceProvider.cs
- WebPartConnectionsConfigureVerb.cs
- SkinBuilder.cs
- IdentityHolder.cs
- OrthographicCamera.cs
- ContextBase.cs
- ScrollProperties.cs
- GB18030Encoding.cs
- TraceUtility.cs
- JsonDeserializer.cs
- XmlSchemaSimpleContent.cs
- IList.cs
- FieldNameLookup.cs
- EastAsianLunisolarCalendar.cs
- GcHandle.cs
- ConnectionConsumerAttribute.cs
- ConfigurationElementProperty.cs
- ControllableStoryboardAction.cs
- BoundColumn.cs
- OrderByQueryOptionExpression.cs
- WebPartCancelEventArgs.cs
- RemoteHelper.cs
- MessageQueuePermissionEntryCollection.cs
- TextTreeFixupNode.cs
- PropertyGridDesigner.cs
- Unit.cs
- Encoder.cs
- Array.cs
- DataObjectPastingEventArgs.cs
- XmlSignificantWhitespace.cs
- SweepDirectionValidation.cs
- ListSortDescription.cs
- ConfigXmlElement.cs
- TemplateControlParser.cs
- TimeSpan.cs
- Coordinator.cs
- ZipFileInfo.cs
- ConfigXmlText.cs
- SupportsEventValidationAttribute.cs
- DocumentGridContextMenu.cs
- DecimalConverter.cs
- DataSourceView.cs
- SymmetricKeyWrap.cs
- EmptyEnumerator.cs
- XmlAnyAttributeAttribute.cs
- ImmutableCollection.cs
- ResourcesGenerator.cs
- XmlnsCache.cs
- CopyOnWriteList.cs
- PropertyIDSet.cs
- Application.cs
- UnsafeNativeMethodsTablet.cs
- ClientSponsor.cs
- XmlValidatingReader.cs
- NullableBoolConverter.cs
- FunctionGenerator.cs
- WebPartUserCapability.cs
- DataGridColumnEventArgs.cs
- ConfigXmlCDataSection.cs
- DisplayMemberTemplateSelector.cs
- SR.cs
- AttributeXamlType.cs
- BuiltInExpr.cs
- DbConnectionFactory.cs