Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- Membership.cs
- LocationSectionRecord.cs
- EntityTypeEmitter.cs
- SharedUtils.cs
- CompletionProxy.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ItemList.cs
- DrawingVisual.cs
- TableParaClient.cs
- ColorDialog.cs
- MetadataSerializer.cs
- SamlAuthenticationClaimResource.cs
- UnmanagedMemoryStream.cs
- ClientApiGenerator.cs
- XmlSchemaCollection.cs
- WinInetCache.cs
- DocumentViewerAutomationPeer.cs
- XmlSchemaSimpleTypeUnion.cs
- CodeValidator.cs
- RegexStringValidator.cs
- ReverseInheritProperty.cs
- ValidationRule.cs
- SelectionRange.cs
- GridViewUpdateEventArgs.cs
- TreeViewItemAutomationPeer.cs
- InputLanguageProfileNotifySink.cs
- ReachPageContentSerializer.cs
- ProfileService.cs
- MappingModelBuildProvider.cs
- RsaKeyIdentifierClause.cs
- ConnectivityStatus.cs
- ObjectQueryExecutionPlan.cs
- LocalBuilder.cs
- SecurityProtocolCorrelationState.cs
- BulletedList.cs
- CompatibleComparer.cs
- ViewStateModeByIdAttribute.cs
- SafeFileHandle.cs
- CommentEmitter.cs
- BamlLocalizationDictionary.cs
- BasicKeyConstraint.cs
- XomlCompiler.cs
- ClientScriptManagerWrapper.cs
- PrinterSettings.cs
- ProtocolsSection.cs
- LabelLiteral.cs
- SkinIDTypeConverter.cs
- SessionStateUtil.cs
- SqlClientFactory.cs
- WizardPanelChangingEventArgs.cs
- SettingsBase.cs
- ResourceManagerWrapper.cs
- AssemblyCache.cs
- DynamicControl.cs
- EventSetter.cs
- GPStream.cs
- Switch.cs
- OletxDependentTransaction.cs
- InputLangChangeEvent.cs
- BackStopAuthenticationModule.cs
- SqlFunctions.cs
- ToolTip.cs
- ServiceMetadataContractBehavior.cs
- MimeObjectFactory.cs
- DesignerAutoFormat.cs
- ServiceBusyException.cs
- XmlHierarchicalDataSourceView.cs
- MouseCaptureWithinProperty.cs
- CodeParameterDeclarationExpression.cs
- HyperlinkAutomationPeer.cs
- WebPartConnectVerb.cs
- PropertyTab.cs
- KeyFrames.cs
- SelectManyQueryOperator.cs
- EFAssociationProvider.cs
- SessionStateContainer.cs
- LoginView.cs
- ParameterModifier.cs
- DropTarget.cs
- CachedFontFace.cs
- ListViewTableRow.cs
- MethodCallTranslator.cs
- Vector3DCollectionConverter.cs
- TouchesOverProperty.cs
- AmbientValueAttribute.cs
- ResourcePart.cs
- CodeIdentifiers.cs
- ResponseStream.cs
- RoutedUICommand.cs
- FilterException.cs
- DashStyle.cs
- HttpException.cs
- SqlUtil.cs
- ServiceProviders.cs
- SR.Designer.cs
- ObjectConverter.cs
- SecurityProtocol.cs
- GridViewCancelEditEventArgs.cs
- Tablet.cs
- XsltFunctions.cs