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
- CqlLexer.cs
- ScriptRef.cs
- DataTable.cs
- SectionInput.cs
- Base64Decoder.cs
- GetTokenRequest.cs
- SqlNotificationEventArgs.cs
- CounterCreationDataCollection.cs
- Rule.cs
- DependencyObjectType.cs
- ReadOnlyHierarchicalDataSource.cs
- CodePropertyReferenceExpression.cs
- UrlAuthFailedErrorFormatter.cs
- DashStyle.cs
- HwndHostAutomationPeer.cs
- SafeLocalMemHandle.cs
- InheritanceUI.cs
- RegionIterator.cs
- UIElementAutomationPeer.cs
- RelatedImageListAttribute.cs
- Variable.cs
- GridErrorDlg.cs
- GridErrorDlg.cs
- HashMembershipCondition.cs
- TextServicesHost.cs
- RequestCachePolicy.cs
- AnnotationComponentManager.cs
- MetadataArtifactLoaderComposite.cs
- Operator.cs
- ExpressionsCollectionConverter.cs
- ReaderWriterLockWrapper.cs
- XmlSignificantWhitespace.cs
- Graphics.cs
- TabControl.cs
- CompositionDesigner.cs
- WorkflowOperationBehavior.cs
- CannotUnloadAppDomainException.cs
- HwndHost.cs
- RangeExpression.cs
- ProfileInfo.cs
- CommandHelpers.cs
- FileIOPermission.cs
- RepeatBehavior.cs
- ReceiveSecurityHeaderEntry.cs
- CancelRequestedQuery.cs
- SystemIcmpV4Statistics.cs
- TemplateBindingExtensionConverter.cs
- FileVersionInfo.cs
- SqlConnectionHelper.cs
- ISAPIRuntime.cs
- DesignerProperties.cs
- SqlDataReader.cs
- TraceHwndHost.cs
- SurrogateChar.cs
- ClientRolePrincipal.cs
- TimersDescriptionAttribute.cs
- SQLSingleStorage.cs
- ServiceReflector.cs
- WSSecureConversation.cs
- DateTimeFormatInfo.cs
- ConstrainedDataObject.cs
- RecognizedAudio.cs
- CultureInfoConverter.cs
- DataFormats.cs
- ModuleConfigurationInfo.cs
- BamlResourceContent.cs
- ConnectionConsumerAttribute.cs
- NamedPipeDuplicateContext.cs
- HttpGetClientProtocol.cs
- WindowsFormsLinkLabel.cs
- Range.cs
- DesignSurface.cs
- PrintingPermissionAttribute.cs
- ImageButton.cs
- SolidBrush.cs
- DataIdProcessor.cs
- EmptyQuery.cs
- FontConverter.cs
- EditorOptionAttribute.cs
- SortedDictionary.cs
- PermissionListSet.cs
- ImageMapEventArgs.cs
- DesignerRegionCollection.cs
- PassportAuthentication.cs
- HtmlTitle.cs
- DataGridViewColumnCollectionEditor.cs
- ListBoxItem.cs
- AccessibleObject.cs
- ListViewAutomationPeer.cs
- ButtonBaseAutomationPeer.cs
- VisualStyleElement.cs
- FontNamesConverter.cs
- ISFTagAndGuidCache.cs
- SoapTransportImporter.cs
- ListMarkerLine.cs
- DefaultAuthorizationContext.cs
- Transform3DCollection.cs
- StackOverflowException.cs
- CqlBlock.cs
- Screen.cs