Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- HiddenField.cs
- DiagnosticSection.cs
- NotifyParentPropertyAttribute.cs
- Scene3D.cs
- SafeRightsManagementSessionHandle.cs
- SqlDataSourceWizardForm.cs
- HtmlContainerControl.cs
- XmlTypeAttribute.cs
- AspCompat.cs
- ConnectionPointCookie.cs
- MemberInfoSerializationHolder.cs
- RectangleHotSpot.cs
- TextViewBase.cs
- GridViewColumn.cs
- EnumMemberAttribute.cs
- filewebresponse.cs
- VectorCollection.cs
- Emitter.cs
- PackagePartCollection.cs
- ResourcePool.cs
- TemplateControlCodeDomTreeGenerator.cs
- EntityObject.cs
- ConfigXmlAttribute.cs
- TemplateParser.cs
- XsdCachingReader.cs
- XmlNamespaceManager.cs
- ScrollChrome.cs
- TypeExtensionSerializer.cs
- DropShadowEffect.cs
- HtmlValidatorAdapter.cs
- DataBinder.cs
- ValueTypeFixupInfo.cs
- ClientTargetSection.cs
- MonthChangedEventArgs.cs
- FrameworkContentElement.cs
- AssertSection.cs
- RequestTimeoutManager.cs
- RegexRunner.cs
- WebControl.cs
- MatrixTransform3D.cs
- SqlColumnizer.cs
- TextBox.cs
- TemplateControlCodeDomTreeGenerator.cs
- ChangeToolStripParentVerb.cs
- ArraySegment.cs
- CollectionConverter.cs
- StylusPlugInCollection.cs
- HostedElements.cs
- BuildDependencySet.cs
- InputQueue.cs
- DefaultSection.cs
- HtmlElementCollection.cs
- MimeMapping.cs
- Quad.cs
- ConstructorExpr.cs
- PtsPage.cs
- UnSafeCharBuffer.cs
- RectKeyFrameCollection.cs
- ToolBar.cs
- PreservationFileWriter.cs
- MediaElement.cs
- ControlDesigner.cs
- TextWriterTraceListener.cs
- TargetControlTypeCache.cs
- XPathChildIterator.cs
- Constraint.cs
- Int32RectValueSerializer.cs
- TextBlock.cs
- SecurityPolicySection.cs
- ObfuscationAttribute.cs
- NumericUpDown.cs
- MarshalByRefObject.cs
- Soap.cs
- HttpProcessUtility.cs
- SortDescriptionCollection.cs
- TagMapInfo.cs
- ProxyWebPartManagerDesigner.cs
- ImplicitInputBrush.cs
- MemberDomainMap.cs
- MiniMapControl.xaml.cs
- FileInfo.cs
- DebugView.cs
- PointCollection.cs
- CharEnumerator.cs
- ACE.cs
- ExecutionContext.cs
- WS2007FederationHttpBindingElement.cs
- DeviceContext2.cs
- DataListItemCollection.cs
- BulletChrome.cs
- TypeGeneratedEventArgs.cs
- SelectedDatesCollection.cs
- DTCTransactionManager.cs
- ByteStreamMessageEncoder.cs
- WebPartEditorApplyVerb.cs
- WebServiceEnumData.cs
- RichTextBoxDesigner.cs
- AssemblyUtil.cs
- Int32EqualityComparer.cs
- PassportIdentity.cs