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
- LightweightEntityWrapper.cs
- ResourceProperty.cs
- InfocardInteractiveChannelInitializer.cs
- ProfilePropertyNameValidator.cs
- DbTransaction.cs
- XmlSchemaDocumentation.cs
- PrincipalPermission.cs
- XhtmlBasicTextViewAdapter.cs
- InputMethod.cs
- DataGridViewRowPrePaintEventArgs.cs
- TerminatorSinks.cs
- MessageSmuggler.cs
- TextRunCache.cs
- Operators.cs
- RequestNavigateEventArgs.cs
- UserNameSecurityTokenParameters.cs
- graph.cs
- TaiwanCalendar.cs
- XmlCustomFormatter.cs
- EventMappingSettings.cs
- AttributeConverter.cs
- ListViewGroupConverter.cs
- WorkflowInvoker.cs
- DataPagerFieldItem.cs
- SoapTypeAttribute.cs
- AssemblyCache.cs
- Hyperlink.cs
- DCSafeHandle.cs
- FtpCachePolicyElement.cs
- SqlCaseSimplifier.cs
- IndexExpression.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- DecimalAnimationUsingKeyFrames.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- BinHexEncoding.cs
- ContextMenu.cs
- SessionPageStateSection.cs
- ClientTargetCollection.cs
- SHA256.cs
- TextPointer.cs
- _WinHttpWebProxyDataBuilder.cs
- TreeView.cs
- ProvideValueServiceProvider.cs
- GridViewRow.cs
- RetriableClipboard.cs
- RTLAwareMessageBox.cs
- HttpListenerTimeoutManager.cs
- Double.cs
- ReadOnlyPropertyMetadata.cs
- SiteMapProvider.cs
- ItemCollectionEditor.cs
- OutputCacheSettingsSection.cs
- IsolatedStorageFileStream.cs
- DesignTimeTemplateParser.cs
- QuaternionAnimation.cs
- XamlPoint3DCollectionSerializer.cs
- COM2ExtendedUITypeEditor.cs
- UnionExpr.cs
- BeginGetFileNameFromUserRequest.cs
- FormViewCommandEventArgs.cs
- EventProviderBase.cs
- DataContractAttribute.cs
- ModulesEntry.cs
- TreeViewItemAutomationPeer.cs
- Int32AnimationUsingKeyFrames.cs
- MetabaseServerConfig.cs
- MultiAsyncResult.cs
- CharacterMetricsDictionary.cs
- TypeUnloadedException.cs
- CancelEventArgs.cs
- complextypematerializer.cs
- AppLevelCompilationSectionCache.cs
- LineVisual.cs
- AssemblySettingAttributes.cs
- SizeFConverter.cs
- FileCodeGroup.cs
- InputProcessorProfilesLoader.cs
- ContentDisposition.cs
- ValidationError.cs
- PropertyEmitterBase.cs
- HostedBindingBehavior.cs
- HttpDebugHandler.cs
- RegisteredArrayDeclaration.cs
- AtlasWeb.Designer.cs
- RotateTransform.cs
- InheritanceContextChangedEventManager.cs
- AssemblyCache.cs
- Quaternion.cs
- OrderedDictionary.cs
- WebPartDisplayModeCollection.cs
- JsonFormatGeneratorStatics.cs
- ChannelListenerBase.cs
- XPathAncestorIterator.cs
- SessionEndingEventArgs.cs
- FontUnit.cs
- CompatibleIComparer.cs
- Token.cs
- AuthorizationRule.cs
- ExpressionBinding.cs
- XomlCompilerError.cs