Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- QilScopedVisitor.cs
- DataGridBoolColumn.cs
- TimeSpanSecondsConverter.cs
- FormatControl.cs
- HtmlImage.cs
- NeutralResourcesLanguageAttribute.cs
- XmlNamedNodeMap.cs
- ReversePositionQuery.cs
- ControlBuilder.cs
- SqlGenerator.cs
- XmlWhitespace.cs
- DataGridViewCellStateChangedEventArgs.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ResXFileRef.cs
- ScriptResourceInfo.cs
- EventlogProvider.cs
- ListDictionaryInternal.cs
- DocumentViewerBaseAutomationPeer.cs
- WorkflowPersistenceService.cs
- _emptywebproxy.cs
- OleDbPropertySetGuid.cs
- TemplateApplicationHelper.cs
- GeneralTransform2DTo3DTo2D.cs
- Window.cs
- DbModificationCommandTree.cs
- ColorConverter.cs
- ReferentialConstraint.cs
- Base64Stream.cs
- OleDbParameterCollection.cs
- TextEvent.cs
- Zone.cs
- PipelineModuleStepContainer.cs
- SectionUpdates.cs
- PrintDialogException.cs
- TabPage.cs
- AbstractSvcMapFileLoader.cs
- ToolStripContentPanel.cs
- RadioButtonAutomationPeer.cs
- ClientTargetCollection.cs
- OrderedEnumerableRowCollection.cs
- NeutralResourcesLanguageAttribute.cs
- HelpEvent.cs
- ScrollProperties.cs
- ProxyWebPartConnectionCollection.cs
- DataBindingValueUIHandler.cs
- MergePropertyDescriptor.cs
- KnownTypeAttribute.cs
- Color.cs
- WindowsIdentity.cs
- ProcessHostFactoryHelper.cs
- DecoderReplacementFallback.cs
- CompositeActivityValidator.cs
- ReturnValue.cs
- SafeArrayRankMismatchException.cs
- DataGridViewCellValueEventArgs.cs
- NativeMethodsCLR.cs
- TimelineGroup.cs
- ViewKeyConstraint.cs
- JavaScriptSerializer.cs
- RightsManagementInformation.cs
- MainMenu.cs
- RemoteEndpointMessageProperty.cs
- BitmapEffectState.cs
- MetadataItem.cs
- GlyphRunDrawing.cs
- Reference.cs
- NumericPagerField.cs
- Cursor.cs
- Container.cs
- WebMessageBodyStyleHelper.cs
- AuthenticationService.cs
- ActivityCodeGenerator.cs
- RequiredAttributeAttribute.cs
- XmlChoiceIdentifierAttribute.cs
- StylusPlugin.cs
- ShapeTypeface.cs
- ConfigurationPropertyCollection.cs
- NeutralResourcesLanguageAttribute.cs
- LabelDesigner.cs
- LocatorGroup.cs
- QualifierSet.cs
- ListBoxItemWrapperAutomationPeer.cs
- embossbitmapeffect.cs
- GridViewUpdateEventArgs.cs
- DataServiceQueryException.cs
- GridViewPageEventArgs.cs
- HttpWebResponse.cs
- ResetableIterator.cs
- UserControlAutomationPeer.cs
- TraceUtility.cs
- XslNumber.cs
- AssemblyCache.cs
- FigureParagraph.cs
- IisTraceListener.cs
- LoadGrammarCompletedEventArgs.cs
- XmlObjectSerializerReadContext.cs
- ResourceLoader.cs
- ViewKeyConstraint.cs
- Transform3DGroup.cs
- Comparer.cs