Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / SupportsEventValidationAttribute.cs / 1305376 / SupportsEventValidationAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Web.UI { using System; using System.Collections; using System.ComponentModel; using System.Diagnostics; ////// [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; ////// [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
- AspNetCompatibilityRequirementsAttribute.cs
- OperatingSystem.cs
- ComponentGuaranteesAttribute.cs
- OletxEnlistment.cs
- SerializerProvider.cs
- UniqueConstraint.cs
- Lasso.cs
- CustomLineCap.cs
- OrderedDictionary.cs
- DbDataReader.cs
- XhtmlBasicValidationSummaryAdapter.cs
- BindingUtils.cs
- EntityContainerAssociationSet.cs
- SQLDouble.cs
- ToolStripItemCollection.cs
- QilDataSource.cs
- datacache.cs
- OrderedDictionary.cs
- ModulesEntry.cs
- RelationshipConstraintValidator.cs
- ComboBox.cs
- RequestQueue.cs
- TemplateControl.cs
- CompilationPass2Task.cs
- DataColumn.cs
- BehaviorService.cs
- PtsCache.cs
- DesignTimeTemplateParser.cs
- SymbolEqualComparer.cs
- dbenumerator.cs
- DeobfuscatingStream.cs
- OdbcConnection.cs
- ParameterToken.cs
- ProgressBarRenderer.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- AstNode.cs
- PathSegment.cs
- DescendantOverDescendantQuery.cs
- StylusSystemGestureEventArgs.cs
- FileDialogCustomPlacesCollection.cs
- InputMethodStateTypeInfo.cs
- AnnotationResourceCollection.cs
- TimeStampChecker.cs
- MarkupProperty.cs
- TreeViewImageIndexConverter.cs
- SelectionRangeConverter.cs
- TextProperties.cs
- Validator.cs
- XmlAttributeOverrides.cs
- GridViewColumnCollection.cs
- DataKey.cs
- NativeMethods.cs
- Oid.cs
- XPathCompileException.cs
- Assert.cs
- Visual.cs
- ImageClickEventArgs.cs
- Activator.cs
- ReadOnlyNameValueCollection.cs
- RequestCachePolicy.cs
- JsonDataContract.cs
- WindowsFormsEditorServiceHelper.cs
- figurelengthconverter.cs
- Serializer.cs
- ScrollItemPatternIdentifiers.cs
- PolicyAssertionCollection.cs
- HttpCookiesSection.cs
- CompilationSection.cs
- ZipPackage.cs
- ObjectTokenCategory.cs
- InspectionWorker.cs
- ApplicationManager.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ProxyGenerator.cs
- validationstate.cs
- FormViewUpdatedEventArgs.cs
- MappingItemCollection.cs
- SafeNativeMethods.cs
- ColorConvertedBitmap.cs
- WebContext.cs
- ToolStripPanelRenderEventArgs.cs
- UserControlBuildProvider.cs
- _KerberosClient.cs
- UIElement3DAutomationPeer.cs
- EncodingNLS.cs
- WebPartManagerInternals.cs
- SystemSounds.cs
- Stack.cs
- DataGridCellsPresenter.cs
- SoapWriter.cs
- BuildResult.cs
- KnownTypesProvider.cs
- AddDataControlFieldDialog.cs
- XmlSchemaInfo.cs
- SpoolingTaskBase.cs
- Restrictions.cs
- BufferedWebEventProvider.cs
- CodeGenerator.cs
- ContextMenuStripGroup.cs
- FieldCollectionEditor.cs