Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- MachineSettingsSection.cs
- WebServiceReceiveDesigner.cs
- DisplayNameAttribute.cs
- CommandValueSerializer.cs
- URI.cs
- TimerTable.cs
- PathGeometry.cs
- Array.cs
- FixedElement.cs
- precedingquery.cs
- IResourceProvider.cs
- ContentHostHelper.cs
- ZipPackage.cs
- HtmlElementEventArgs.cs
- XslCompiledTransform.cs
- CommandField.cs
- WmpBitmapEncoder.cs
- DBSqlParser.cs
- XamlFigureLengthSerializer.cs
- CollaborationHelperFunctions.cs
- TreeNodeCollection.cs
- ConnectionManager.cs
- PrincipalPermission.cs
- HierarchicalDataTemplate.cs
- BamlVersionHeader.cs
- GlobalEventManager.cs
- SourceSwitch.cs
- SettingsBase.cs
- SuppressMergeCheckAttribute.cs
- RadioButtonFlatAdapter.cs
- StreamReader.cs
- PipelineModuleStepContainer.cs
- DirectoryInfo.cs
- Vector3dCollection.cs
- PropertyTabAttribute.cs
- ContentPlaceHolder.cs
- ServiceHostingEnvironment.cs
- SerializationObjectManager.cs
- TableSectionStyle.cs
- SourceChangedEventArgs.cs
- DataGridTextColumn.cs
- BamlMapTable.cs
- InternalConfigSettingsFactory.cs
- TextLineResult.cs
- TabControlEvent.cs
- DataView.cs
- HttpFormatExtensions.cs
- WebPartCatalogAddVerb.cs
- SrgsNameValueTag.cs
- RowCache.cs
- MasterPage.cs
- JsonDataContract.cs
- LongValidator.cs
- UserPreferenceChangingEventArgs.cs
- LinkLabel.cs
- AbstractDataSvcMapFileLoader.cs
- Stylesheet.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- StringUtil.cs
- ProfileManager.cs
- XmlSchemaProviderAttribute.cs
- Preprocessor.cs
- NetworkInterface.cs
- Interlocked.cs
- DetailsViewInsertEventArgs.cs
- TransactionManager.cs
- VBCodeProvider.cs
- ProgressBarBrushConverter.cs
- GenericParameterDataContract.cs
- PointCollection.cs
- CodeMemberMethod.cs
- DataGridViewCellStyleConverter.cs
- DataDocumentXPathNavigator.cs
- Exceptions.cs
- CodeEntryPointMethod.cs
- CodeDomDesignerLoader.cs
- RelatedPropertyManager.cs
- RuntimeResourceSet.cs
- LoaderAllocator.cs
- StaticContext.cs
- WorkflowMarkupSerializationProvider.cs
- XmlQueryOutput.cs
- CounterCreationDataCollection.cs
- FunctionUpdateCommand.cs
- __Error.cs
- MsmqInputMessagePool.cs
- DataGridColumnStyleMappingNameEditor.cs
- SafeNativeMethods.cs
- TimeEnumHelper.cs
- Environment.cs
- RawStylusActions.cs
- SourceFileInfo.cs
- PrivilegeNotHeldException.cs
- ToolboxItemFilterAttribute.cs
- TdsParserHelperClasses.cs
- CommandExpr.cs
- DataRecordInternal.cs
- BindingElementCollection.cs
- MemoryFailPoint.cs
- XmlSchemaAny.cs