Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- OleTxTransaction.cs
- ObjectDataSourceStatusEventArgs.cs
- InvalidOperationException.cs
- DataObjectSettingDataEventArgs.cs
- SmtpReplyReaderFactory.cs
- WithParamAction.cs
- MaskInputRejectedEventArgs.cs
- TransformDescriptor.cs
- Win32PrintDialog.cs
- FileSecurity.cs
- TrackBarRenderer.cs
- GraphicsState.cs
- IItemProperties.cs
- RecognizedWordUnit.cs
- AxisAngleRotation3D.cs
- loginstatus.cs
- EnvironmentPermission.cs
- EntryIndex.cs
- Binding.cs
- Matrix3D.cs
- CompilationPass2Task.cs
- UniqueIdentifierService.cs
- CodeStatement.cs
- ExtensionWindowHeader.cs
- StatusBarPanelClickEvent.cs
- SafeNativeMethods.cs
- ProtocolsConfigurationHandler.cs
- ADMembershipUser.cs
- TextControlDesigner.cs
- FlowDocumentPageViewerAutomationPeer.cs
- Enum.cs
- Item.cs
- StrokeDescriptor.cs
- QilInvokeLateBound.cs
- EpmAttributeNameBuilder.cs
- ActivitiesCollection.cs
- SettingsPropertyValueCollection.cs
- SystemIPInterfaceProperties.cs
- HttpCacheVaryByContentEncodings.cs
- SynchronizedRandom.cs
- PasswordTextNavigator.cs
- NamespaceCollection.cs
- Converter.cs
- ManagementEventArgs.cs
- LogicalExpr.cs
- SqlParameterCollection.cs
- SimpleRecyclingCache.cs
- _LoggingObject.cs
- SetIterators.cs
- COM2PictureConverter.cs
- DataGridViewSelectedCellCollection.cs
- RecognizeCompletedEventArgs.cs
- CompilerErrorCollection.cs
- OperatingSystem.cs
- XDeferredAxisSource.cs
- OperationPerformanceCounters.cs
- dbenumerator.cs
- CheckBoxFlatAdapter.cs
- SqlDataSourceCommandEventArgs.cs
- SingleTagSectionHandler.cs
- MimeTypePropertyAttribute.cs
- QilXmlReader.cs
- Empty.cs
- RowToParametersTransformer.cs
- TreeViewAutomationPeer.cs
- DrawingGroupDrawingContext.cs
- DetailsViewInsertEventArgs.cs
- TextDecoration.cs
- ActivityBuilderHelper.cs
- PriorityBinding.cs
- TemplateAction.cs
- OperationResponse.cs
- RectangleGeometry.cs
- Pen.cs
- NetworkInformationException.cs
- BrowsableAttribute.cs
- CommandManager.cs
- MembershipSection.cs
- IConvertible.cs
- RequestTimeoutManager.cs
- CodeCommentStatement.cs
- BuildResultCache.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- DataBoundLiteralControl.cs
- DesignerLoader.cs
- SystemSounds.cs
- AssertSection.cs
- Persist.cs
- XmlAnyAttributeAttribute.cs
- CoTaskMemSafeHandle.cs
- GlyphInfoList.cs
- DataTableMapping.cs
- FixedSOMFixedBlock.cs
- SiteMapSection.cs
- TransformPattern.cs
- CTreeGenerator.cs
- TextTrailingWordEllipsis.cs
- GeneratedView.cs
- EncoderBestFitFallback.cs
- HttpResponseInternalBase.cs