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 / TargetControlTypeAttribute.cs / 1 / TargetControlTypeAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Diagnostics.CodeAnalysis; using System.Security.Permissions; using System.Web; [ AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), 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.Security.Permissions; using System.Web; [ AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), 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
- FieldAccessException.cs
- PathFigure.cs
- NamespaceEmitter.cs
- PlanCompiler.cs
- SingleStorage.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- XmlSchemaAnnotated.cs
- ScriptModule.cs
- XmlDataCollection.cs
- ReadContentAsBinaryHelper.cs
- SoapObjectInfo.cs
- WindowsButton.cs
- OrderingExpression.cs
- BasicBrowserDialog.cs
- ComplexPropertyEntry.cs
- WebPartCatalogAddVerb.cs
- SchemaImporterExtensionsSection.cs
- UriSection.cs
- Expressions.cs
- clipboard.cs
- Win32PrintDialog.cs
- ControlParameter.cs
- SqlDataAdapter.cs
- CommandHelpers.cs
- SiteOfOriginContainer.cs
- IdentitySection.cs
- NetStream.cs
- SearchForVirtualItemEventArgs.cs
- ChameleonKey.cs
- HostedElements.cs
- ShapeTypeface.cs
- FunctionParameter.cs
- TdsEnums.cs
- PagedControl.cs
- AuthenticationService.cs
- XmlReflectionImporter.cs
- EnumMemberAttribute.cs
- DataGridCellInfo.cs
- XmlNamespaceManager.cs
- HashCryptoHandle.cs
- LinqExpressionNormalizer.cs
- ReliableReplySessionChannel.cs
- RowCache.cs
- PrintController.cs
- FixedPageProcessor.cs
- precedingsibling.cs
- ErrorStyle.cs
- XmlSchemaComplexContent.cs
- DataContractSet.cs
- LambdaSerializationException.cs
- DummyDataSource.cs
- Invariant.cs
- AttributeAction.cs
- PolicyManager.cs
- MediaElementAutomationPeer.cs
- InstancePersistenceCommand.cs
- ObjectCloneHelper.cs
- ListViewGroup.cs
- HostingPreferredMapPath.cs
- Metadata.cs
- StreamGeometry.cs
- CompModSwitches.cs
- StreamGeometry.cs
- Hyperlink.cs
- Substitution.cs
- _TimerThread.cs
- _ContextAwareResult.cs
- ValidationPropertyAttribute.cs
- SqlPersonalizationProvider.cs
- Type.cs
- regiisutil.cs
- CodeCastExpression.cs
- ZipIOCentralDirectoryBlock.cs
- ObjectStateEntry.cs
- ClaimTypeElement.cs
- SecureUICommand.cs
- GetPageCompletedEventArgs.cs
- Image.cs
- TextEmbeddedObject.cs
- HtmlTextArea.cs
- RolePrincipal.cs
- ToolStripPanelCell.cs
- DataTablePropertyDescriptor.cs
- DependencyObjectType.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- COM2IDispatchConverter.cs
- NavigatorOutput.cs
- LinqDataSource.cs
- DataTemplateKey.cs
- LineBreakRecord.cs
- XmlKeywords.cs
- VBIdentifierDesigner.xaml.cs
- FolderLevelBuildProviderCollection.cs
- NativeRightsManagementAPIsStructures.cs
- XmlUTF8TextReader.cs
- SQLByte.cs
- CursorInteropHelper.cs
- CallId.cs
- ACL.cs
- dataprotectionpermissionattribute.cs