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
- ConnectionPointGlyph.cs
- MemoryFailPoint.cs
- _RequestCacheProtocol.cs
- SafeNativeMethods.cs
- ReplacementText.cs
- ChtmlTextWriter.cs
- Iis7Helper.cs
- DrawingContextWalker.cs
- BindingCollection.cs
- FindCriteriaApril2005.cs
- QilInvoke.cs
- URLMembershipCondition.cs
- ClipboardProcessor.cs
- DbFunctionCommandTree.cs
- OracleBinary.cs
- RequestBringIntoViewEventArgs.cs
- UInt64.cs
- ListDataHelper.cs
- XhtmlBasicCalendarAdapter.cs
- XmlSchemaInferenceException.cs
- Odbc32.cs
- OrderedDictionaryStateHelper.cs
- FacetValues.cs
- SQLBytesStorage.cs
- Visual3D.cs
- NullableDecimalSumAggregationOperator.cs
- ImageMap.cs
- ControlPropertyNameConverter.cs
- Matrix3DStack.cs
- DPAPIProtectedConfigurationProvider.cs
- InkCanvasSelection.cs
- SemanticKeyElement.cs
- ItemCheckEvent.cs
- Message.cs
- DateRangeEvent.cs
- CustomExpression.cs
- ConnectionManagementSection.cs
- LabelEditEvent.cs
- SQLGuid.cs
- IndicFontClient.cs
- TypeLoadException.cs
- NameValueFileSectionHandler.cs
- SmiRequestExecutor.cs
- FileDetails.cs
- CharStorage.cs
- SafeNativeMemoryHandle.cs
- XmlEnumAttribute.cs
- Scene3D.cs
- UnionExpr.cs
- PasswordBoxAutomationPeer.cs
- InternalPolicyElement.cs
- AssociationTypeEmitter.cs
- AsyncDataRequest.cs
- TextElementEnumerator.cs
- KeyValueSerializer.cs
- NativeRecognizer.cs
- PageVisual.cs
- basemetadatamappingvisitor.cs
- ToolStripSeparatorRenderEventArgs.cs
- ButtonBase.cs
- ButtonRenderer.cs
- oledbmetadatacolumnnames.cs
- NodeLabelEditEvent.cs
- HttpListener.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- Rule.cs
- ToolboxSnapDragDropEventArgs.cs
- XmlNode.cs
- ResourceDictionary.cs
- HttpCapabilitiesBase.cs
- Point3DConverter.cs
- HtmlTextArea.cs
- ComponentDispatcherThread.cs
- Vars.cs
- _ConnectionGroup.cs
- DbConnectionInternal.cs
- AppDomainShutdownMonitor.cs
- Roles.cs
- AnnotationHighlightLayer.cs
- TextTreePropertyUndoUnit.cs
- WaitHandleCannotBeOpenedException.cs
- OdbcHandle.cs
- Crypto.cs
- Calendar.cs
- Point3DCollectionConverter.cs
- DataRowCollection.cs
- OdbcErrorCollection.cs
- RoleGroup.cs
- LiteralLink.cs
- SafeCertificateStore.cs
- ArcSegment.cs
- ContainsSearchOperator.cs
- WindowProviderWrapper.cs
- CanonicalizationDriver.cs
- HwndAppCommandInputProvider.cs
- ColorInterpolationModeValidation.cs
- AddingNewEventArgs.cs
- XamlClipboardData.cs
- COM2ExtendedUITypeEditor.cs
- AnnotationHelper.cs