Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- XmlSchemaAnnotation.cs
- TokenFactoryFactory.cs
- SinglePageViewer.cs
- PageThemeCodeDomTreeGenerator.cs
- SystemMulticastIPAddressInformation.cs
- SqlTypeSystemProvider.cs
- DTCTransactionManager.cs
- TemplatedControlDesigner.cs
- X509ChainPolicy.cs
- ParallelEnumerable.cs
- GeneratedCodeAttribute.cs
- StaticExtensionConverter.cs
- XmlExceptionHelper.cs
- ParserStack.cs
- DSGeneratorProblem.cs
- _NetRes.cs
- Encoder.cs
- FamilyCollection.cs
- sitestring.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- InvalidAsynchronousStateException.cs
- MessageTraceRecord.cs
- SafeNativeMethods.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- DictionaryBase.cs
- Number.cs
- ContextMenuStripGroup.cs
- MdiWindowListItemConverter.cs
- StylusPointCollection.cs
- SmiContext.cs
- RuleConditionDialog.cs
- EntityDataSourceStatementEditorForm.cs
- WebReference.cs
- UnsignedPublishLicense.cs
- BlurBitmapEffect.cs
- UpdateInfo.cs
- DeviceContext2.cs
- EraserBehavior.cs
- CryptoStream.cs
- Delegate.cs
- SmiMetaData.cs
- RoutedCommand.cs
- Accessible.cs
- mil_sdk_version.cs
- Aggregates.cs
- SqlTypesSchemaImporter.cs
- SoapAttributeAttribute.cs
- ChangesetResponse.cs
- WindowsListView.cs
- CompilerErrorCollection.cs
- linebase.cs
- MessageSecurityOverMsmqElement.cs
- DataBindEngine.cs
- ObjectStateEntryDbDataRecord.cs
- TextInfo.cs
- PasswordRecoveryAutoFormat.cs
- SQLDecimalStorage.cs
- VectorConverter.cs
- WinEventWrap.cs
- LeafCellTreeNode.cs
- TypeReference.cs
- StringBlob.cs
- TargetPerspective.cs
- ServiceCredentials.cs
- EditModeSwitchButton.cs
- RadioButtonBaseAdapter.cs
- WindowInteropHelper.cs
- FileDialog.cs
- HijriCalendar.cs
- AttributeUsageAttribute.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- UIntPtr.cs
- DoubleConverter.cs
- ExtendedTransformFactory.cs
- ScrollViewerAutomationPeer.cs
- SqlDataSourceStatusEventArgs.cs
- SqlPersonalizationProvider.cs
- ChangesetResponse.cs
- UidManager.cs
- StrongNameHelpers.cs
- BitmapScalingModeValidation.cs
- BooleanAnimationBase.cs
- DSASignatureDeformatter.cs
- TransformPattern.cs
- TypedAsyncResult.cs
- PersistenceTask.cs
- DataGridRowsPresenter.cs
- Queue.cs
- OracleNumber.cs
- ObjectDataSourceStatusEventArgs.cs
- SEHException.cs
- PublisherMembershipCondition.cs
- CfgRule.cs
- MenuItem.cs
- ProfileModule.cs
- MergeExecutor.cs
- TransactedBatchingElement.cs
- HitTestWithPointDrawingContextWalker.cs
- CompiledRegexRunner.cs
- VectorCollectionConverter.cs