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
- ChannelSinkStacks.cs
- HttpCacheVaryByContentEncodings.cs
- ApplyTemplatesAction.cs
- GetPageCompletedEventArgs.cs
- JsonByteArrayDataContract.cs
- StorageComplexTypeMapping.cs
- SchemeSettingElementCollection.cs
- SchemaComplexType.cs
- RepeaterCommandEventArgs.cs
- Msec.cs
- Item.cs
- AppDomainAttributes.cs
- counter.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- CompositeFontFamily.cs
- HostedElements.cs
- FontTypeConverter.cs
- HtmlSelect.cs
- VirtualizingPanel.cs
- LicenseManager.cs
- StoreItemCollection.cs
- MsmqEncryptionAlgorithm.cs
- CollectionChange.cs
- Unit.cs
- DebugView.cs
- SelectionHighlightInfo.cs
- Paragraph.cs
- DataDesignUtil.cs
- HttpContext.cs
- XmlReader.cs
- StrokeNodeOperations.cs
- CompilationLock.cs
- GridSplitterAutomationPeer.cs
- MethodCallTranslator.cs
- MetadataUtil.cs
- ApplicationGesture.cs
- safemediahandle.cs
- CompilerScopeManager.cs
- SymbolEqualComparer.cs
- StringDictionaryEditor.cs
- HostingEnvironment.cs
- iisPickupDirectory.cs
- QueryPageSettingsEventArgs.cs
- UnaryNode.cs
- SectionUpdates.cs
- DurableErrorHandler.cs
- StructuredProperty.cs
- SQLBytesStorage.cs
- CursorInteropHelper.cs
- JpegBitmapDecoder.cs
- XmlImplementation.cs
- X509CertificateInitiatorServiceCredential.cs
- WindowsIdentity.cs
- LayoutSettings.cs
- DrawListViewColumnHeaderEventArgs.cs
- DataGridCellAutomationPeer.cs
- ItemChangedEventArgs.cs
- GatewayDefinition.cs
- StringFreezingAttribute.cs
- rsa.cs
- Property.cs
- ISAPIApplicationHost.cs
- GridViewRowPresenterBase.cs
- ListParagraph.cs
- DataSourceControl.cs
- QilLiteral.cs
- MetadataPropertyCollection.cs
- LocalsItemDescription.cs
- DashStyle.cs
- FixUp.cs
- DisplayClaim.cs
- TextRunTypographyProperties.cs
- PlacementWorkspace.cs
- FileIOPermission.cs
- IBuiltInEvidence.cs
- SimpleRecyclingCache.cs
- versioninfo.cs
- MemberCollection.cs
- GatewayDefinition.cs
- CheckBoxField.cs
- PersianCalendar.cs
- DesignerAdapterAttribute.cs
- ToolStripProgressBar.cs
- InputLanguage.cs
- DateRangeEvent.cs
- CharEntityEncoderFallback.cs
- ListControlBuilder.cs
- CodeAttributeDeclaration.cs
- InstanceKeyCompleteException.cs
- SubstitutionResponseElement.cs
- AutomationElement.cs
- CaretElement.cs
- FixedPageStructure.cs
- OdbcCommand.cs
- ErrorFormatterPage.cs
- EngineSiteSapi.cs
- Pair.cs
- RoutingConfiguration.cs
- RegexParser.cs
- CachedCompositeFamily.cs