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
- IdleTimeoutMonitor.cs
- xdrvalidator.cs
- Bitmap.cs
- ComNativeDescriptor.cs
- RandomNumberGenerator.cs
- BooleanAnimationBase.cs
- CompilerLocalReference.cs
- PathSegmentCollection.cs
- CodeRemoveEventStatement.cs
- ConditionalBranch.cs
- DictionarySectionHandler.cs
- ItemsControlAutomationPeer.cs
- TableLayout.cs
- ConstraintEnumerator.cs
- FlagsAttribute.cs
- TreeIterator.cs
- printdlgexmarshaler.cs
- DataGridViewComboBoxEditingControl.cs
- ToolStripDesigner.cs
- AttributeQuery.cs
- ProcessModelInfo.cs
- SynchronousChannelMergeEnumerator.cs
- TimeoutStream.cs
- ResizeGrip.cs
- DiscoveryRequestHandler.cs
- KnownBoxes.cs
- CompileLiteralTextParser.cs
- SafeViewOfFileHandle.cs
- StyleCollection.cs
- WizardStepCollectionEditor.cs
- ListViewInsertEventArgs.cs
- LexicalChunk.cs
- DataGridHeaderBorder.cs
- MenuItem.cs
- Point3D.cs
- XmlEncoding.cs
- TrackingCondition.cs
- XmlRawWriterWrapper.cs
- GeometryGroup.cs
- figurelength.cs
- SiteIdentityPermission.cs
- DriveNotFoundException.cs
- EnumBuilder.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- mediaeventargs.cs
- QueryStringParameter.cs
- LongTypeConverter.cs
- TraceRecord.cs
- CodeDomComponentSerializationService.cs
- MimeMapping.cs
- XmlSigningNodeWriter.cs
- EventLogReader.cs
- HyperLinkColumn.cs
- AttributedMetaModel.cs
- Gdiplus.cs
- URLBuilder.cs
- AlternateViewCollection.cs
- AffineTransform3D.cs
- GACMembershipCondition.cs
- Timer.cs
- ColumnResizeAdorner.cs
- OleDbEnumerator.cs
- KeyTimeConverter.cs
- CopyAction.cs
- LineSegment.cs
- DesignerSerializationOptionsAttribute.cs
- MSHTMLHost.cs
- ObjectSet.cs
- ResourceAssociationType.cs
- TextShapeableCharacters.cs
- UndoEngine.cs
- IndependentAnimationStorage.cs
- RSAPKCS1KeyExchangeFormatter.cs
- GridViewCommandEventArgs.cs
- SqlMethodCallConverter.cs
- BeginStoryboard.cs
- SingleObjectCollection.cs
- ObfuscateAssemblyAttribute.cs
- ConfigurationProperty.cs
- Window.cs
- DefinitionUpdate.cs
- CustomErrorCollection.cs
- ToolStrip.cs
- WebExceptionStatus.cs
- ExpressionParser.cs
- HScrollProperties.cs
- SqlServices.cs
- DataConnectionHelper.cs
- ViewStateModeByIdAttribute.cs
- X509UI.cs
- ModifierKeysConverter.cs
- ScriptResourceMapping.cs
- SqlRemoveConstantOrderBy.cs
- NumberFormatter.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- WithParamAction.cs
- HtmlInputText.cs
- PropertyChangedEventArgs.cs
- UIElement3D.cs
- SqlNamer.cs