Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / SupportsEventValidationAttribute.cs / 1 / SupportsEventValidationAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Web.UI { using System; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Security.Permissions; ////// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)] public sealed class SupportsEventValidationAttribute : Attribute { private static Hashtable _typesSupportsEventValidation; static SupportsEventValidationAttribute() { // Create a synchronized wrapper _typesSupportsEventValidation = Hashtable.Synchronized(new Hashtable()); } public SupportsEventValidationAttribute() { } internal static bool SupportsEventValidation(Type type) { object result = _typesSupportsEventValidation[type]; if (result != null) { return (bool)result; } // Check the attributes on the type to see if it supports SupportsEventValidationAttribute // Note that this attribute does not inherit from the base class, since derived classes may // not be able to validate properly. object[] attribs = type.GetCustomAttributes(typeof(SupportsEventValidationAttribute), false /* inherits */); bool supportsEventValidation = ((attribs != null) && (attribs.Length > 0)); _typesSupportsEventValidation[type] = supportsEventValidation; return supportsEventValidation; } } } // 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.Collections; using System.ComponentModel; using System.Diagnostics; using System.Security.Permissions; ////// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)] public sealed class SupportsEventValidationAttribute : Attribute { private static Hashtable _typesSupportsEventValidation; static SupportsEventValidationAttribute() { // Create a synchronized wrapper _typesSupportsEventValidation = Hashtable.Synchronized(new Hashtable()); } public SupportsEventValidationAttribute() { } internal static bool SupportsEventValidation(Type type) { object result = _typesSupportsEventValidation[type]; if (result != null) { return (bool)result; } // Check the attributes on the type to see if it supports SupportsEventValidationAttribute // Note that this attribute does not inherit from the base class, since derived classes may // not be able to validate properly. object[] attribs = type.GetCustomAttributes(typeof(SupportsEventValidationAttribute), false /* inherits */); bool supportsEventValidation = ((attribs != null) && (attribs.Length > 0)); _typesSupportsEventValidation[type] = supportsEventValidation; return supportsEventValidation; } } } // 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
- Walker.cs
- HttpListenerResponse.cs
- FontCacheUtil.cs
- CompositionAdorner.cs
- IfAction.cs
- MarkupProperty.cs
- RegexTree.cs
- ListDictionary.cs
- ConstructorBuilder.cs
- QueryOutputWriter.cs
- Lookup.cs
- FontStyles.cs
- X509Certificate.cs
- ImageMetadata.cs
- _TimerThread.cs
- SelectionRangeConverter.cs
- BitmapMetadataBlob.cs
- Clause.cs
- PluralizationServiceUtil.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ProgressBarRenderer.cs
- RuntimeVariablesExpression.cs
- DefaultMemberAttribute.cs
- PriorityBinding.cs
- IdentityHolder.cs
- Calendar.cs
- PathData.cs
- MdiWindowListItemConverter.cs
- XmlWriter.cs
- ImageFormat.cs
- _ChunkParse.cs
- ISAPIRuntime.cs
- FrameworkObject.cs
- AutomationPropertyInfo.cs
- AffineTransform3D.cs
- ValidatorCompatibilityHelper.cs
- TraceEventCache.cs
- MailMessageEventArgs.cs
- DefaultMemberAttribute.cs
- MessageBox.cs
- DecimalConverter.cs
- ErrorHandler.cs
- CustomErrorsSectionWrapper.cs
- DataGridPageChangedEventArgs.cs
- TextPenaltyModule.cs
- XmlAttributeOverrides.cs
- WaitForChangedResult.cs
- Base64Stream.cs
- BufferedOutputStream.cs
- XmlStreamedByteStreamReader.cs
- FlowDocumentReader.cs
- DataGridItemCollection.cs
- ComNativeDescriptor.cs
- StyleHelper.cs
- PtsPage.cs
- MailWebEventProvider.cs
- FormViewUpdateEventArgs.cs
- PackWebRequestFactory.cs
- RuleElement.cs
- CodeTypeParameterCollection.cs
- MasterPageCodeDomTreeGenerator.cs
- RoutedEventValueSerializer.cs
- PropertyEmitter.cs
- TabletDevice.cs
- wmiprovider.cs
- ListBindingHelper.cs
- CustomErrorCollection.cs
- StatusBarItemAutomationPeer.cs
- GraphicsPathIterator.cs
- CodeAttributeArgumentCollection.cs
- FontDriver.cs
- ListViewDeletedEventArgs.cs
- ObfuscationAttribute.cs
- CounterCreationData.cs
- RC2.cs
- PropertyInfoSet.cs
- RetrieveVirtualItemEventArgs.cs
- RegistrySecurity.cs
- Vector.cs
- OracleMonthSpan.cs
- ConversionValidationRule.cs
- RowBinding.cs
- Decimal.cs
- ComboBoxItem.cs
- UITypeEditor.cs
- SecurityManager.cs
- Int64Storage.cs
- _LoggingObject.cs
- Utilities.cs
- ContextBase.cs
- SmiRecordBuffer.cs
- StatusBarDrawItemEvent.cs
- SqlUserDefinedTypeAttribute.cs
- ObjectDataSourceFilteringEventArgs.cs
- ToolStripItemTextRenderEventArgs.cs
- backend.cs
- JsonWriterDelegator.cs
- Drawing.cs
- GridViewCancelEditEventArgs.cs
- InstanceHandleReference.cs