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
- JavaScriptString.cs
- RightsManagementErrorHandler.cs
- FreezableCollection.cs
- Single.cs
- MachinePropertyVariants.cs
- TextWriterTraceListener.cs
- ResourcePart.cs
- SingleTagSectionHandler.cs
- Native.cs
- SequenceNumber.cs
- ToolboxItemCollection.cs
- EventHandlersDesigner.cs
- OrderedDictionary.cs
- LinkDescriptor.cs
- CancellationHandler.cs
- PropertyMappingExceptionEventArgs.cs
- EarlyBoundInfo.cs
- SqlDataRecord.cs
- UnSafeCharBuffer.cs
- SafeFileMappingHandle.cs
- PrePrepareMethodAttribute.cs
- GeneralTransform3D.cs
- ResourcePool.cs
- CursorConverter.cs
- TextDecorationLocationValidation.cs
- ClientRolePrincipal.cs
- DesigntimeLicenseContext.cs
- DbConnectionPoolGroup.cs
- PassportIdentity.cs
- Constants.cs
- CompositeDataBoundControl.cs
- MouseBinding.cs
- LinqDataSourceView.cs
- ToolStripLocationCancelEventArgs.cs
- IIS7WorkerRequest.cs
- OdbcEnvironmentHandle.cs
- DropSource.cs
- XmlAttributeOverrides.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- AnnotationAdorner.cs
- CodeConstructor.cs
- ProvidersHelper.cs
- MappingItemCollection.cs
- DataGridViewComboBoxEditingControl.cs
- MediaPlayerState.cs
- BinaryReader.cs
- ReadOnlyPropertyMetadata.cs
- PersonalizationStateQuery.cs
- VerticalAlignConverter.cs
- CompletedAsyncResult.cs
- StoryFragments.cs
- BamlRecords.cs
- SchemaInfo.cs
- ScriptingJsonSerializationSection.cs
- CookieParameter.cs
- XmlCodeExporter.cs
- InheritanceContextChangedEventManager.cs
- XmlEntityReference.cs
- XPathItem.cs
- TreeViewHitTestInfo.cs
- DataTemplate.cs
- SmiEventStream.cs
- DecoderNLS.cs
- OleDbConnection.cs
- SynchronizationScope.cs
- SplitterCancelEvent.cs
- Point3DAnimation.cs
- GiveFeedbackEvent.cs
- GorillaCodec.cs
- GridProviderWrapper.cs
- TextFormatterImp.cs
- ExpressionConverter.cs
- DataGridHeaderBorder.cs
- SqlDataRecord.cs
- CacheChildrenQuery.cs
- DefaultMemberAttribute.cs
- RouteParameter.cs
- AssemblyContextControlItem.cs
- CalculatedColumn.cs
- SuppressMergeCheckAttribute.cs
- EventHandlersDesigner.cs
- DefaultHttpHandler.cs
- ScriptingWebServicesSectionGroup.cs
- SystemIcmpV6Statistics.cs
- EraserBehavior.cs
- RuleRef.cs
- SelectionWordBreaker.cs
- Helpers.cs
- StyleReferenceConverter.cs
- Soap.cs
- UriSection.cs
- WebRequestModuleElement.cs
- TableRow.cs
- InputMethodStateChangeEventArgs.cs
- UrlAuthorizationModule.cs
- ReverseInheritProperty.cs
- ListArgumentProvider.cs
- IndexerNameAttribute.cs
- TraceUtils.cs
- DynamicILGenerator.cs