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
- CuspData.cs
- DispatcherTimer.cs
- StylusCollection.cs
- AuthorizationSection.cs
- EditorBrowsableAttribute.cs
- TextEditor.cs
- WebPartTransformerAttribute.cs
- assertwrapper.cs
- EntityKey.cs
- PeerCollaboration.cs
- TabControlAutomationPeer.cs
- Context.cs
- RotateTransform3D.cs
- BookmarkEventArgs.cs
- __ComObject.cs
- SeekStoryboard.cs
- HttpAsyncResult.cs
- cache.cs
- sqlser.cs
- BuildDependencySet.cs
- ClipboardData.cs
- CheckBoxList.cs
- BookmarkScopeHandle.cs
- HttpRuntimeSection.cs
- MessageBodyMemberAttribute.cs
- TriState.cs
- NetNamedPipeBindingCollectionElement.cs
- SequentialOutput.cs
- EventToken.cs
- DbFunctionCommandTree.cs
- GroupDescription.cs
- SimpleType.cs
- SqlInfoMessageEvent.cs
- NameService.cs
- StandardBindingElementCollection.cs
- WhitespaceRuleLookup.cs
- AggregationMinMaxHelpers.cs
- StorageTypeMapping.cs
- XmlQuerySequence.cs
- SqlFunctionAttribute.cs
- FileDialogCustomPlace.cs
- AttributeEmitter.cs
- SHA512Managed.cs
- CardSpaceSelector.cs
- DataControlFieldCollection.cs
- WaitHandleCannotBeOpenedException.cs
- StaticExtension.cs
- DesignerVerbCollection.cs
- AutomationElementCollection.cs
- SQLString.cs
- CounterCreationData.cs
- RequestTimeoutManager.cs
- ListItemConverter.cs
- EntityDataSourceDataSelectionPanel.cs
- PropertyGroupDescription.cs
- streamingZipPartStream.cs
- SqlConnectionStringBuilder.cs
- DesignerCategoryAttribute.cs
- PeerObject.cs
- ValidationError.cs
- Subtree.cs
- XmlQuerySequence.cs
- ResourceCategoryAttribute.cs
- Claim.cs
- AnnotationAuthorChangedEventArgs.cs
- TypeToStringValueConverter.cs
- InputMethodStateChangeEventArgs.cs
- QueryOutputWriterV1.cs
- ActiveXSite.cs
- DetailsViewInsertEventArgs.cs
- CompModSwitches.cs
- XPathItem.cs
- Separator.cs
- XpsDocumentEvent.cs
- MsmqNonTransactedPoisonHandler.cs
- StringTraceRecord.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- ElementUtil.cs
- BamlReader.cs
- UnsafeNativeMethods.cs
- ButtonFlatAdapter.cs
- SessionIDManager.cs
- Math.cs
- FacetChecker.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ValidationError.cs
- Line.cs
- DateTimeConverter2.cs
- DbReferenceCollection.cs
- FixedSOMLineCollection.cs
- DBBindings.cs
- RemoteX509Token.cs
- EdmToObjectNamespaceMap.cs
- EUCJPEncoding.cs
- ColumnWidthChangedEvent.cs
- Page.cs
- MdiWindowListStrip.cs
- DynamicPropertyHolder.cs
- VirtualizingPanel.cs
- Lock.cs