Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / CallbackValidator.cs / 1305376 / 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
- SelectingProviderEventArgs.cs
- DayRenderEvent.cs
- Selector.cs
- FlowDocumentReaderAutomationPeer.cs
- ConstantProjectedSlot.cs
- ScrollItemProviderWrapper.cs
- XmlNodeComparer.cs
- EventMappingSettingsCollection.cs
- WsrmMessageInfo.cs
- XmlReflectionMember.cs
- TrackingServices.cs
- ProviderException.cs
- WebPermission.cs
- Classification.cs
- Operator.cs
- DataSourceCacheDurationConverter.cs
- ArglessEventHandlerProxy.cs
- RadioButton.cs
- FileUtil.cs
- HelpProvider.cs
- LongAverageAggregationOperator.cs
- GridViewSortEventArgs.cs
- DataGridHeaderBorder.cs
- ServiceReference.cs
- TextWriterEngine.cs
- EtwTrackingParticipant.cs
- ValidationError.cs
- AssemblyBuilderData.cs
- ImageUrlEditor.cs
- TemplateParser.cs
- BitmapSizeOptions.cs
- ContextMenuStripGroupCollection.cs
- ACL.cs
- WmlListAdapter.cs
- Char.cs
- DataGridCheckBoxColumn.cs
- DataGridViewLayoutData.cs
- AttributeCollection.cs
- WebReferenceCollection.cs
- ChangeConflicts.cs
- UpdatePanel.cs
- SqlUserDefinedAggregateAttribute.cs
- UnsupportedPolicyOptionsException.cs
- MailWebEventProvider.cs
- LinearKeyFrames.cs
- SettingsPropertyWrongTypeException.cs
- FileSecurity.cs
- ChannelSinkStacks.cs
- TextPointerBase.cs
- IntegerFacetDescriptionElement.cs
- CodeChecksumPragma.cs
- ResourceIDHelper.cs
- XamlSerializer.cs
- WebReferencesBuildProvider.cs
- DispatcherProcessingDisabled.cs
- DrawToolTipEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- DataContractSerializer.cs
- SqlDataSourceCustomCommandEditor.cs
- DataRowExtensions.cs
- ToolStripOverflow.cs
- _ConnectionGroup.cs
- EncryptedData.cs
- QueryCoreOp.cs
- AccessDataSourceView.cs
- Privilege.cs
- XmlWriterSettings.cs
- Line.cs
- MultiAsyncResult.cs
- CodeExpressionCollection.cs
- CheckBoxAutomationPeer.cs
- RegexRunnerFactory.cs
- Ticks.cs
- AbandonedMutexException.cs
- QilStrConcatenator.cs
- CreateUserWizard.cs
- sqlstateclientmanager.cs
- SeekableReadStream.cs
- LabelDesigner.cs
- ScrollChrome.cs
- ClientRoleProvider.cs
- MatrixKeyFrameCollection.cs
- TokenizerHelper.cs
- SystemColors.cs
- ColumnHeaderCollectionEditor.cs
- WebPartConnectVerb.cs
- X509CertificateCollection.cs
- Animatable.cs
- PeerInvitationResponse.cs
- Listbox.cs
- SHA1Managed.cs
- NewArray.cs
- WindowsAuthenticationEventArgs.cs
- GroupLabel.cs
- AsyncDataRequest.cs
- arabicshape.cs
- ParseNumbers.cs
- XPathChildIterator.cs
- RepeaterItem.cs
- ArgumentException.cs