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
- SqlProviderManifest.cs
- BasicHttpMessageSecurity.cs
- XamlPathDataSerializer.cs
- InputLanguageManager.cs
- DataErrorValidationRule.cs
- WebPartZoneCollection.cs
- EdmConstants.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- ProgressBarBrushConverter.cs
- DefaultPropertiesToSend.cs
- ProfessionalColorTable.cs
- ConnectionPoolManager.cs
- CoreChannel.cs
- DispatchRuntime.cs
- ControlBuilderAttribute.cs
- ICspAsymmetricAlgorithm.cs
- SmtpNegotiateAuthenticationModule.cs
- WebSysDisplayNameAttribute.cs
- ObjectItemCachedAssemblyLoader.cs
- TypeCodeDomSerializer.cs
- SizeChangedInfo.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- ImageMap.cs
- RuleSetDialog.cs
- SafeMILHandle.cs
- DbExpressionRules.cs
- DefaultValueTypeConverter.cs
- ISO2022Encoding.cs
- SkipStoryboardToFill.cs
- TripleDES.cs
- CollectionView.cs
- TraceFilter.cs
- RegexParser.cs
- FollowerQueueCreator.cs
- TextElementEditingBehaviorAttribute.cs
- TextRangeEditLists.cs
- OdbcException.cs
- PointAnimationBase.cs
- ParentQuery.cs
- DataColumnMappingCollection.cs
- SQLConvert.cs
- UIElementHelper.cs
- SettingsSection.cs
- ColorDialog.cs
- IsolationInterop.cs
- OpenTypeLayout.cs
- ObjectItemAssemblyLoader.cs
- RawStylusInputReport.cs
- Vector3DAnimationBase.cs
- AlphaSortedEnumConverter.cs
- ByteKeyFrameCollection.cs
- SafeNativeMemoryHandle.cs
- TransactionScope.cs
- SqlClientMetaDataCollectionNames.cs
- Fonts.cs
- FormViewDeleteEventArgs.cs
- RegisteredArrayDeclaration.cs
- HttpCookie.cs
- SafeFindHandle.cs
- ThrowHelper.cs
- PathTooLongException.cs
- SecurityContext.cs
- DesignTimeXamlWriter.cs
- XamlTemplateSerializer.cs
- XmlSchemaComplexType.cs
- TypeInitializationException.cs
- HttpDebugHandler.cs
- NonDualMessageSecurityOverHttpElement.cs
- Int32AnimationBase.cs
- FixedDSBuilder.cs
- DataTableCollection.cs
- ConfigDefinitionUpdates.cs
- ThicknessKeyFrameCollection.cs
- ScriptingWebServicesSectionGroup.cs
- GetBrowserTokenRequest.cs
- MsmqVerifier.cs
- AppendHelper.cs
- basenumberconverter.cs
- FormatConvertedBitmap.cs
- InitializingNewItemEventArgs.cs
- BezierSegment.cs
- wgx_exports.cs
- StylusCaptureWithinProperty.cs
- TransformerTypeCollection.cs
- ZoneLinkButton.cs
- DesignerDataSourceView.cs
- DataServicePagingProviderWrapper.cs
- FacetValues.cs
- CfgParser.cs
- ExclusiveCanonicalizationTransform.cs
- SqlCommandSet.cs
- StatusBarPanel.cs
- SpotLight.cs
- DesignerPainter.cs
- TransportChannelFactory.cs
- SqlFunctionAttribute.cs
- WMICapabilities.cs
- GradientSpreadMethodValidation.cs
- WindowsTokenRoleProvider.cs
- ColorContextHelper.cs