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
- SyntaxCheck.cs
- DefaultPrintController.cs
- EntityTemplateFactory.cs
- ComNativeDescriptor.cs
- AnnotationComponentChooser.cs
- BindingContext.cs
- XmlSerializerImportOptions.cs
- LayoutUtils.cs
- TakeOrSkipWhileQueryOperator.cs
- JavaScriptString.cs
- LambdaExpression.cs
- HashCodeCombiner.cs
- SHA1.cs
- ButtonRenderer.cs
- ConfigurationProperty.cs
- DataPagerCommandEventArgs.cs
- InvokeBase.cs
- ImageClickEventArgs.cs
- BuildProviderAppliesToAttribute.cs
- BasicViewGenerator.cs
- ComplexBindingPropertiesAttribute.cs
- ExpressionSelection.cs
- WebSysDefaultValueAttribute.cs
- ExpressionNormalizer.cs
- FrameDimension.cs
- TrackingRecord.cs
- InvalidDocumentContentsException.cs
- lengthconverter.cs
- OleDbParameter.cs
- SessionStateUtil.cs
- LinqDataView.cs
- RefreshEventArgs.cs
- MouseOverProperty.cs
- CroppedBitmap.cs
- SafeNativeMethods.cs
- XsltContext.cs
- ToolStripRenderEventArgs.cs
- CacheVirtualItemsEvent.cs
- ImageSourceValueSerializer.cs
- ContentOperations.cs
- AsyncPostBackTrigger.cs
- SymbolResolver.cs
- InstallerTypeAttribute.cs
- ByeMessageApril2005.cs
- ListViewCancelEventArgs.cs
- ContentPresenter.cs
- CodePageUtils.cs
- ParameterToken.cs
- __ConsoleStream.cs
- FileUpload.cs
- SqlRowUpdatedEvent.cs
- HtmlAnchor.cs
- ConfigXmlDocument.cs
- Timeline.cs
- AnimationStorage.cs
- BamlTreeMap.cs
- ApplicationDirectory.cs
- LicenseProviderAttribute.cs
- StreamBodyWriter.cs
- SQLMembershipProvider.cs
- _Semaphore.cs
- Substitution.cs
- DateTimeFormat.cs
- XmlHierarchyData.cs
- ConfigXmlComment.cs
- SafeNativeMethods.cs
- DetailsViewModeEventArgs.cs
- SqlDataSourceDesigner.cs
- IriParsingElement.cs
- DataMisalignedException.cs
- BooleanStorage.cs
- LambdaCompiler.Logical.cs
- Switch.cs
- XXXInfos.cs
- ProfileEventArgs.cs
- TemplatedMailWebEventProvider.cs
- DataBindingCollection.cs
- safex509handles.cs
- OpCodes.cs
- ThreadNeutralSemaphore.cs
- ArraySegment.cs
- FileDialogCustomPlace.cs
- ControlsConfig.cs
- ImageMapEventArgs.cs
- HtmlControlPersistable.cs
- RightsManagementEncryptedStream.cs
- ValueProviderWrapper.cs
- Transform.cs
- SkipStoryboardToFill.cs
- StandardMenuStripVerb.cs
- XamlRtfConverter.cs
- Double.cs
- TimeSpan.cs
- GridSplitterAutomationPeer.cs
- TimelineCollection.cs
- localization.cs
- ActiveXSite.cs
- PropertyPathWorker.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- FormViewCommandEventArgs.cs