Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ ///// // 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.///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RewritingPass.cs
- AffineTransform3D.cs
- SqlXmlStorage.cs
- GlobalizationSection.cs
- TimelineCollection.cs
- InvalidDataContractException.cs
- PartialTrustHelpers.cs
- StringSource.cs
- BrowserCapabilitiesFactoryBase.cs
- GradientBrush.cs
- StrongNameIdentityPermission.cs
- validationstate.cs
- SkinIDTypeConverter.cs
- Camera.cs
- EntityDataSourceConfigureObjectContext.cs
- RtfToXamlReader.cs
- SymbolDocumentGenerator.cs
- ReachPageContentCollectionSerializer.cs
- ProtocolState.cs
- Stack.cs
- DataGridViewCellEventArgs.cs
- StrokeFIndices.cs
- IPAddressCollection.cs
- AbsoluteQuery.cs
- BooleanKeyFrameCollection.cs
- XPathDocumentBuilder.cs
- SqlXmlStorage.cs
- Vector3DValueSerializer.cs
- GenericEnumConverter.cs
- HtmlSelect.cs
- EntityProviderServices.cs
- RtfFormatStack.cs
- MatrixConverter.cs
- Label.cs
- Vars.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- CorePropertiesFilter.cs
- ErrorStyle.cs
- Ray3DHitTestResult.cs
- HttpPostedFile.cs
- EdgeProfileValidation.cs
- RequestSecurityToken.cs
- TextParaClient.cs
- Internal.cs
- ColumnResizeUndoUnit.cs
- CompilationRelaxations.cs
- GregorianCalendarHelper.cs
- HtmlInputCheckBox.cs
- DrawingContext.cs
- StaticExtensionConverter.cs
- SoapServerProtocol.cs
- BrowserCapabilitiesCompiler.cs
- PrincipalPermissionMode.cs
- ApplicationServicesHostFactory.cs
- Style.cs
- HwndHost.cs
- MultiAsyncResult.cs
- WebPartEditorCancelVerb.cs
- RangeValidator.cs
- storepermission.cs
- ExpressionBindingCollection.cs
- SafeNativeMethodsCLR.cs
- WorkflowRuntimeServiceElement.cs
- UnmanagedBitmapWrapper.cs
- Assembly.cs
- ParameterCollection.cs
- COM2ComponentEditor.cs
- CompilationLock.cs
- PlatformCulture.cs
- SqlCommand.cs
- COAUTHINFO.cs
- WorkflowPersistenceContext.cs
- ClaimTypeElementCollection.cs
- DomainLiteralReader.cs
- CatalogPartCollection.cs
- MimeWriter.cs
- XPathDocument.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- RemoteArgument.cs
- CounterCreationDataCollection.cs
- RtfToXamlReader.cs
- SiteMapNode.cs
- FileRecordSequence.cs
- ISessionStateStore.cs
- ProfileInfo.cs
- InheritanceContextChangedEventManager.cs
- DecimalAnimation.cs
- DependencyPropertyDescriptor.cs
- IdnElement.cs
- ComNativeDescriptor.cs
- WorkflowApplicationException.cs
- XmlElementCollection.cs
- XPathNodePointer.cs
- SqlBinder.cs
- Part.cs
- PeerNearMe.cs
- DBDataPermission.cs
- FrugalMap.cs
- Pen.cs
- WebPartTransformer.cs