Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Query.cs
- Compiler.cs
- Column.cs
- UserNamePasswordValidator.cs
- QilExpression.cs
- RequiredFieldValidator.cs
- MatrixAnimationBase.cs
- WorkflowViewManager.cs
- TextControl.cs
- RefType.cs
- SymmetricCryptoHandle.cs
- ToolStripHighContrastRenderer.cs
- AccessControlEntry.cs
- PointCollection.cs
- TextDocumentView.cs
- AttributeEmitter.cs
- FontDifferentiator.cs
- MetadataHelper.cs
- XmlUtil.cs
- HandleScope.cs
- ConnectAlgorithms.cs
- SelectiveScrollingGrid.cs
- SiteMapNodeCollection.cs
- InternalSendMessage.cs
- IPEndPoint.cs
- AssemblySettingAttributes.cs
- DefaultBindingPropertyAttribute.cs
- CodeSubDirectory.cs
- WebPartConnectionsCancelVerb.cs
- SendMailErrorEventArgs.cs
- InputProviderSite.cs
- ObjectQueryProvider.cs
- HttpCacheVaryByContentEncodings.cs
- ModuleElement.cs
- Calendar.cs
- RegexCaptureCollection.cs
- DataSourceCache.cs
- HttpWriter.cs
- SQLRoleProvider.cs
- DataGridViewElement.cs
- processwaithandle.cs
- TimelineGroup.cs
- CompilerError.cs
- TimersDescriptionAttribute.cs
- AnimationStorage.cs
- WpfSharedBamlSchemaContext.cs
- Console.cs
- BitmapEncoder.cs
- SettingsAttributes.cs
- TextShapeableCharacters.cs
- FrameworkContentElement.cs
- ClientBuildManagerCallback.cs
- SafeFileHandle.cs
- LicenseException.cs
- COM2Enum.cs
- Color.cs
- HttpConfigurationContext.cs
- SharedStatics.cs
- InvokeBinder.cs
- RtfToken.cs
- GlobalProxySelection.cs
- __Error.cs
- C14NUtil.cs
- XmlSerializationGeneratedCode.cs
- XmlReflectionMember.cs
- DataGridClipboardHelper.cs
- PreviousTrackingServiceAttribute.cs
- ChildTable.cs
- EncryptedKey.cs
- SqlPersonalizationProvider.cs
- HtmlInputReset.cs
- LabelExpression.cs
- TextFormatterImp.cs
- ActivityInstanceMap.cs
- FunctionMappingTranslator.cs
- ParallelTimeline.cs
- BinaryParser.cs
- Overlapped.cs
- SamlAuthorizationDecisionClaimResource.cs
- SqlErrorCollection.cs
- VirtualizedCellInfoCollection.cs
- SymmetricKey.cs
- VariableQuery.cs
- KeySplineConverter.cs
- GeneralTransform2DTo3D.cs
- IncomingWebResponseContext.cs
- DesignTimeVisibleAttribute.cs
- DiagnosticTrace.cs
- TimeIntervalCollection.cs
- ZipIOCentralDirectoryFileHeader.cs
- SvcMapFileLoader.cs
- Cell.cs
- CustomDictionarySources.cs
- BaseDataBoundControl.cs
- _NegoStream.cs
- recordstatescratchpad.cs
- HandleCollector.cs
- TagMapCollection.cs
- XmlIterators.cs
- MenuItem.cs