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
- ConversionValidationRule.cs
- _WinHttpWebProxyDataBuilder.cs
- DebuggerAttributes.cs
- EntityProviderFactory.cs
- CssStyleCollection.cs
- DataSourceGeneratorException.cs
- OdbcConnectionOpen.cs
- Rotation3D.cs
- ScalarOps.cs
- DetailsViewInsertEventArgs.cs
- IntegrationExceptionEventArgs.cs
- NamedPipeChannelListener.cs
- EmptyCollection.cs
- TagMapInfo.cs
- COM2TypeInfoProcessor.cs
- QilTernary.cs
- ACE.cs
- WithStatement.cs
- IntranetCredentialPolicy.cs
- DBDataPermission.cs
- ImageCodecInfoPrivate.cs
- AbandonedMutexException.cs
- MsmqAppDomainProtocolHandler.cs
- MatrixTransform3D.cs
- RootBrowserWindowProxy.cs
- WebBrowserNavigatedEventHandler.cs
- VersionedStream.cs
- DataBoundControl.cs
- LineBreak.cs
- SpecularMaterial.cs
- StringToken.cs
- BindingUtils.cs
- IPGlobalProperties.cs
- DataGridViewAutoSizeModeEventArgs.cs
- DataGridViewDataConnection.cs
- StaticSiteMapProvider.cs
- MappingMetadataHelper.cs
- WebPartTransformer.cs
- DefaultHttpHandler.cs
- TemplateComponentConnector.cs
- DataPager.cs
- HttpDebugHandler.cs
- ReservationNotFoundException.cs
- TreeNodeCollection.cs
- cookieexception.cs
- Stopwatch.cs
- MimeBasePart.cs
- RegexCaptureCollection.cs
- WindowsPen.cs
- BooleanFunctions.cs
- ByteAnimationUsingKeyFrames.cs
- StrongNameIdentityPermission.cs
- FixedDocument.cs
- DocumentViewerConstants.cs
- ZoneMembershipCondition.cs
- WebProxyScriptElement.cs
- TransformPattern.cs
- X509Certificate.cs
- PathFigure.cs
- PeerInvitationResponse.cs
- Preprocessor.cs
- SmtpDigestAuthenticationModule.cs
- Token.cs
- ImportCatalogPart.cs
- DiscoveryClient.cs
- SID.cs
- AutoCompleteStringCollection.cs
- XmlNodeChangedEventArgs.cs
- BufferAllocator.cs
- ConditionalAttribute.cs
- DataServiceException.cs
- SHA256Managed.cs
- ReferencedAssemblyResolver.cs
- ToRequest.cs
- PermissionSet.cs
- GPStream.cs
- WinFormsComponentEditor.cs
- HtmlHistory.cs
- MaskedTextProvider.cs
- PackagePart.cs
- IdlingCommunicationPool.cs
- WebPartDescription.cs
- BidirectionalDictionary.cs
- DashStyle.cs
- ScrollItemProviderWrapper.cs
- EncodingDataItem.cs
- ToolStripArrowRenderEventArgs.cs
- ProxyElement.cs
- AnnotationResourceCollection.cs
- ColorTransformHelper.cs
- Marshal.cs
- CodePropertyReferenceExpression.cs
- CqlLexerHelpers.cs
- ZoneIdentityPermission.cs
- RemotingConfiguration.cs
- OrthographicCamera.cs
- StringUtil.cs
- System.Data.OracleClient_BID.cs
- DesignerForm.cs
- RemotingConfiguration.cs