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
- HtmlShimManager.cs
- BlurEffect.cs
- DetailsViewDeletedEventArgs.cs
- Expressions.cs
- GiveFeedbackEvent.cs
- SystemDropShadowChrome.cs
- DocumentGridContextMenu.cs
- Roles.cs
- ChangeBlockUndoRecord.cs
- WebScriptServiceHost.cs
- BaseValidator.cs
- StringWriter.cs
- XmlComment.cs
- BitmapFrameEncode.cs
- webclient.cs
- MetafileHeader.cs
- EditorPartChrome.cs
- MonikerSyntaxException.cs
- ConnectionStringsExpressionBuilder.cs
- FakeModelPropertyImpl.cs
- FileNotFoundException.cs
- XmlLanguageConverter.cs
- AccessDataSource.cs
- XsdBuildProvider.cs
- NameHandler.cs
- BinaryCommonClasses.cs
- ServiceProviders.cs
- TransactionBridge.cs
- Int32Rect.cs
- DesignConnection.cs
- SmuggledIUnknown.cs
- BindableTemplateBuilder.cs
- AttachInfo.cs
- CreationContext.cs
- InheritanceUI.cs
- FlowDocumentReader.cs
- CountdownEvent.cs
- KnownTypesProvider.cs
- MemberProjectionIndex.cs
- StrokeNodeData.cs
- SubpageParagraph.cs
- ExtensionDataReader.cs
- remotingproxy.cs
- MenuCommand.cs
- HttpPostedFile.cs
- HtmlWindowCollection.cs
- SafeHandles.cs
- AutomationProperty.cs
- HtmlInputHidden.cs
- SeparatorAutomationPeer.cs
- ValidationSummary.cs
- StorageAssociationSetMapping.cs
- DebuggerAttributes.cs
- UserControlCodeDomTreeGenerator.cs
- SafeFileMapViewHandle.cs
- Function.cs
- Brushes.cs
- CompoundFileStorageReference.cs
- ProxyWebPartConnectionCollection.cs
- CalendarButtonAutomationPeer.cs
- ReceiveContent.cs
- CompiledQuery.cs
- Nodes.cs
- SimpleBitVector32.cs
- BulletedListEventArgs.cs
- DataGridViewComboBoxColumnDesigner.cs
- CacheMemory.cs
- EventProperty.cs
- Match.cs
- TraceUtility.cs
- DataKey.cs
- AsyncPostBackErrorEventArgs.cs
- TextContainerChangeEventArgs.cs
- EdmSchemaError.cs
- TextEditorMouse.cs
- HttpListener.cs
- _FtpDataStream.cs
- GroupBoxRenderer.cs
- StyleCollection.cs
- NumberFunctions.cs
- XLinq.cs
- DataGridViewCellStyleBuilderDialog.cs
- ManagedWndProcTracker.cs
- RichTextBoxAutomationPeer.cs
- WindowsBrush.cs
- XPathAncestorQuery.cs
- CommonObjectSecurity.cs
- PositiveTimeSpanValidatorAttribute.cs
- mongolianshape.cs
- Span.cs
- SplitterPanel.cs
- RectAnimation.cs
- DataBoundLiteralControl.cs
- ScaleTransform.cs
- DbDataSourceEnumerator.cs
- PointHitTestParameters.cs
- SiteMembershipCondition.cs
- ToolBar.cs
- SqlCommandBuilder.cs
- SecurityKeyEntropyMode.cs