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
- ExpressionVisitor.cs
- Matrix3DStack.cs
- SR.Designer.cs
- QilCloneVisitor.cs
- ObjectHandle.cs
- XmlDataSourceView.cs
- DispatcherProcessingDisabled.cs
- MetadataAssemblyHelper.cs
- TextWriterTraceListener.cs
- SemanticBasicElement.cs
- MultiView.cs
- XsdDateTime.cs
- ConfigurationSection.cs
- OnOperation.cs
- HScrollBar.cs
- Converter.cs
- PerfCounterSection.cs
- IntranetCredentialPolicy.cs
- Highlights.cs
- Accessible.cs
- MetadataCollection.cs
- InputMethod.cs
- Span.cs
- XmlSchemaChoice.cs
- BitSet.cs
- SqlSupersetValidator.cs
- TextBoxRenderer.cs
- CompletedAsyncResult.cs
- AnnouncementEventArgs.cs
- EncoderFallback.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- XmlQueryTypeFactory.cs
- StyleSheetRefUrlEditor.cs
- StateDesigner.LayoutSelectionGlyph.cs
- CommandDevice.cs
- XamlFxTrace.cs
- ImagingCache.cs
- PropertyCondition.cs
- PngBitmapEncoder.cs
- SqlFileStream.cs
- MimeReflector.cs
- PropertyEmitter.cs
- StubHelpers.cs
- DataTable.cs
- TypedReference.cs
- PenContexts.cs
- MenuItemCollection.cs
- TargetControlTypeCache.cs
- MetadataArtifactLoaderCompositeResource.cs
- wmiprovider.cs
- SwitchAttribute.cs
- BaseParser.cs
- DefaultHttpHandler.cs
- BCLDebug.cs
- WorkflowDesignerColors.cs
- Rect3DValueSerializer.cs
- EncryptedPackage.cs
- DbConnectionPoolOptions.cs
- SafeNativeMethods.cs
- CompensationHandlingFilter.cs
- CustomWebEventKey.cs
- TextEffectResolver.cs
- SqlVersion.cs
- ThrowOnMultipleAssignment.cs
- TogglePattern.cs
- AssociationProvider.cs
- MessageContractMemberAttribute.cs
- LoadRetryConstantStrategy.cs
- XmlCharacterData.cs
- SqlConnection.cs
- PrinterUnitConvert.cs
- PrivilegeNotHeldException.cs
- Vector3DValueSerializer.cs
- DeviceContext2.cs
- RawStylusActions.cs
- CoTaskMemHandle.cs
- SqlDependencyUtils.cs
- ScrollChangedEventArgs.cs
- FixedElement.cs
- JumpList.cs
- XmlCharType.cs
- SingleQueryOperator.cs
- Decoder.cs
- OptimisticConcurrencyException.cs
- ADMembershipProvider.cs
- UInt64Converter.cs
- PropertyDescriptorComparer.cs
- ZoneLinkButton.cs
- SpecialTypeDataContract.cs
- PingOptions.cs
- Enum.cs
- SessionEndingEventArgs.cs
- DataGridViewComboBoxEditingControl.cs
- NoneExcludedImageIndexConverter.cs
- KeyBinding.cs
- ObjectDataSourceDisposingEventArgs.cs
- Pair.cs
- ClientSettingsSection.cs
- SqlUtil.cs
- DataMemberConverter.cs