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
- ProjectionPruner.cs
- SelectionRangeConverter.cs
- Int32CollectionValueSerializer.cs
- XmlBoundElement.cs
- SerializationFieldInfo.cs
- UnionCodeGroup.cs
- OperationPickerDialog.designer.cs
- CodeMemberProperty.cs
- BaseDataBoundControl.cs
- Path.cs
- DebugInfo.cs
- TimersDescriptionAttribute.cs
- CultureInfoConverter.cs
- ITreeGenerator.cs
- PasswordDeriveBytes.cs
- EntityDataSourceChangedEventArgs.cs
- MethodAccessException.cs
- ThreadStaticAttribute.cs
- smtpconnection.cs
- TableLayoutPanel.cs
- X509ScopedServiceCertificateElementCollection.cs
- DBProviderConfigurationHandler.cs
- RegexNode.cs
- CollectionChangedEventManager.cs
- CachedPathData.cs
- HighlightComponent.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- VirtualPathUtility.cs
- TimelineGroup.cs
- WindowsFormsHost.cs
- DbConnectionPoolCounters.cs
- NamespaceMapping.cs
- MultiTrigger.cs
- TimeSpanStorage.cs
- SystemIcmpV6Statistics.cs
- OutputCacheProfileCollection.cs
- SupportsEventValidationAttribute.cs
- HtmlTableRowCollection.cs
- Convert.cs
- Pen.cs
- PostBackTrigger.cs
- DateRangeEvent.cs
- ListViewTableRow.cs
- TimeSpanSecondsConverter.cs
- WindowsComboBox.cs
- CanExecuteRoutedEventArgs.cs
- BrowserDefinition.cs
- IApplicationTrustManager.cs
- DataMemberConverter.cs
- PrePostDescendentsWalker.cs
- CLRBindingWorker.cs
- ControlPersister.cs
- RadioButtonFlatAdapter.cs
- ScriptReferenceBase.cs
- XPathCompileException.cs
- DataSourceView.cs
- WpfMemberInvoker.cs
- ServiceAppDomainAssociationProvider.cs
- StylusEventArgs.cs
- ProjectionPruner.cs
- SparseMemoryStream.cs
- ServiceOperationViewControl.cs
- ListBindingConverter.cs
- DefaultPropertyAttribute.cs
- PagesChangedEventArgs.cs
- ParameterReplacerVisitor.cs
- MethodAccessException.cs
- InlineObject.cs
- DataGridViewRowsRemovedEventArgs.cs
- _ListenerResponseStream.cs
- CodeMethodInvokeExpression.cs
- FrameDimension.cs
- DateTimeValueSerializer.cs
- SortedDictionary.cs
- ClientScriptManager.cs
- Vector.cs
- BasicKeyConstraint.cs
- VectorAnimation.cs
- SqlErrorCollection.cs
- AvTraceDetails.cs
- CapabilitiesPattern.cs
- HttpRequest.cs
- TdsParserStaticMethods.cs
- AdRotator.cs
- ObjectStorage.cs
- MessageQueueConverter.cs
- ScrollItemProviderWrapper.cs
- UnsafeNativeMethods.cs
- ProfilePropertySettingsCollection.cs
- StateChangeEvent.cs
- AddingNewEventArgs.cs
- RegisteredExpandoAttribute.cs
- CqlParserHelpers.cs
- HttpListener.cs
- DrawToolTipEventArgs.cs
- ObfuscateAssemblyAttribute.cs
- IndicShape.cs
- OutputScope.cs
- RegexInterpreter.cs
- FlowLayoutSettings.cs