Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / CallbackValidator.cs / 1305376 / 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
- DrawingGroupDrawingContext.cs
- ScriptIgnoreAttribute.cs
- Span.cs
- XmlEntityReference.cs
- RC2.cs
- Logging.cs
- SizeLimitedCache.cs
- ExpandCollapseProviderWrapper.cs
- DbConnectionPoolCounters.cs
- StaticFileHandler.cs
- DataGridViewRow.cs
- MultiBindingExpression.cs
- RadioButtonList.cs
- ColorDialog.cs
- TaskFormBase.cs
- CodeTypeReference.cs
- WindowsGraphicsWrapper.cs
- TextSelectionHighlightLayer.cs
- SslStreamSecurityUpgradeProvider.cs
- ResourceType.cs
- WebContext.cs
- CollectionBase.cs
- GetCardDetailsRequest.cs
- DefaultPrintController.cs
- DataExpression.cs
- MarginsConverter.cs
- ObjectHelper.cs
- AssociationSet.cs
- NamedPipeTransportBindingElement.cs
- ForeignConstraint.cs
- Transform3DCollection.cs
- UntypedNullExpression.cs
- DataSourceSerializationException.cs
- QilIterator.cs
- AdPostCacheSubstitution.cs
- ClientRoleProvider.cs
- SystemPens.cs
- ClassData.cs
- log.cs
- ProcessHostConfigUtils.cs
- NullableLongAverageAggregationOperator.cs
- AVElementHelper.cs
- LocationUpdates.cs
- CriticalHandle.cs
- NullableDecimalSumAggregationOperator.cs
- Assembly.cs
- OLEDB_Util.cs
- SrgsDocument.cs
- HttpEncoderUtility.cs
- MetadataProperty.cs
- DataGridRowsPresenter.cs
- NativeMethods.cs
- MulticastNotSupportedException.cs
- CodeAttributeDeclaration.cs
- SQLInt16.cs
- UntypedNullExpression.cs
- ResourceBinder.cs
- SystemInformation.cs
- MultiBindingExpression.cs
- GlyphRun.cs
- SelfIssuedSamlTokenFactory.cs
- WaveHeader.cs
- ControlAdapter.cs
- ConfigurationConverterBase.cs
- NavigationExpr.cs
- FlowSwitchLink.cs
- AttachmentService.cs
- TypeBuilderInstantiation.cs
- XsdBuilder.cs
- ConfigurationElement.cs
- shaperfactory.cs
- RSAOAEPKeyExchangeFormatter.cs
- followingquery.cs
- DataGridSortCommandEventArgs.cs
- BamlLocalizer.cs
- Model3DCollection.cs
- UnsafeNativeMethods.cs
- Utils.cs
- Triangle.cs
- SynchronousReceiveElement.cs
- ObjectTokenCategory.cs
- RequestSecurityTokenSerializer.cs
- PointLight.cs
- EntitySetRetriever.cs
- HashJoinQueryOperatorEnumerator.cs
- XmlArrayItemAttribute.cs
- DataControlImageButton.cs
- NullableLongSumAggregationOperator.cs
- ValueSerializer.cs
- OpCodes.cs
- VerticalAlignConverter.cs
- OutOfMemoryException.cs
- ToolTipService.cs
- SafeHandles.cs
- SchemaCreator.cs
- SerializationAttributes.cs
- TreeIterator.cs
- FileDialog.cs
- PropertyValueChangedEvent.cs
- ExternalDataExchangeService.cs