Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- UInt64.cs
- DataSourceCollectionBase.cs
- XmlNamespaceMappingCollection.cs
- MarkupExtensionSerializer.cs
- BeginStoryboard.cs
- GenericPrincipal.cs
- BindingMAnagerBase.cs
- AuthenticationSection.cs
- BitStream.cs
- MultiSelector.cs
- OdbcRowUpdatingEvent.cs
- ListControl.cs
- ResponseBodyWriter.cs
- XslCompiledTransform.cs
- VectorCollectionValueSerializer.cs
- HttpPostedFileWrapper.cs
- EntityPropertyMappingAttribute.cs
- Baml2006SchemaContext.cs
- FilterFactory.cs
- EmptyQuery.cs
- ToolstripProfessionalRenderer.cs
- RNGCryptoServiceProvider.cs
- RelationshipConstraintValidator.cs
- SqlRewriteScalarSubqueries.cs
- NameValueCollection.cs
- XmlCountingReader.cs
- PersonalizationAdministration.cs
- XmlSerializerOperationGenerator.cs
- InstallerTypeAttribute.cs
- UnauthorizedAccessException.cs
- PrintPreviewDialog.cs
- DoubleCollection.cs
- TriggerBase.cs
- RoutedEventValueSerializer.cs
- Trace.cs
- BrowserTree.cs
- ThreadExceptionDialog.cs
- ObfuscationAttribute.cs
- LostFocusEventManager.cs
- shaper.cs
- ToolStripDesigner.cs
- SourceItem.cs
- WebPartConnectionsDisconnectVerb.cs
- SynchronizedCollection.cs
- DataGridViewIntLinkedList.cs
- PolygonHotSpot.cs
- TextServicesPropertyRanges.cs
- JournalEntryListConverter.cs
- TextElementCollection.cs
- XmlReader.cs
- NotFiniteNumberException.cs
- HandleCollector.cs
- HttpWebRequestElement.cs
- ComplexPropertyEntry.cs
- MatrixUtil.cs
- StructuralType.cs
- TextReader.cs
- QueryExecutionOption.cs
- BinarySerializer.cs
- AffineTransform3D.cs
- StringConverter.cs
- DataRowCollection.cs
- ContainerUIElement3D.cs
- TextDecorationUnitValidation.cs
- CompilationSection.cs
- SolidColorBrush.cs
- AppDomainShutdownMonitor.cs
- EventProviderWriter.cs
- SQLMoneyStorage.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- StreamSecurityUpgradeInitiatorBase.cs
- Rect.cs
- TextViewSelectionProcessor.cs
- SessionStateModule.cs
- FtpRequestCacheValidator.cs
- UInt16.cs
- IntPtr.cs
- HostProtectionPermission.cs
- MethodToken.cs
- IPAddressCollection.cs
- TypeDelegator.cs
- ToolStripPanelRenderEventArgs.cs
- AnimationClock.cs
- ProjectionPruner.cs
- MSAAEventDispatcher.cs
- IERequestCache.cs
- CheckBox.cs
- PrePostDescendentsWalker.cs
- Marshal.cs
- EncryptedPackageFilter.cs
- AppDomainManager.cs
- CorrelationTokenInvalidatedHandler.cs
- DynamicDocumentPaginator.cs
- TransmissionStrategy.cs
- SoapTypeAttribute.cs
- StreamWithDictionary.cs
- TextContainerChangeEventArgs.cs
- QueryContext.cs
- XmlDocumentViewSchema.cs
- ListViewItem.cs