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
- CorrelationTokenInvalidatedHandler.cs
- TextFormatterImp.cs
- ListBoxItemWrapperAutomationPeer.cs
- ZipArchive.cs
- PkcsMisc.cs
- IResourceProvider.cs
- QueryOptionExpression.cs
- wgx_commands.cs
- IDQuery.cs
- PKCS1MaskGenerationMethod.cs
- CheckBoxField.cs
- Rect.cs
- DecimalFormatter.cs
- DocumentPaginator.cs
- PropertyDescriptorComparer.cs
- UnsafeNativeMethods.cs
- CodeArrayIndexerExpression.cs
- ContextStack.cs
- ZipIOFileItemStream.cs
- EventLogger.cs
- UserPreferenceChangingEventArgs.cs
- BitmapEffect.cs
- WebBrowserNavigatingEventHandler.cs
- CellNormalizer.cs
- XmlElementAttributes.cs
- AnnouncementSendsAsyncResult.cs
- SubtreeProcessor.cs
- KnownBoxes.cs
- XmlUtil.cs
- xdrvalidator.cs
- DataObjectMethodAttribute.cs
- FontConverter.cs
- XmlComplianceUtil.cs
- NamedElement.cs
- DesignColumn.cs
- InplaceBitmapMetadataWriter.cs
- DeviceSpecificDesigner.cs
- RowVisual.cs
- cookie.cs
- RowUpdatingEventArgs.cs
- Model3DGroup.cs
- DataControlFieldCollection.cs
- SafeNativeMethods.cs
- KeyValueInternalCollection.cs
- SessionEndedEventArgs.cs
- ZipIOBlockManager.cs
- LineGeometry.cs
- SchemaComplexType.cs
- TextContainerChangeEventArgs.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- TreeWalker.cs
- TabControlCancelEvent.cs
- TemplateBindingExtensionConverter.cs
- LabelEditEvent.cs
- SemanticTag.cs
- VerificationException.cs
- XmlSchemaAttributeGroup.cs
- SendKeys.cs
- DoubleIndependentAnimationStorage.cs
- TransformedBitmap.cs
- WindowInteropHelper.cs
- HandlerMappingMemo.cs
- typedescriptorpermissionattribute.cs
- DependencyObjectCodeDomSerializer.cs
- AmbientLight.cs
- ManipulationDeltaEventArgs.cs
- XmlHierarchicalEnumerable.cs
- GPPOINT.cs
- RegexGroupCollection.cs
- XPathDescendantIterator.cs
- ReadOnlyDataSourceView.cs
- MetaData.cs
- VerticalAlignConverter.cs
- CultureInfo.cs
- BamlRecordHelper.cs
- AccessViolationException.cs
- BrowserCapabilitiesCodeGenerator.cs
- TraceUtility.cs
- SapiInterop.cs
- SafeRightsManagementSessionHandle.cs
- XmlSchemaSimpleTypeRestriction.cs
- CachedBitmap.cs
- HtmlFormParameterReader.cs
- ToolboxItemLoader.cs
- CustomLineCap.cs
- ProgressBar.cs
- DbgCompiler.cs
- InputBindingCollection.cs
- InvalidOleVariantTypeException.cs
- Token.cs
- SafeTokenHandle.cs
- XmlQualifiedName.cs
- ISessionStateStore.cs
- WebPageTraceListener.cs
- Funcletizer.cs
- BaseValidator.cs
- RayHitTestParameters.cs
- ProcessThreadDesigner.cs
- PaginationProgressEventArgs.cs
- TraceHelpers.cs