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
- AutomationEventArgs.cs
- HtmlTableRow.cs
- PenThreadPool.cs
- IntermediatePolicyValidator.cs
- GridViewUpdateEventArgs.cs
- SmtpFailedRecipientsException.cs
- BinaryObjectInfo.cs
- CodeIterationStatement.cs
- TraceListener.cs
- Size3D.cs
- RegexGroup.cs
- ProxyHelper.cs
- HMACSHA384.cs
- TextChange.cs
- ViewStateModeByIdAttribute.cs
- WebPartZoneCollection.cs
- ErrorRuntimeConfig.cs
- EventLogEntryCollection.cs
- XmlNodeReader.cs
- TextServicesProperty.cs
- Switch.cs
- SynchronousChannelMergeEnumerator.cs
- PathSegmentCollection.cs
- SurrogateSelector.cs
- MetadataConversionError.cs
- ErrorWrapper.cs
- ProfileSettings.cs
- BufferBuilder.cs
- ResourceReferenceKeyNotFoundException.cs
- SqlInternalConnection.cs
- WebConfigurationHost.cs
- FixedMaxHeap.cs
- sqlcontext.cs
- SspiWrapper.cs
- OleDbEnumerator.cs
- _NegoState.cs
- HashMembershipCondition.cs
- DataGridViewDataErrorEventArgs.cs
- MimeAnyImporter.cs
- Queue.cs
- AssemblyAssociatedContentFileAttribute.cs
- AnnouncementDispatcherAsyncResult.cs
- storagemappingitemcollection.viewdictionary.cs
- DebugHandleTracker.cs
- StatusBar.cs
- KeyInstance.cs
- HtmlShim.cs
- LowerCaseStringConverter.cs
- InfoCardUIAgent.cs
- MaskDesignerDialog.cs
- Stack.cs
- SendMailErrorEventArgs.cs
- AdRotator.cs
- ImportCatalogPart.cs
- XamlInt32CollectionSerializer.cs
- ExtendedProtectionPolicy.cs
- EraserBehavior.cs
- XslCompiledTransform.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SqlClientMetaDataCollectionNames.cs
- VScrollProperties.cs
- DesignerVerbCollection.cs
- OdbcTransaction.cs
- XmlBindingWorker.cs
- securitycriticaldataClass.cs
- QuaternionAnimation.cs
- Number.cs
- DataFormats.cs
- RtfToXamlReader.cs
- StylusPointPropertyInfo.cs
- DataGridViewCellParsingEventArgs.cs
- ContextDataSourceView.cs
- ToolStripOverflowButton.cs
- ProcessHostConfigUtils.cs
- DependencyProperty.cs
- WebBaseEventKeyComparer.cs
- dataobject.cs
- CheckBoxRenderer.cs
- SqlUDTStorage.cs
- XPathScanner.cs
- HGlobalSafeHandle.cs
- Pkcs7Signer.cs
- TypeSource.cs
- HoistedLocals.cs
- InstanceCollisionException.cs
- IUnknownConstantAttribute.cs
- WCFModelStrings.Designer.cs
- XmlSerializerAssemblyAttribute.cs
- Point4DConverter.cs
- HandledMouseEvent.cs
- Activity.cs
- PropertyNames.cs
- SourceFileBuildProvider.cs
- PersonalizableTypeEntry.cs
- URIFormatException.cs
- PointKeyFrameCollection.cs
- BufferedGraphicsContext.cs
- FilteredXmlReader.cs
- followingquery.cs
- DataGridViewRowsAddedEventArgs.cs