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
- DataSourceDescriptorCollection.cs
- ModuleBuilder.cs
- Util.cs
- FlowLayoutPanel.cs
- MenuItemStyleCollection.cs
- OdbcHandle.cs
- ArrayTypeMismatchException.cs
- ToolTip.cs
- HttpWebResponse.cs
- RowsCopiedEventArgs.cs
- DesigntimeLicenseContext.cs
- PlanCompiler.cs
- TextFormatterHost.cs
- ToolStripLocationCancelEventArgs.cs
- SchemaElementLookUpTable.cs
- FormViewInsertedEventArgs.cs
- CodeIterationStatement.cs
- OutputCacheSettingsSection.cs
- FileLevelControlBuilderAttribute.cs
- TextAction.cs
- RepeaterItemEventArgs.cs
- PolygonHotSpot.cs
- RtfToXamlLexer.cs
- COM2IDispatchConverter.cs
- PeerApplication.cs
- Timer.cs
- PDBReader.cs
- COM2PictureConverter.cs
- ProxyManager.cs
- SizeIndependentAnimationStorage.cs
- ScriptRef.cs
- FloaterBaseParagraph.cs
- diagnosticsswitches.cs
- ConfigurationManager.cs
- GridPattern.cs
- CodeBinaryOperatorExpression.cs
- OverflowException.cs
- VisualStyleInformation.cs
- DetailsViewCommandEventArgs.cs
- Point3DKeyFrameCollection.cs
- _SSPISessionCache.cs
- OptimalBreakSession.cs
- BitConverter.cs
- NetworkCredential.cs
- UpdatePanelTriggerCollection.cs
- BitmapMetadata.cs
- AssemblyHash.cs
- IPAddressCollection.cs
- GregorianCalendar.cs
- DesignerValidatorAdapter.cs
- MemoryMappedFile.cs
- AuthorizationRuleCollection.cs
- ParserOptions.cs
- XhtmlCssHandler.cs
- CatalogZoneBase.cs
- PrintingPermissionAttribute.cs
- ObjectPropertyMapping.cs
- TerminateWorkflow.cs
- Pair.cs
- Blend.cs
- Point4D.cs
- ExceptionUtil.cs
- SecurityHelper.cs
- XmlWrappingWriter.cs
- ReceiveContextCollection.cs
- ScriptModule.cs
- BooleanToVisibilityConverter.cs
- WebServiceReceiveDesigner.cs
- DbProviderFactory.cs
- PolicyVersion.cs
- XPathDocument.cs
- URLIdentityPermission.cs
- SafeHandles.cs
- ThicknessAnimationUsingKeyFrames.cs
- MonthChangedEventArgs.cs
- CharStorage.cs
- ValidatorCollection.cs
- ObjectDisposedException.cs
- HtmlControlAdapter.cs
- SerializationException.cs
- UnsafeNativeMethods.cs
- DBPropSet.cs
- AnnotationElement.cs
- RoleBoolean.cs
- CqlBlock.cs
- StreamUpgradeBindingElement.cs
- FilteredReadOnlyMetadataCollection.cs
- SelectedDatesCollection.cs
- FixUp.cs
- SrgsGrammarCompiler.cs
- Object.cs
- VarInfo.cs
- Relationship.cs
- LinqDataSourceValidationException.cs
- TagPrefixAttribute.cs
- TypeForwardedToAttribute.cs
- TagMapCollection.cs
- DesignerSerializerAttribute.cs
- OraclePermission.cs
- WebPartManagerInternals.cs