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
- EmptyStringExpandableObjectConverter.cs
- ServicesUtilities.cs
- XmlSerializerVersionAttribute.cs
- OdbcEnvironment.cs
- ObjectHandle.cs
- MimePart.cs
- BevelBitmapEffect.cs
- Canvas.cs
- EncryptedType.cs
- ProviderConnectionPointCollection.cs
- SR.cs
- TypeNameConverter.cs
- RequestUriProcessor.cs
- MapPathBasedVirtualPathProvider.cs
- ObjectMemberMapping.cs
- QueryAccessibilityHelpEvent.cs
- PkcsMisc.cs
- EDesignUtil.cs
- CanonicalFontFamilyReference.cs
- ComplexPropertyEntry.cs
- StaticResourceExtension.cs
- Automation.cs
- FixedSOMFixedBlock.cs
- WorkflowPageSetupDialog.cs
- CheckBox.cs
- CultureInfoConverter.cs
- DocumentPageView.cs
- FileSystemWatcher.cs
- InternalRelationshipCollection.cs
- DesignerCatalogPartChrome.cs
- RC2.cs
- AppDomainFactory.cs
- TextDecorationUnitValidation.cs
- Html32TextWriter.cs
- PtsPage.cs
- CodeCastExpression.cs
- ChildDocumentBlock.cs
- DBPropSet.cs
- PreviewPrintController.cs
- LicenseException.cs
- ConstNode.cs
- ColorConvertedBitmapExtension.cs
- MenuItemAutomationPeer.cs
- DecodeHelper.cs
- UserInitiatedNavigationPermission.cs
- BooleanExpr.cs
- DateTimeValueSerializer.cs
- DataGridViewCellValidatingEventArgs.cs
- FlowDocument.cs
- CultureTableRecord.cs
- ExpressionPrefixAttribute.cs
- SettingsProviderCollection.cs
- ConfigurationStrings.cs
- WSTrust.cs
- PathFigureCollection.cs
- HighContrastHelper.cs
- ServiceEndpointAssociationProvider.cs
- GetWorkflowTree.cs
- SimpleExpression.cs
- StdValidatorsAndConverters.cs
- FixedBufferAttribute.cs
- mediaeventargs.cs
- DataGridViewSelectedColumnCollection.cs
- DispatcherTimer.cs
- InheritedPropertyChangedEventArgs.cs
- JournalEntry.cs
- mediaeventshelper.cs
- EncodedStreamFactory.cs
- ApplyTemplatesAction.cs
- SystemDropShadowChrome.cs
- TraceListener.cs
- PageCodeDomTreeGenerator.cs
- ValueUtilsSmi.cs
- CodeCastExpression.cs
- HiddenField.cs
- MiniConstructorInfo.cs
- SimpleType.cs
- ApplicationGesture.cs
- FormViewPageEventArgs.cs
- PostBackTrigger.cs
- DriveInfo.cs
- Debug.cs
- DataQuery.cs
- DelegatingConfigHost.cs
- Parser.cs
- DataGridViewComboBoxCell.cs
- XmlDomTextWriter.cs
- latinshape.cs
- SafeNativeMethods.cs
- VisualBrush.cs
- CurrencyWrapper.cs
- PersonalizableTypeEntry.cs
- FlowLayoutPanel.cs
- FileDataSourceCache.cs
- DataPagerCommandEventArgs.cs
- HitTestParameters.cs
- PermissionRequestEvidence.cs
- ServiceMetadataExtension.cs
- WebBrowserNavigatedEventHandler.cs
- AutomationElement.cs