Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- TextServicesCompartmentContext.cs
- ComboBoxHelper.cs
- ILGenerator.cs
- SmtpTransport.cs
- FontWeights.cs
- SqlDataSourceCommandEventArgs.cs
- Matrix3DStack.cs
- AtlasWeb.Designer.cs
- XmlSchemaSimpleTypeUnion.cs
- NotificationContext.cs
- SafeCryptContextHandle.cs
- RemotingConfiguration.cs
- BuildManagerHost.cs
- FormatException.cs
- oledbmetadatacolumnnames.cs
- EditorPartCollection.cs
- TableRowCollection.cs
- BulletedList.cs
- UriParserTemplates.cs
- VarRemapper.cs
- SHA1CryptoServiceProvider.cs
- ContentElement.cs
- DbProviderFactories.cs
- WebPartZoneCollection.cs
- CultureTable.cs
- RowVisual.cs
- LinqDataSourceContextEventArgs.cs
- ClientFactory.cs
- SupportsPreviewControlAttribute.cs
- StringFormat.cs
- CompilerScope.cs
- AccessDataSourceView.cs
- UInt64Converter.cs
- WebPartEditVerb.cs
- HttpListenerPrefixCollection.cs
- SimpleTypeResolver.cs
- Error.cs
- RequestContext.cs
- AdRotatorDesigner.cs
- XsltContext.cs
- TypeElement.cs
- Util.cs
- Positioning.cs
- Executor.cs
- QueryOutputWriter.cs
- TraceUtility.cs
- NativeCppClassAttribute.cs
- StateChangeEvent.cs
- CodeIdentifiers.cs
- SaveFileDialog.cs
- BaseAsyncResult.cs
- InheritanceRules.cs
- HttpCacheVary.cs
- VirtualDirectoryMapping.cs
- PaginationProgressEventArgs.cs
- ThreadStaticAttribute.cs
- ObjectTypeMapping.cs
- InvalidOleVariantTypeException.cs
- SqlGatherConsumedAliases.cs
- NavigatorInput.cs
- CodeCatchClauseCollection.cs
- HeaderUtility.cs
- RenameRuleObjectDialog.cs
- TableLayoutColumnStyleCollection.cs
- StickyNoteContentControl.cs
- EventEntry.cs
- ParameterCollection.cs
- HTMLTagNameToTypeMapper.cs
- FileFormatException.cs
- DBBindings.cs
- EncoderNLS.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- GroupDescription.cs
- XmlSchemaObject.cs
- PackageDigitalSignatureManager.cs
- SqlRetyper.cs
- Camera.cs
- RelOps.cs
- SqlServices.cs
- XmlSignatureManifest.cs
- CharacterString.cs
- DataGridViewImageCell.cs
- UInt64Storage.cs
- ChainOfResponsibility.cs
- TransformerInfo.cs
- ListControl.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- DataGridView.cs
- WebPartVerbsEventArgs.cs
- EventDescriptor.cs
- EntitySet.cs
- CodeThrowExceptionStatement.cs
- ServiceParser.cs
- DataGridViewColumnEventArgs.cs
- GroupBox.cs
- ipaddressinformationcollection.cs
- StreamWithDictionary.cs
- AnnotationResourceCollection.cs
- SmtpNegotiateAuthenticationModule.cs
- PreservationFileWriter.cs