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
- PointAnimationBase.cs
- ReaderWriterLockWrapper.cs
- EncoderFallback.cs
- MetadataArtifactLoaderComposite.cs
- CircleEase.cs
- PointLightBase.cs
- WebPartEditorApplyVerb.cs
- ValueTypeFixupInfo.cs
- HtmlInputCheckBox.cs
- FileDialogCustomPlacesCollection.cs
- XmlSchemaSequence.cs
- GroupBoxRenderer.cs
- CodeTypeParameterCollection.cs
- CustomAttribute.cs
- BitFlagsGenerator.cs
- ValueQuery.cs
- WebPartAuthorizationEventArgs.cs
- ThreadAttributes.cs
- HyperLinkDesigner.cs
- Attributes.cs
- Matrix.cs
- ControlBuilder.cs
- BamlCollectionHolder.cs
- ServiceHttpModule.cs
- SqlDataSource.cs
- DataException.cs
- SqlAggregateChecker.cs
- ButtonBaseAutomationPeer.cs
- ErrorWrapper.cs
- CredentialCache.cs
- ReadingWritingEntityEventArgs.cs
- EraserBehavior.cs
- WebPartMenu.cs
- EarlyBoundInfo.cs
- BindableAttribute.cs
- HttpCachePolicy.cs
- ServiceDesigner.cs
- QilList.cs
- FormViewPageEventArgs.cs
- Menu.cs
- PrivilegeNotHeldException.cs
- SqlConnectionFactory.cs
- WizardStepBase.cs
- EdmItemCollection.cs
- LinqDataSourceHelper.cs
- PathSegmentCollection.cs
- NCryptNative.cs
- TaskHelper.cs
- UnsafeNativeMethods.cs
- SessionIDManager.cs
- TaiwanCalendar.cs
- CLSCompliantAttribute.cs
- UIElementParaClient.cs
- PageAction.cs
- DataContext.cs
- Stylus.cs
- IsolatedStorageFilePermission.cs
- SecurityElementBase.cs
- MdImport.cs
- VersionPair.cs
- Binding.cs
- PrintDialog.cs
- PersonalizationDictionary.cs
- ServiceModelSecurityTokenTypes.cs
- IDQuery.cs
- DataGridRowClipboardEventArgs.cs
- UshortList2.cs
- TargetControlTypeAttribute.cs
- ToolStripDropDownItem.cs
- AddressHeader.cs
- DbInsertCommandTree.cs
- ComPlusContractBehavior.cs
- ActionFrame.cs
- TraceLog.cs
- Helper.cs
- TrustManagerMoreInformation.cs
- Fonts.cs
- BaseCodeDomTreeGenerator.cs
- GeneralTransform3DTo2DTo3D.cs
- StrokeNodeEnumerator.cs
- AlphabetConverter.cs
- DownloadProgressEventArgs.cs
- _NestedMultipleAsyncResult.cs
- BaseCollection.cs
- BitmapEffectDrawingContent.cs
- DataGridViewAccessibleObject.cs
- VideoDrawing.cs
- Registry.cs
- CheckBoxRenderer.cs
- ListViewItem.cs
- XamlInt32CollectionSerializer.cs
- DefaultConfirmation.cs
- FixedSOMTableRow.cs
- UnsafeNativeMethods.cs
- RewritingSimplifier.cs
- SwitchCase.cs
- WebBrowserProgressChangedEventHandler.cs
- ToolStripPanelCell.cs
- PageContentAsyncResult.cs
- HttpProfileGroupBase.cs