Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Configuration / System / Configuration / CallbackValidator.cs / 1 / CallbackValidator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Collections.Specialized; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; using System.Text.RegularExpressions; namespace System.Configuration { public sealed class CallbackValidator : ConfigurationValidatorBase { Type _type; ValidatorCallback _callback; public CallbackValidator(Type type, ValidatorCallback callback) : this(callback) { if (type == null) { throw new ArgumentNullException("type"); } _type = type; } // Do not check for null type here to handle the callback attribute case internal CallbackValidator(ValidatorCallback callback) { if (callback == null) { throw new ArgumentNullException("callback"); } _type = null; _callback = callback; } public override bool CanValidate(Type type) { return (type == _type || _type == null); } public override void Validate(object value) { _callback(value); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Collections.Specialized; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; using System.Text.RegularExpressions; namespace System.Configuration { public sealed class CallbackValidator : ConfigurationValidatorBase { Type _type; ValidatorCallback _callback; public CallbackValidator(Type type, ValidatorCallback callback) : this(callback) { if (type == null) { throw new ArgumentNullException("type"); } _type = type; } // Do not check for null type here to handle the callback attribute case internal CallbackValidator(ValidatorCallback callback) { if (callback == null) { throw new ArgumentNullException("callback"); } _type = null; _callback = callback; } public override bool CanValidate(Type type) { return (type == _type || _type == null); } public override void Validate(object value) { _callback(value); } } } // 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
- odbcmetadatafactory.cs
- TypeTypeConverter.cs
- Exceptions.cs
- MetadataAssemblyHelper.cs
- ExpressionEditor.cs
- HttpException.cs
- StateFinalizationActivity.cs
- SafeHandles.cs
- UnmanagedBitmapWrapper.cs
- TextElementCollection.cs
- FixedSOMGroup.cs
- CorePropertiesFilter.cs
- FunctionOverloadResolver.cs
- ThousandthOfEmRealPoints.cs
- GregorianCalendar.cs
- LineGeometry.cs
- BinaryMessageEncodingElement.cs
- FtpRequestCacheValidator.cs
- AlphaSortedEnumConverter.cs
- BitmapSizeOptions.cs
- NetCodeGroup.cs
- _ListenerResponseStream.cs
- TextPointerBase.cs
- DoubleStorage.cs
- ContainerFilterService.cs
- StringUtil.cs
- FormsIdentity.cs
- RoutedCommand.cs
- PixelShader.cs
- MenuItemBindingCollection.cs
- ListViewGroup.cs
- Receive.cs
- ReverseInheritProperty.cs
- RequestUriProcessor.cs
- HandledEventArgs.cs
- XmlAnyElementAttribute.cs
- XmlSchemaImport.cs
- SendMailErrorEventArgs.cs
- CompatibleIComparer.cs
- DiscoveryReferences.cs
- HeaderCollection.cs
- Int32Rect.cs
- SolidBrush.cs
- VBCodeProvider.cs
- Configuration.cs
- OdbcUtils.cs
- SQLMoneyStorage.cs
- PreDigestedSignedInfo.cs
- DataGridViewRowCancelEventArgs.cs
- AppDomainCompilerProxy.cs
- SqlMultiplexer.cs
- ChangeTracker.cs
- TableStyle.cs
- BookmarkEventArgs.cs
- Contracts.cs
- VirtualPath.cs
- CheckBox.cs
- ArrayTypeMismatchException.cs
- OperationPickerDialog.cs
- GridViewDesigner.cs
- SelectionEditor.cs
- StorageFunctionMapping.cs
- TimeIntervalCollection.cs
- MimeTypeMapper.cs
- ContractComponent.cs
- OperandQuery.cs
- BaseParagraph.cs
- SimpleHandlerFactory.cs
- ChildChangedEventArgs.cs
- InputLanguageCollection.cs
- Psha1DerivedKeyGenerator.cs
- PrincipalPermission.cs
- SrgsRulesCollection.cs
- SamlNameIdentifierClaimResource.cs
- LinkButton.cs
- TimeoutConverter.cs
- SelectionRangeConverter.cs
- XmlSchemaComplexContentExtension.cs
- CodeChecksumPragma.cs
- HttpModuleAction.cs
- documentsequencetextview.cs
- connectionpool.cs
- ISSmlParser.cs
- XmlAttributeCollection.cs
- XmlConvert.cs
- Application.cs
- HandlerElement.cs
- StyleBamlRecordReader.cs
- LicenseProviderAttribute.cs
- EncodingTable.cs
- PriorityQueue.cs
- ValuePatternIdentifiers.cs
- PartDesigner.cs
- GetCryptoTransformRequest.cs
- StructuralType.cs
- SpotLight.cs
- _SslState.cs
- HttpCachePolicyBase.cs
- ColorBlend.cs
- ContentAlignmentEditor.cs