Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SymbolPair.cs
- ConditionCollection.cs
- ProbeDuplexAsyncResult.cs
- HtmlFormParameterWriter.cs
- CallSite.cs
- SplitContainerDesigner.cs
- ListBindingHelper.cs
- StatusStrip.cs
- HtmlElementErrorEventArgs.cs
- BufferBuilder.cs
- ConfigurationManager.cs
- KnownTypesProvider.cs
- CompoundFileDeflateTransform.cs
- HtmlMeta.cs
- MdImport.cs
- RegexReplacement.cs
- WmlListAdapter.cs
- UpdateProgress.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- ProviderBase.cs
- SystemIPInterfaceStatistics.cs
- AbsoluteQuery.cs
- GreenMethods.cs
- DateTimeValueSerializerContext.cs
- PropertyFilterAttribute.cs
- RequestQueue.cs
- Tokenizer.cs
- Brushes.cs
- DataGridTableCollection.cs
- AnnotationService.cs
- TextMessageEncodingElement.cs
- ConfigXmlText.cs
- SafeProcessHandle.cs
- SaveFileDialogDesigner.cs
- RijndaelManagedTransform.cs
- GridViewRowCollection.cs
- TraceData.cs
- ReplyChannelAcceptor.cs
- xmlfixedPageInfo.cs
- ToolStripItemCollection.cs
- CustomValidator.cs
- StaticFileHandler.cs
- LinkConverter.cs
- DbMetaDataCollectionNames.cs
- XmlValidatingReader.cs
- RelativeSource.cs
- ClientSession.cs
- ISFTagAndGuidCache.cs
- LinearGradientBrush.cs
- WindowsStatic.cs
- TypeNameHelper.cs
- LineMetrics.cs
- WorkflowDesignerMessageFilter.cs
- SAPICategories.cs
- CodeThrowExceptionStatement.cs
- StylusPointPropertyInfoDefaults.cs
- ImageSourceConverter.cs
- WhitespaceRuleReader.cs
- HierarchicalDataBoundControl.cs
- SqlParameterCollection.cs
- MenuItem.cs
- ObjectDisposedException.cs
- basevalidator.cs
- PrivilegeNotHeldException.cs
- DataRelationPropertyDescriptor.cs
- ZoneMembershipCondition.cs
- SinglePhaseEnlistment.cs
- BlockCollection.cs
- TextTreeInsertElementUndoUnit.cs
- XmlDictionaryReaderQuotas.cs
- LinkLabel.cs
- ReferentialConstraintRoleElement.cs
- JoinGraph.cs
- XmlRootAttribute.cs
- PriorityBinding.cs
- ActivationServices.cs
- WorkflowIdleBehavior.cs
- SchemaImporterExtensionElement.cs
- CacheHelper.cs
- PowerStatus.cs
- EventRouteFactory.cs
- StrokeRenderer.cs
- SimpleRecyclingCache.cs
- serverconfig.cs
- COSERVERINFO.cs
- TagPrefixAttribute.cs
- PropertyValue.cs
- StreamUpgradeAcceptor.cs
- FreezableCollection.cs
- InfoCardTrace.cs
- DBSqlParserTableCollection.cs
- OSFeature.cs
- RenderDataDrawingContext.cs
- ExpressionVisitorHelpers.cs
- DbParameterHelper.cs
- RSAOAEPKeyExchangeDeformatter.cs
- RangeBase.cs
- DetailsViewPagerRow.cs
- Registry.cs
- InProcStateClientManager.cs