Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / TargetControlTypeAttribute.cs / 1305376 / TargetControlTypeAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Diagnostics.CodeAnalysis; using System.Web; [ AttributeUsage(AttributeTargets.Class, AllowMultiple = true) ] public sealed class TargetControlTypeAttribute : Attribute { private Type _targetControlType; public TargetControlTypeAttribute(Type targetControlType) { if (targetControlType == null) { throw new ArgumentNullException("targetControlType"); } _targetControlType = targetControlType; } public Type TargetControlType { get { return _targetControlType; } } // For attributes with AllowMultiple set to true, TypeDescriptor.GetAttributes() removes duplicate instances. // These are instances in which TypeId returns equal values. So we must override the TypeId property to // return a unique key. For this attribute, the unique key is just the target control type itself. // (DevDiv Bugs 111475) [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] public override object TypeId { get { return _targetControlType; } } } } // 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.Diagnostics.CodeAnalysis; using System.Web; [ AttributeUsage(AttributeTargets.Class, AllowMultiple = true) ] public sealed class TargetControlTypeAttribute : Attribute { private Type _targetControlType; public TargetControlTypeAttribute(Type targetControlType) { if (targetControlType == null) { throw new ArgumentNullException("targetControlType"); } _targetControlType = targetControlType; } public Type TargetControlType { get { return _targetControlType; } } // For attributes with AllowMultiple set to true, TypeDescriptor.GetAttributes() removes duplicate instances. // These are instances in which TypeId returns equal values. So we must override the TypeId property to // return a unique key. For this attribute, the unique key is just the target control type itself. // (DevDiv Bugs 111475) [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] public override object TypeId { get { return _targetControlType; } } } } // 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
- UnsafeNativeMethods.cs
- InvalidCommandTreeException.cs
- Highlights.cs
- CodeSubDirectory.cs
- TemplateControlBuildProvider.cs
- GlobalProxySelection.cs
- MultilineStringEditor.cs
- BrowserDefinition.cs
- ProfessionalColors.cs
- TransformedBitmap.cs
- ArcSegment.cs
- TargetControlTypeCache.cs
- SiteMapNodeItem.cs
- PowerStatus.cs
- DbConnectionPool.cs
- GridViewRowEventArgs.cs
- AccessDataSourceView.cs
- WebPartZone.cs
- ConfigUtil.cs
- FlowLayoutSettings.cs
- TextDecorationLocationValidation.cs
- TreeNodeSelectionProcessor.cs
- ConstantProjectedSlot.cs
- WebMessageEncoderFactory.cs
- ManagementQuery.cs
- MetadataItem_Static.cs
- MarkupObject.cs
- RuleSettings.cs
- EncryptedKeyHashIdentifierClause.cs
- CounterCreationData.cs
- FileInfo.cs
- TypeConverter.cs
- WindowsFormsLinkLabel.cs
- CryptoStream.cs
- Transform.cs
- SHA256Managed.cs
- LinearKeyFrames.cs
- SpotLight.cs
- Profiler.cs
- WebPartConnectionsConfigureVerb.cs
- BulletDecorator.cs
- translator.cs
- ServerTooBusyException.cs
- StringCollectionMarkupSerializer.cs
- EventDescriptorCollection.cs
- TableStyle.cs
- BezierSegment.cs
- GeneralTransform.cs
- EventArgs.cs
- FixedSOMPageElement.cs
- HttpModulesSection.cs
- WmpBitmapDecoder.cs
- ExtendedProperty.cs
- WindowPattern.cs
- AtlasWeb.Designer.cs
- HtmlInputPassword.cs
- LineGeometry.cs
- ColorAnimation.cs
- XmlSchema.cs
- RTLAwareMessageBox.cs
- HandlerMappingMemo.cs
- InkCanvasAutomationPeer.cs
- SoapRpcMethodAttribute.cs
- EndEvent.cs
- IPHostEntry.cs
- SpeakInfo.cs
- IndexerReference.cs
- DefaultBinder.cs
- RectConverter.cs
- EndPoint.cs
- PageRanges.cs
- TabItem.cs
- ParseHttpDate.cs
- DialogDivider.cs
- SymbolMethod.cs
- ValidatedControlConverter.cs
- VarInfo.cs
- LogManagementAsyncResult.cs
- CodeTypeDeclaration.cs
- XmlAttributes.cs
- EpmSourcePathSegment.cs
- TreeNodeMouseHoverEvent.cs
- FactoryGenerator.cs
- SqlNode.cs
- HtmlPageAdapter.cs
- ExtenderProvidedPropertyAttribute.cs
- Number.cs
- SemanticResultKey.cs
- DecimalAnimationUsingKeyFrames.cs
- HttpValueCollection.cs
- ConfigurationManagerInternal.cs
- MsmqIntegrationInputChannel.cs
- TimelineClockCollection.cs
- BindingList.cs
- SiteMapDataSource.cs
- AppDomainAttributes.cs
- HijriCalendar.cs
- LinkAreaEditor.cs
- ChildrenQuery.cs
- HtmlContainerControl.cs