Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Configuration / InternalEnumValidator.cs / 1305376 / InternalEnumValidator.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System; using System.ComponentModel; using System.Configuration; using System.Reflection; using System.ServiceModel.Channels; internal class InternalEnumValidator : ConfigurationValidatorBase { Type enumHelperType; MethodInfo isDefined; public InternalEnumValidator(Type enumHelperType) { this.enumHelperType = enumHelperType; this.isDefined = this.enumHelperType.GetMethod("IsDefined", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); } public override bool CanValidate(Type type) { return (this.isDefined != null); } public override void Validate(object value) { bool retVal = (bool) this.isDefined.Invoke(null, new object[] { value }); if (!retVal) { ParameterInfo[] isDefinedParameters = this.isDefined.GetParameters(); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int) value, isDefinedParameters[0].ParameterType)); } } } } // 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
- CrossAppDomainChannel.cs
- SemanticBasicElement.cs
- WebBrowser.cs
- Label.cs
- ConditionalDesigner.cs
- DataGridViewColumnEventArgs.cs
- TextParagraph.cs
- EntityDataSourceDesigner.cs
- LOSFormatter.cs
- XmlSchemaRedefine.cs
- MenuItem.cs
- ToolboxBitmapAttribute.cs
- CodeSnippetCompileUnit.cs
- WebBrowserNavigatedEventHandler.cs
- RouteParameter.cs
- Events.cs
- FigureHelper.cs
- SystemUdpStatistics.cs
- __ComObject.cs
- FrameworkObject.cs
- UserInitiatedNavigationPermission.cs
- DataGridViewAutoSizeModeEventArgs.cs
- MDIWindowDialog.cs
- MessageDescription.cs
- InputLangChangeRequestEvent.cs
- ConfigurationPermission.cs
- Point3DValueSerializer.cs
- XmlDesignerDataSourceView.cs
- SchemaConstraints.cs
- CatalogZone.cs
- JournalNavigationScope.cs
- AssemblyInfo.cs
- HotSpot.cs
- FrameworkTextComposition.cs
- DataGridTextBox.cs
- Roles.cs
- View.cs
- DateTimeFormatInfoScanner.cs
- XPathQilFactory.cs
- Task.cs
- StreamReader.cs
- CompoundFileStreamReference.cs
- PropertySourceInfo.cs
- ClonableStack.cs
- ThicknessAnimationUsingKeyFrames.cs
- Utility.cs
- DoubleStorage.cs
- Helpers.cs
- XmlQueryTypeFactory.cs
- EpmSourcePathSegment.cs
- HttpModuleAction.cs
- XmlWrappingReader.cs
- DescendantQuery.cs
- DownloadProgressEventArgs.cs
- HostProtectionException.cs
- ComboBoxAutomationPeer.cs
- AssemblyBuilderData.cs
- AdapterUtil.cs
- XamlPoint3DCollectionSerializer.cs
- Transactions.cs
- WindowsNonControl.cs
- OperationCanceledException.cs
- BinaryFormatter.cs
- FontUnitConverter.cs
- ContentFileHelper.cs
- IndentedWriter.cs
- Transactions.cs
- PermissionSetTriple.cs
- CredentialCache.cs
- IItemProperties.cs
- ApplicationFileParser.cs
- HttpClientChannel.cs
- TypeResolver.cs
- WebHttpBindingElement.cs
- AuthenticationConfig.cs
- WebProxyScriptElement.cs
- CodeMemberMethod.cs
- LocatorPart.cs
- UshortList2.cs
- ProgressChangedEventArgs.cs
- WizardStepBase.cs
- SendKeys.cs
- Helpers.cs
- DataGridViewCellMouseEventArgs.cs
- SubpageParagraph.cs
- ExtractedStateEntry.cs
- SystemKeyConverter.cs
- HashCodeCombiner.cs
- RoutedEventHandlerInfo.cs
- SuspendDesigner.cs
- _IPv4Address.cs
- SkinBuilder.cs
- SiteMapProvider.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SoapElementAttribute.cs
- MimeFormReflector.cs
- XmlWrappingWriter.cs
- PcmConverter.cs
- WeakHashtable.cs
- RotateTransform3D.cs