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
- RegexCaptureCollection.cs
- DataPagerFieldItem.cs
- SplayTreeNode.cs
- WmiEventSink.cs
- ExpandSegment.cs
- SQLBytesStorage.cs
- FileClassifier.cs
- AllowedAudienceUriElement.cs
- FileUtil.cs
- ConfigurationElementCollection.cs
- ConfigurationConverterBase.cs
- EmptyElement.cs
- PaintValueEventArgs.cs
- SynchronizationHandlesCodeDomSerializer.cs
- WindowsIPAddress.cs
- ComponentEditorForm.cs
- TextEditorSelection.cs
- TreeNodeStyleCollection.cs
- BamlTreeUpdater.cs
- SyndicationFeedFormatter.cs
- HeaderedContentControl.cs
- XamlStyleSerializer.cs
- WebPartManagerInternals.cs
- SmtpMail.cs
- ImportContext.cs
- BindingValueChangedEventArgs.cs
- GifBitmapEncoder.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- Attributes.cs
- DbParameterHelper.cs
- EventDescriptor.cs
- BitmapEffectGroup.cs
- ObjectDataSourceSelectingEventArgs.cs
- DataMemberConverter.cs
- isolationinterop.cs
- XmlTypeMapping.cs
- FontFaceLayoutInfo.cs
- HostSecurityManager.cs
- ReturnValue.cs
- SequentialUshortCollection.cs
- AccessDataSourceView.cs
- WindowInteractionStateTracker.cs
- TypeCollectionPropertyEditor.cs
- StateRuntime.cs
- StickyNote.cs
- AttachedAnnotation.cs
- Range.cs
- TypeExtensionConverter.cs
- TCPListener.cs
- RelationalExpressions.cs
- ControlEvent.cs
- RectConverter.cs
- RepeaterItemCollection.cs
- Attributes.cs
- ExecutionContext.cs
- ListViewItem.cs
- CSharpCodeProvider.cs
- TextEditorParagraphs.cs
- DataSourceControlBuilder.cs
- WebPartMovingEventArgs.cs
- AssemblyBuilderData.cs
- Line.cs
- EncoderReplacementFallback.cs
- Visual3D.cs
- CompatibleComparer.cs
- MailWriter.cs
- PreDigestedSignedInfo.cs
- CookieHandler.cs
- DelegateCompletionCallbackWrapper.cs
- StandardCommands.cs
- BlurBitmapEffect.cs
- RemotingService.cs
- FixedSOMPageConstructor.cs
- BufferAllocator.cs
- TableRowGroup.cs
- VirtualPathProvider.cs
- RelationshipWrapper.cs
- DateTimeParse.cs
- DmlSqlGenerator.cs
- HttpStreams.cs
- bidPrivateBase.cs
- XslNumber.cs
- GenerateDerivedKeyRequest.cs
- EncryptedType.cs
- SchemaObjectWriter.cs
- InvalidPipelineStoreException.cs
- FormViewUpdateEventArgs.cs
- Control.cs
- ProfilePropertySettingsCollection.cs
- LogAppendAsyncResult.cs
- WorkflowService.cs
- AspProxy.cs
- UpdateTranslator.cs
- BitmapEffectState.cs
- OracleTransaction.cs
- DataColumnChangeEvent.cs
- CapabilitiesSection.cs
- KeyMatchBuilder.cs
- EntityViewGenerator.cs
- MarkupWriter.cs