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
- ListGeneralPage.cs
- HtmlElement.cs
- OleServicesContext.cs
- UnsafeNativeMethods.cs
- Internal.cs
- SymmetricSecurityProtocolFactory.cs
- HttpWebRequest.cs
- ProfileSection.cs
- AuthorizationRule.cs
- TypeConverterValueSerializer.cs
- EntityDataSourceStatementEditor.cs
- DomainUpDown.cs
- FixedFlowMap.cs
- TextRunProperties.cs
- TraceHandler.cs
- RegexCompilationInfo.cs
- xmlfixedPageInfo.cs
- CategoryAttribute.cs
- TypeValidationEventArgs.cs
- MexTcpBindingElement.cs
- DocumentApplicationJournalEntryEventArgs.cs
- FixedTextView.cs
- EncodingConverter.cs
- TimeStampChecker.cs
- TimeIntervalCollection.cs
- CharUnicodeInfo.cs
- HyperLinkStyle.cs
- RolePrincipal.cs
- InfocardChannelParameter.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- TextElementEnumerator.cs
- UpdateException.cs
- WebScriptServiceHostFactory.cs
- NavigationProgressEventArgs.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- DataGridComboBoxColumn.cs
- EUCJPEncoding.cs
- DrawingAttributes.cs
- RawStylusInput.cs
- MasterPageParser.cs
- DispatcherFrame.cs
- MSHTMLHost.cs
- TagMapCollection.cs
- InvokeBinder.cs
- InternalTransaction.cs
- ComEventsHelper.cs
- FontCollection.cs
- SynchronizedReadOnlyCollection.cs
- TreeChangeInfo.cs
- HybridDictionary.cs
- AddInSegmentDirectoryNotFoundException.cs
- metadatamappinghashervisitor.cs
- NullReferenceException.cs
- WebPartManager.cs
- LocalizedNameDescriptionPair.cs
- fixedPageContentExtractor.cs
- InternalConfigEventArgs.cs
- StaticTextPointer.cs
- DataFormats.cs
- FixedSOMTextRun.cs
- TwoPhaseCommit.cs
- SqlServer2KCompatibilityCheck.cs
- AccessDataSource.cs
- ValidationHelper.cs
- QilInvoke.cs
- PageCatalogPart.cs
- DataGridViewRowsRemovedEventArgs.cs
- HttpAsyncResult.cs
- ContextMarshalException.cs
- MenuBase.cs
- ProfileService.cs
- ISAPIRuntime.cs
- DeviceFilterDictionary.cs
- Pair.cs
- ContextMenuStrip.cs
- CorrelationActionMessageFilter.cs
- RenderingBiasValidation.cs
- MD5.cs
- ExpressionEvaluator.cs
- Message.cs
- HtmlTernaryTree.cs
- RegexParser.cs
- ComponentSerializationService.cs
- ColumnCollection.cs
- UrlEncodedParameterWriter.cs
- Typeface.cs
- SymmetricCryptoHandle.cs
- ObjectSet.cs
- TraceListeners.cs
- DoWhile.cs
- MeasurementDCInfo.cs
- TypeToken.cs
- InkPresenterAutomationPeer.cs
- ObjectQueryProvider.cs
- SqlDataSourceEnumerator.cs
- InvalidAsynchronousStateException.cs
- xml.cs
- LongValidatorAttribute.cs
- CodeGroup.cs
- TextParagraphProperties.cs