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
- ISessionStateStore.cs
- BindingCompleteEventArgs.cs
- DoubleLinkList.cs
- NavigationFailedEventArgs.cs
- DocumentGridPage.cs
- SortKey.cs
- TextFormatter.cs
- WizardSideBarListControlItem.cs
- ContentHostHelper.cs
- BeginEvent.cs
- FormViewUpdatedEventArgs.cs
- ErrorItem.cs
- AutomationPatternInfo.cs
- ApplicationSecurityManager.cs
- ToolStripSeparator.cs
- VirtualDirectoryMapping.cs
- DataGridViewComboBoxEditingControl.cs
- APCustomTypeDescriptor.cs
- AnnotationAdorner.cs
- TimerExtension.cs
- validationstate.cs
- NamedPipeConnectionPoolSettingsElement.cs
- XMLDiffLoader.cs
- CollectionType.cs
- CodeSnippetStatement.cs
- KeyedHashAlgorithm.cs
- TrackingProfileCache.cs
- UrlRoutingModule.cs
- PropertyGridEditorPart.cs
- WorkflowRuntimeSection.cs
- RuntimeHandles.cs
- HtmlHistory.cs
- TreeViewEvent.cs
- MouseGestureConverter.cs
- BaseDataBoundControl.cs
- SearchForVirtualItemEventArgs.cs
- ResourceSetExpression.cs
- TerminateSequence.cs
- Int32EqualityComparer.cs
- Encoder.cs
- Zone.cs
- RegexStringValidator.cs
- Literal.cs
- OdbcPermission.cs
- BindingValueChangedEventArgs.cs
- Operand.cs
- FormViewModeEventArgs.cs
- DefaultEvaluationContext.cs
- TypeCacheManager.cs
- MenuEventArgs.cs
- UniqueID.cs
- SiteMapProvider.cs
- LateBoundChannelParameterCollection.cs
- SafePEFileHandle.cs
- MessageDescription.cs
- COM2ExtendedTypeConverter.cs
- QueryExtender.cs
- FolderBrowserDialog.cs
- ColorPalette.cs
- MetricEntry.cs
- MonthChangedEventArgs.cs
- BStrWrapper.cs
- ExpressionParser.cs
- PassportAuthenticationModule.cs
- BindingBase.cs
- HostingPreferredMapPath.cs
- ProcessDesigner.cs
- Visual3DCollection.cs
- TransactionChannel.cs
- TransformValueSerializer.cs
- HMAC.cs
- SmiTypedGetterSetter.cs
- WebPartConnectionsConfigureVerb.cs
- COM2PictureConverter.cs
- CodeSubDirectoriesCollection.cs
- DropTarget.cs
- LinqDataSourceValidationException.cs
- initElementDictionary.cs
- Ray3DHitTestResult.cs
- DotExpr.cs
- LogConverter.cs
- DragSelectionMessageFilter.cs
- XmlSchemaRedefine.cs
- ClrProviderManifest.cs
- FileRecordSequenceHelper.cs
- Publisher.cs
- SqlTriggerAttribute.cs
- Message.cs
- SiteMapNode.cs
- DbConnectionStringCommon.cs
- StatusBarPanelClickEvent.cs
- WindowInteropHelper.cs
- EncoderParameter.cs
- MeshGeometry3D.cs
- QueryCacheKey.cs
- newitemfactory.cs
- HashMembershipCondition.cs
- LambdaCompiler.Expressions.cs
- TextSpan.cs
- WebPartVerbsEventArgs.cs