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
- OleDbErrorCollection.cs
- AsyncPostBackTrigger.cs
- BitmapEncoder.cs
- FrameDimension.cs
- InvokeMethodDesigner.xaml.cs
- StylusPointPropertyInfoDefaults.cs
- ThemeInfoAttribute.cs
- Adorner.cs
- ObjectDataSourceEventArgs.cs
- ServiceChannelManager.cs
- ServiceInstallComponent.cs
- HandlerBase.cs
- DataTableMappingCollection.cs
- SqlCommand.cs
- WindowsToolbarItemAsMenuItem.cs
- ConditionedDesigner.cs
- GenericPrincipal.cs
- XmlILStorageConverter.cs
- dataSvcMapFileLoader.cs
- Misc.cs
- MessageQueueCriteria.cs
- OutputScopeManager.cs
- TagPrefixCollection.cs
- MessagePropertyDescriptionCollection.cs
- figurelength.cs
- DataObject.cs
- ControlPropertyNameConverter.cs
- ReaderOutput.cs
- CmsUtils.cs
- RefExpr.cs
- LineSegment.cs
- DrawingContextDrawingContextWalker.cs
- HTMLTextWriter.cs
- MultipartIdentifier.cs
- CurrencyManager.cs
- Int64Converter.cs
- RelatedEnd.cs
- WebEventCodes.cs
- BaseServiceProvider.cs
- FillRuleValidation.cs
- TraceInternal.cs
- StringAttributeCollection.cs
- CompiledRegexRunner.cs
- Rotation3DKeyFrameCollection.cs
- DataSetMappper.cs
- SQLSingle.cs
- ToolstripProfessionalRenderer.cs
- FileAuthorizationModule.cs
- NamespaceInfo.cs
- ObjectDataSource.cs
- HttpGetServerProtocol.cs
- CssClassPropertyAttribute.cs
- ObjectDesignerDataSourceView.cs
- FormatterConverter.cs
- PowerModeChangedEventArgs.cs
- Privilege.cs
- UTF7Encoding.cs
- EntityDataSourceEntitySetNameItem.cs
- PeerEndPoint.cs
- TypeResolver.cs
- DBConcurrencyException.cs
- SoapCommonClasses.cs
- validationstate.cs
- WebPartAuthorizationEventArgs.cs
- XmlChildNodes.cs
- QueryContinueDragEvent.cs
- RootBuilder.cs
- AbstractDataSvcMapFileLoader.cs
- InvalidCastException.cs
- CodeDelegateCreateExpression.cs
- TextRangeProviderWrapper.cs
- ZipIOBlockManager.cs
- ObjectSecurity.cs
- Wizard.cs
- VirtualPath.cs
- _DisconnectOverlappedAsyncResult.cs
- SerializationStore.cs
- DataBindEngine.cs
- DESCryptoServiceProvider.cs
- ErrorEventArgs.cs
- EventlogProvider.cs
- JsonQueryStringConverter.cs
- Wizard.cs
- ShaperBuffers.cs
- HttpCacheParams.cs
- ContextMarshalException.cs
- PeerNameResolver.cs
- RegexCharClass.cs
- WebServiceData.cs
- TTSEngineProxy.cs
- WindowsTooltip.cs
- DetailsViewUpdatedEventArgs.cs
- WebControlsSection.cs
- SimpleWorkerRequest.cs
- TableAdapterManagerGenerator.cs
- RpcAsyncResult.cs
- OleDbSchemaGuid.cs
- ScriptingJsonSerializationSection.cs
- TextTreeInsertUndoUnit.cs
- StringResourceManager.cs