Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / CallbackValidatorAttribute.cs / 1305376 / CallbackValidatorAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Configuration.Internal; using System.Collections; using System.Collections.Specialized; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; namespace System.Configuration { [AttributeUsage(AttributeTargets.Property)] public sealed class CallbackValidatorAttribute : ConfigurationValidatorAttribute { private Type _type = null; private String _callbackMethodName = String.Empty; private ValidatorCallback _callbackMethod; public override ConfigurationValidatorBase ValidatorInstance { get { if (_callbackMethod == null) { if (_type == null) { throw new ArgumentNullException("Type"); } if (!String.IsNullOrEmpty(_callbackMethodName)) { MethodInfo methodInfo = _type.GetMethod(_callbackMethodName, BindingFlags.Public | BindingFlags.Static); if (methodInfo != null) { ParameterInfo[] parameters = methodInfo.GetParameters(); if ((parameters.Length == 1) && (parameters[0].ParameterType == typeof(Object))) { _callbackMethod = (ValidatorCallback)Delegate.CreateDelegate(typeof(ValidatorCallback), methodInfo); } } } } if (_callbackMethod == null) { throw new System.ArgumentException(SR.GetString(SR.Validator_method_not_found, _callbackMethodName)); } return new CallbackValidator(_callbackMethod); } } public CallbackValidatorAttribute() { } public Type Type { get { return _type; } set { _type = value; _callbackMethod = null; } } public String CallbackMethodName { get { return _callbackMethodName; } set { _callbackMethodName = value; _callbackMethod = null; } } } } // 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
- ContractsBCL.cs
- IndexedGlyphRun.cs
- IdentityReference.cs
- SapiRecoInterop.cs
- ConsumerConnectionPointCollection.cs
- ResourceProviderFactory.cs
- Trace.cs
- QuaternionAnimationBase.cs
- HttpContextServiceHost.cs
- ApplicationServiceManager.cs
- BinaryObjectReader.cs
- DataGridViewIntLinkedList.cs
- CodePrimitiveExpression.cs
- IgnoreFileBuildProvider.cs
- CodeNamespace.cs
- XsdCachingReader.cs
- Schema.cs
- HwndAppCommandInputProvider.cs
- OdbcCommandBuilder.cs
- StringStorage.cs
- peernodestatemanager.cs
- RuntimeArgumentHandle.cs
- HideDisabledControlAdapter.cs
- DataServiceProcessingPipelineEventArgs.cs
- Light.cs
- FileDialog_Vista.cs
- Certificate.cs
- Walker.cs
- DecimalAnimationBase.cs
- PersonalizationProviderCollection.cs
- HttpApplicationFactory.cs
- NumericUpDownAccelerationCollection.cs
- IriParsingElement.cs
- TimerEventSubscriptionCollection.cs
- BamlLocalizabilityResolver.cs
- RadioButton.cs
- SafeNativeMethods.cs
- CatalogZone.cs
- TableCell.cs
- sqlinternaltransaction.cs
- DependencyPropertyConverter.cs
- ProgressBar.cs
- URLIdentityPermission.cs
- GridViewPageEventArgs.cs
- SendActivityDesignerTheme.cs
- ArgumentNullException.cs
- TextTreeUndoUnit.cs
- OutputCacheProfileCollection.cs
- UInt16.cs
- ImageProxy.cs
- ExceptionUtil.cs
- ListBox.cs
- ControlIdConverter.cs
- InternalConfigRoot.cs
- AttributeProviderAttribute.cs
- DebugManager.cs
- AttributeQuery.cs
- ApplicationProxyInternal.cs
- TemplateLookupAction.cs
- X509CertificateClaimSet.cs
- Converter.cs
- EndCreateSecurityTokenRequest.cs
- DynamicPropertyHolder.cs
- WeakReference.cs
- StylusDevice.cs
- RegexBoyerMoore.cs
- VarRefManager.cs
- LocalizedNameDescriptionPair.cs
- ToolStripCollectionEditor.cs
- JsonEnumDataContract.cs
- HtmlWindowCollection.cs
- SafeFileHandle.cs
- FreezableCollection.cs
- EmptyElement.cs
- DbFunctionCommandTree.cs
- ObjectPropertyMapping.cs
- PropertyGeneratedEventArgs.cs
- ProtocolViolationException.cs
- DebugViewWriter.cs
- PaintEvent.cs
- MessageBox.cs
- OpenFileDialog.cs
- ServiceOperationWrapper.cs
- ToolStripSystemRenderer.cs
- EmptyControlCollection.cs
- HMACSHA256.cs
- PassportAuthenticationEventArgs.cs
- InputProviderSite.cs
- PreProcessInputEventArgs.cs
- FormsAuthenticationModule.cs
- Calendar.cs
- MD5.cs
- BufferAllocator.cs
- DataControlFieldCollection.cs
- EventDescriptor.cs
- DragDeltaEventArgs.cs
- COSERVERINFO.cs
- WebPartEventArgs.cs
- AppDomainCompilerProxy.cs
- XmlBoundElement.cs