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
- RequestCachePolicyConverter.cs
- WebPartCollection.cs
- DataSourceXmlSubItemAttribute.cs
- DataSourceGroupCollection.cs
- CodeMemberField.cs
- InstancePersistenceCommand.cs
- CodeGeneratorAttribute.cs
- TextTreeRootNode.cs
- SkewTransform.cs
- HandlerBase.cs
- ClientCultureInfo.cs
- RepeatInfo.cs
- DetailsViewInsertedEventArgs.cs
- _SSPIWrapper.cs
- FileLogRecordEnumerator.cs
- ConfigsHelper.cs
- GridLengthConverter.cs
- NamedPipeConnectionPoolSettingsElement.cs
- HttpResponseHeader.cs
- DesignTimeVisibleAttribute.cs
- JumpPath.cs
- ParallelActivityDesigner.cs
- ChannelSinkStacks.cs
- StrongNameUtility.cs
- BufferedReadStream.cs
- IteratorFilter.cs
- StylusPlugInCollection.cs
- RegexStringValidatorAttribute.cs
- DesignerAdRotatorAdapter.cs
- Marshal.cs
- RemotingConfiguration.cs
- InitializationEventAttribute.cs
- CheckPair.cs
- SQLInt16.cs
- ExpandedWrapper.cs
- Point3DCollectionValueSerializer.cs
- StringArrayEditor.cs
- FrameworkContentElement.cs
- SrgsElementList.cs
- ModifierKeysValueSerializer.cs
- MemberProjectionIndex.cs
- DocumentXmlWriter.cs
- GenericRootAutomationPeer.cs
- ZipIOLocalFileBlock.cs
- WSUtilitySpecificationVersion.cs
- SrgsDocument.cs
- Win32SafeHandles.cs
- Brushes.cs
- ConstructorExpr.cs
- MembershipAdapter.cs
- ReferenceEqualityComparer.cs
- NameScope.cs
- BulletedListEventArgs.cs
- TagPrefixCollection.cs
- ResourceDescriptionAttribute.cs
- ExpressionEditorAttribute.cs
- WindowsScroll.cs
- DataObjectCopyingEventArgs.cs
- TextContainerHelper.cs
- LabelDesigner.cs
- MetadataArtifactLoaderResource.cs
- ExpandCollapseProviderWrapper.cs
- DurableMessageDispatchInspector.cs
- Process.cs
- ContractMapping.cs
- RemoteDebugger.cs
- SchemaSetCompiler.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- BinaryFormatter.cs
- XmlConverter.cs
- MenuItem.cs
- VisualBrush.cs
- DynamicValidatorEventArgs.cs
- SignatureHelper.cs
- XmlNullResolver.cs
- StrongNameIdentityPermission.cs
- TimeoutException.cs
- ButtonBaseAdapter.cs
- OleDbSchemaGuid.cs
- TransformConverter.cs
- DataControlCommands.cs
- XmlRawWriter.cs
- ConfigXmlSignificantWhitespace.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ContextQuery.cs
- ExpressionBuilder.cs
- EntityTemplateFactory.cs
- ServiceDesigner.cs
- AppDomainManager.cs
- CodeAccessSecurityEngine.cs
- ConfigurationManagerInternalFactory.cs
- FixedStringLookup.cs
- TextShapeableCharacters.cs
- QueryExecutionOption.cs
- TemplatePagerField.cs
- WebPartHeaderCloseVerb.cs
- ExtractCollection.cs
- TransformValueSerializer.cs
- ThaiBuddhistCalendar.cs
- MeshGeometry3D.cs