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
- BevelBitmapEffect.cs
- GACMembershipCondition.cs
- FunctionImportElement.cs
- DragCompletedEventArgs.cs
- AbandonedMutexException.cs
- EncryptedXml.cs
- ConsoleTraceListener.cs
- KnownTypesProvider.cs
- XmlExtensionFunction.cs
- WorkItem.cs
- XmlAttributeAttribute.cs
- BindUriHelper.cs
- ResponseBodyWriter.cs
- ObservableCollection.cs
- HtmlForm.cs
- LinqDataSourceDisposeEventArgs.cs
- DrawTreeNodeEventArgs.cs
- ValueOfAction.cs
- AssemblyCache.cs
- TreeIterators.cs
- FamilyMapCollection.cs
- SpellerInterop.cs
- TransformCollection.cs
- CellTreeNodeVisitors.cs
- XmlSchemaNotation.cs
- EntityContainer.cs
- IBuiltInEvidence.cs
- RouteItem.cs
- DesignTimeVisibleAttribute.cs
- DataTemplate.cs
- CalendarModeChangedEventArgs.cs
- TraceFilter.cs
- RightNameExpirationInfoPair.cs
- CharStorage.cs
- CapabilitiesRule.cs
- WebPartsPersonalization.cs
- ReflectionUtil.cs
- InstancePersistenceCommandException.cs
- TextParaLineResult.cs
- Single.cs
- ItemList.cs
- VectorCollectionConverter.cs
- FormsAuthenticationModule.cs
- EmptyCollection.cs
- TransformGroup.cs
- FlowDocumentScrollViewer.cs
- XmlReaderDelegator.cs
- PointKeyFrameCollection.cs
- RefreshPropertiesAttribute.cs
- CellCreator.cs
- TraceHandlerErrorFormatter.cs
- LockRenewalTask.cs
- ListBox.cs
- DbDataAdapter.cs
- CompareInfo.cs
- DataGridViewSortCompareEventArgs.cs
- EntitySetDataBindingList.cs
- XmlEventCache.cs
- IndexOutOfRangeException.cs
- DefaultSection.cs
- ButtonRenderer.cs
- CompilerHelpers.cs
- BrowserCapabilitiesFactoryBase.cs
- DecoderReplacementFallback.cs
- CompositeControl.cs
- SpnegoTokenProvider.cs
- Site.cs
- DataGridViewComboBoxCell.cs
- GridLengthConverter.cs
- Size.cs
- ExtensionDataReader.cs
- OleDbRowUpdatingEvent.cs
- XmlValueConverter.cs
- CollectionChangeEventArgs.cs
- CompilerGlobalScopeAttribute.cs
- WebPartEditorOkVerb.cs
- JsonFormatGeneratorStatics.cs
- BitmapMetadataBlob.cs
- SqlVersion.cs
- SHA1.cs
- GeometryCombineModeValidation.cs
- CapabilitiesSection.cs
- Context.cs
- BamlRecordReader.cs
- SqlTriggerContext.cs
- XmlProcessingInstruction.cs
- FormsAuthenticationModule.cs
- AsymmetricSignatureDeformatter.cs
- IdentityReference.cs
- clipboard.cs
- ProjectionPlanCompiler.cs
- ReachBasicContext.cs
- TakeQueryOptionExpression.cs
- DataComponentGenerator.cs
- ExpressionLexer.cs
- WebPartsSection.cs
- StickyNoteAnnotations.cs
- AudioDeviceOut.cs
- ParamArrayAttribute.cs
- XhtmlConformanceSection.cs