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
- WebServiceHandlerFactory.cs
- SiteMapNode.cs
- MILUtilities.cs
- PropertyItemInternal.cs
- Filter.cs
- DataGridAddNewRow.cs
- WithStatement.cs
- UriParserTemplates.cs
- HostedTransportConfigurationBase.cs
- XmlHierarchicalDataSourceView.cs
- TypedReference.cs
- StateChangeEvent.cs
- DescendantOverDescendantQuery.cs
- ClientSession.cs
- DataFormat.cs
- Base64Encoder.cs
- ListViewTableRow.cs
- UnsettableComboBox.cs
- BindingMAnagerBase.cs
- DetailsViewRow.cs
- CaseInsensitiveComparer.cs
- SmiMetaDataProperty.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- FragmentQueryKB.cs
- WeakReference.cs
- Properties.cs
- InvalidEnumArgumentException.cs
- EventsTab.cs
- IntSecurity.cs
- SchemaObjectWriter.cs
- OperationAbortedException.cs
- InkPresenter.cs
- Triangle.cs
- SqlDelegatedTransaction.cs
- OrderedEnumerableRowCollection.cs
- IsolatedStorageFile.cs
- HotSpotCollection.cs
- NullReferenceException.cs
- DependencyProperty.cs
- ConnectionManagementElementCollection.cs
- SoapParser.cs
- RectIndependentAnimationStorage.cs
- XPathMultyIterator.cs
- OneOfElement.cs
- NavigationWindow.cs
- HttpListenerContext.cs
- DynamicResourceExtension.cs
- IdentityValidationException.cs
- TextFormatterImp.cs
- MemberInitExpression.cs
- OdbcInfoMessageEvent.cs
- SqlCacheDependency.cs
- SerialPinChanges.cs
- SafeProcessHandle.cs
- CodePageUtils.cs
- AffineTransform3D.cs
- DataGridViewRowPrePaintEventArgs.cs
- Stacktrace.cs
- CodeSnippetCompileUnit.cs
- DataServicePagingProviderWrapper.cs
- DataColumnPropertyDescriptor.cs
- ClientRuntimeConfig.cs
- BuildResultCache.cs
- Point4D.cs
- XmlEntityReference.cs
- TextFormatterContext.cs
- InterleavedZipPartStream.cs
- DirectoryRootQuery.cs
- ScrollProviderWrapper.cs
- InvokeHandlers.cs
- ProfileParameter.cs
- WebBrowserNavigatingEventHandler.cs
- CodeConstructor.cs
- MaxSessionCountExceededException.cs
- FtpWebRequest.cs
- DataMemberConverter.cs
- GcHandle.cs
- NumberSubstitution.cs
- Inflater.cs
- ImageUrlEditor.cs
- ObjectListDesigner.cs
- LineSegment.cs
- DataColumnCollection.cs
- DropShadowEffect.cs
- IndentedWriter.cs
- NumberFunctions.cs
- BuildProvider.cs
- PageBreakRecord.cs
- ProbeDuplex11AsyncResult.cs
- ExpressionWriter.cs
- PropertyMap.cs
- Pens.cs
- XPathPatternParser.cs
- ACE.cs
- SessionState.cs
- URLMembershipCondition.cs
- CaseStatement.cs
- ReadOnlyHierarchicalDataSourceView.cs
- BaseComponentEditor.cs
- DeclarationUpdate.cs