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
- AttributeEmitter.cs
- SecurityHeaderTokenResolver.cs
- VirtualPathProvider.cs
- TextShapeableCharacters.cs
- WinCategoryAttribute.cs
- DataColumnCollection.cs
- UniqueEventHelper.cs
- Clipboard.cs
- ValidationSummary.cs
- SamlAuthorityBinding.cs
- DesignerOptionService.cs
- Polyline.cs
- SqlDataSourceParameterParser.cs
- HttpContext.cs
- _CacheStreams.cs
- Grid.cs
- CustomSignedXml.cs
- BCryptSafeHandles.cs
- DbConnectionPoolCounters.cs
- ErrorWebPart.cs
- TextTreeFixupNode.cs
- ScrollChangedEventArgs.cs
- DtdParser.cs
- DebugInfoGenerator.cs
- XmlnsDictionary.cs
- EntityDataSourceChangingEventArgs.cs
- CancelEventArgs.cs
- QueryComponents.cs
- WpfSharedXamlSchemaContext.cs
- RuleInfoComparer.cs
- xmlfixedPageInfo.cs
- StylusPointPropertyId.cs
- DebugHandleTracker.cs
- CanonicalFontFamilyReference.cs
- DesignerTransaction.cs
- OrderedDictionary.cs
- HostedElements.cs
- ListSortDescriptionCollection.cs
- MessagePropertyDescriptionCollection.cs
- DesignerListAdapter.cs
- MaterialGroup.cs
- InkCanvasInnerCanvas.cs
- NegationPusher.cs
- ContextMenu.cs
- Screen.cs
- Binding.cs
- DynamicMetaObjectBinder.cs
- CharAnimationBase.cs
- ServiceDescriptionSerializer.cs
- ToolStrip.cs
- Rijndael.cs
- FrameworkContentElement.cs
- NamespaceCollection.cs
- BitmapCodecInfoInternal.cs
- TrustManager.cs
- ConfigurationException.cs
- ClosableStream.cs
- GroupBoxAutomationPeer.cs
- InstancePersistenceException.cs
- DetailsViewModeEventArgs.cs
- ActiveDocumentEvent.cs
- ModuleBuilderData.cs
- ListenerElementsCollection.cs
- QuadraticBezierSegment.cs
- CompilationPass2TaskInternal.cs
- BindingListCollectionView.cs
- DbConnectionHelper.cs
- DPCustomTypeDescriptor.cs
- StyleTypedPropertyAttribute.cs
- EventHandlerList.cs
- ServiceBusyException.cs
- EventListener.cs
- TypeBuilder.cs
- XmlNotation.cs
- Label.cs
- ContentPosition.cs
- DefaultValueTypeConverter.cs
- ListViewItemEventArgs.cs
- BrushConverter.cs
- XmlDigitalSignatureProcessor.cs
- DataGridHeaderBorder.cs
- Animatable.cs
- XmlNavigatorFilter.cs
- dataprotectionpermission.cs
- DataGridDesigner.cs
- HttpProfileBase.cs
- DesignTimeVisibleAttribute.cs
- XmlHelper.cs
- Application.cs
- ToolstripProfessionalRenderer.cs
- AutomationEvent.cs
- WebBrowserNavigatedEventHandler.cs
- EditBehavior.cs
- FusionWrap.cs
- SqlUtils.cs
- ToolStripDropDownMenu.cs
- FormatVersion.cs
- ProtocolsConfigurationEntry.cs
- ExpressionVisitorHelpers.cs
- DbResourceAllocator.cs