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
- base64Transforms.cs
- CodeSubDirectory.cs
- EventTrigger.cs
- HttpResponse.cs
- UpdateRecord.cs
- ErrorWebPart.cs
- Matrix3D.cs
- XmlAttributeAttribute.cs
- CompiledQueryCacheEntry.cs
- DataPagerCommandEventArgs.cs
- AvTraceDetails.cs
- AccessText.cs
- DispatchChannelSink.cs
- PermissionToken.cs
- ModelFunctionTypeElement.cs
- DateTimeEditor.cs
- Misc.cs
- TransformDescriptor.cs
- COM2Enum.cs
- SystemNetworkInterface.cs
- Stack.cs
- RotateTransform3D.cs
- Exceptions.cs
- IconBitmapDecoder.cs
- SafePEFileHandle.cs
- MemberRelationshipService.cs
- ListViewContainer.cs
- WorkflowRuntimeServiceElementCollection.cs
- DictionaryContent.cs
- ToolConsole.cs
- WebBrowserEvent.cs
- KnownColorTable.cs
- OdbcConnection.cs
- XmlTextReader.cs
- AssemblyFilter.cs
- RIPEMD160.cs
- HandlerBase.cs
- WebPartConnectionsCancelEventArgs.cs
- ReadOnlyMetadataCollection.cs
- AssemblyResourceLoader.cs
- ProfilePropertySettingsCollection.cs
- Symbol.cs
- LocatorGroup.cs
- EventDescriptorCollection.cs
- MouseGestureValueSerializer.cs
- ConnectionPointCookie.cs
- Style.cs
- BaseInfoTable.cs
- HierarchicalDataSourceIDConverter.cs
- ZipIOExtraFieldZip64Element.cs
- SelectionHighlightInfo.cs
- CapabilitiesRule.cs
- SiteMembershipCondition.cs
- XmlAtomErrorReader.cs
- HelpInfo.cs
- SqlConnectionPoolProviderInfo.cs
- Quaternion.cs
- QueryTask.cs
- securitycriticaldata.cs
- PixelFormatConverter.cs
- ScrollChangedEventArgs.cs
- Stopwatch.cs
- FixedSOMTableRow.cs
- KeyEvent.cs
- SqlTypesSchemaImporter.cs
- ScriptingWebServicesSectionGroup.cs
- TreeNodeCollectionEditor.cs
- QueryInterceptorAttribute.cs
- dbdatarecord.cs
- StackBuilderSink.cs
- HealthMonitoringSection.cs
- SqlDataSourceConfigureSelectPanel.cs
- SimpleExpression.cs
- PropertyGridCommands.cs
- XmlWriterSettings.cs
- TextPointerBase.cs
- DirectoryInfo.cs
- UserControl.cs
- FixedTextView.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- BoolExpressionVisitors.cs
- RNGCryptoServiceProvider.cs
- Span.cs
- UnicastIPAddressInformationCollection.cs
- TableCellCollection.cs
- ViewUtilities.cs
- BindToObject.cs
- InvalidDataException.cs
- DataRow.cs
- AsymmetricKeyExchangeFormatter.cs
- Popup.cs
- TypeDescriptionProviderAttribute.cs
- WindowsHyperlink.cs
- ImportDesigner.xaml.cs
- RequiredFieldValidator.cs
- ReadContentAsBinaryHelper.cs
- Ipv6Element.cs
- ElementAction.cs
- TraceContextEventArgs.cs
- VirtualPath.cs