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 / CallbackValidatorAttribute.cs / 1 / 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. //------------------------------------------------------------------------------ //// 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
- FontFamily.cs
- PaintValueEventArgs.cs
- WindowsGraphics.cs
- ServiceReflector.cs
- TrackBar.cs
- Button.cs
- FontNamesConverter.cs
- TypeUtil.cs
- ReadContentAsBinaryHelper.cs
- FilterElement.cs
- WorkItem.cs
- DatagridviewDisplayedBandsData.cs
- WebColorConverter.cs
- InputLanguageCollection.cs
- InkPresenterAutomationPeer.cs
- ComponentCommands.cs
- SelectionEditor.cs
- Keywords.cs
- ForeignKeyConstraint.cs
- ServiceInstallComponent.cs
- Size.cs
- TypeUsage.cs
- SiteMapPath.cs
- UsernameTokenFactoryCredential.cs
- BreadCrumbTextConverter.cs
- StorageMappingFragment.cs
- TabRenderer.cs
- ManagementEventArgs.cs
- BrowserDefinition.cs
- DrawingGroupDrawingContext.cs
- DesignTableCollection.cs
- StyleCollection.cs
- SurrogateDataContract.cs
- Stacktrace.cs
- ListManagerBindingsCollection.cs
- TdsParserSafeHandles.cs
- TextTreeRootNode.cs
- ReadWriteObjectLock.cs
- SrgsRule.cs
- SeekStoryboard.cs
- AttributedMetaModel.cs
- XmlComment.cs
- AvtEvent.cs
- LinqToSqlWrapper.cs
- PageBreakRecord.cs
- DBConnectionString.cs
- XamlFilter.cs
- ADMembershipProvider.cs
- LineBreakRecord.cs
- Size3D.cs
- TaskCanceledException.cs
- DirectionalLight.cs
- StringFunctions.cs
- SystemWebSectionGroup.cs
- SmiContext.cs
- WindowsListBox.cs
- DefaultEventAttribute.cs
- LocationSectionRecord.cs
- UserControlCodeDomTreeGenerator.cs
- ButtonRenderer.cs
- CounterCreationData.cs
- ScriptServiceAttribute.cs
- ScriptDescriptor.cs
- OutputWindow.cs
- HtmlInputButton.cs
- EncryptedKeyIdentifierClause.cs
- ReachPageContentCollectionSerializer.cs
- DataGridViewRow.cs
- Permission.cs
- StorageModelBuildProvider.cs
- EventHandlersStore.cs
- NativeMethods.cs
- XPathScanner.cs
- ZipIOExtraField.cs
- InternalPermissions.cs
- RangeBaseAutomationPeer.cs
- DynamicValueConverter.cs
- GridViewRowPresenter.cs
- ModelFunction.cs
- QueryExecutionOption.cs
- OutputCacheModule.cs
- TemplateBindingExpression.cs
- SizeFConverter.cs
- ComplexPropertyEntry.cs
- Image.cs
- StatusBarDesigner.cs
- CultureSpecificStringDictionary.cs
- AnonymousIdentificationSection.cs
- ObjectDataSourceStatusEventArgs.cs
- MiniLockedBorderGlyph.cs
- RC2.cs
- AssemblyBuilderData.cs
- PeerInputChannelListener.cs
- XmlDocumentSchema.cs
- StylusSystemGestureEventArgs.cs
- TableAdapterManagerHelper.cs
- AuthenticateEventArgs.cs
- StylusOverProperty.cs
- DataSourceView.cs
- Serializer.cs