Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DebugInfoGenerator.cs
- DetailsViewPageEventArgs.cs
- ConfigurationManagerInternalFactory.cs
- FieldTemplateFactory.cs
- FileUtil.cs
- grammarelement.cs
- ListManagerBindingsCollection.cs
- PreviousTrackingServiceAttribute.cs
- ProtocolsConfigurationHandler.cs
- SchemaAttDef.cs
- sqlser.cs
- CodeAttributeArgumentCollection.cs
- OleDbParameter.cs
- TemplateControlCodeDomTreeGenerator.cs
- LicenseException.cs
- PointCollectionConverter.cs
- ArgumentNullException.cs
- InheritedPropertyChangedEventArgs.cs
- ClientSettings.cs
- XsdDateTime.cs
- util.cs
- MissingMethodException.cs
- WebPartEditVerb.cs
- ConfigurationValidatorAttribute.cs
- FileClassifier.cs
- PersistenceException.cs
- ZipIOExtraFieldZip64Element.cs
- WebFaultClientMessageInspector.cs
- HtmlFormWrapper.cs
- SHA256Managed.cs
- MimeImporter.cs
- DataGridViewUtilities.cs
- TableSectionStyle.cs
- DateTimeUtil.cs
- TimeSpanConverter.cs
- FixedSOMPageConstructor.cs
- TextElementEnumerator.cs
- ObjectSpanRewriter.cs
- SynchronizationScope.cs
- BadImageFormatException.cs
- CodeCastExpression.cs
- DeploymentExceptionMapper.cs
- UMPAttributes.cs
- PerspectiveCamera.cs
- PasswordBoxAutomationPeer.cs
- Panel.cs
- ToolStripArrowRenderEventArgs.cs
- PackageDocument.cs
- UserNamePasswordValidator.cs
- Rijndael.cs
- Region.cs
- DbParameterCollectionHelper.cs
- PermissionSet.cs
- MetafileHeader.cs
- StrongNameHelpers.cs
- ChainOfDependencies.cs
- AxisAngleRotation3D.cs
- PnrpPeerResolver.cs
- DescendentsWalkerBase.cs
- UniqueContractNameValidationBehavior.cs
- TextUtf8RawTextWriter.cs
- FolderBrowserDialog.cs
- Camera.cs
- XmlSiteMapProvider.cs
- BufferModesCollection.cs
- Visual3DCollection.cs
- HandlerBase.cs
- EmptyEnumerator.cs
- TileBrush.cs
- CodeLinePragma.cs
- ValidatingCollection.cs
- WorkflowInlining.cs
- ContentPlaceHolder.cs
- wgx_commands.cs
- FormatConvertedBitmap.cs
- returneventsaver.cs
- RemoveStoryboard.cs
- LockedAssemblyCache.cs
- ToolboxSnapDragDropEventArgs.cs
- HotCommands.cs
- RolePrincipal.cs
- ExpressionEditorAttribute.cs
- ConnectionManagementElementCollection.cs
- WebRequestModulesSection.cs
- EncoderExceptionFallback.cs
- TimeSpanStorage.cs
- DerivedKeySecurityTokenStub.cs
- BaseInfoTable.cs
- CorePropertiesFilter.cs
- UITypeEditor.cs
- ChannelDemuxer.cs
- UniformGrid.cs
- UnsafeNativeMethods.cs
- EndpointAddress.cs
- PenContexts.cs
- LazyTextWriterCreator.cs
- ImmutableCollection.cs
- SqlProviderServices.cs
- Query.cs
- IImplicitResourceProvider.cs