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
- OdbcUtils.cs
- TraceXPathNavigator.cs
- SchemaTypeEmitter.cs
- DefaultAssemblyResolver.cs
- FindCriteriaApril2005.cs
- ActiveXHelper.cs
- BuilderInfo.cs
- InputLanguageProfileNotifySink.cs
- MD5Cng.cs
- RequestCachePolicyConverter.cs
- TransformedBitmap.cs
- AtomParser.cs
- ChannelBinding.cs
- HttpCapabilitiesSectionHandler.cs
- ListViewGroupItemCollection.cs
- InArgument.cs
- SystemIPInterfaceProperties.cs
- DbDataReader.cs
- MD5Cng.cs
- DataServiceKeyAttribute.cs
- CodeLinePragma.cs
- ConfigUtil.cs
- DateTimeValueSerializer.cs
- SoapSchemaMember.cs
- MD5CryptoServiceProvider.cs
- AffineTransform3D.cs
- DelegatingTypeDescriptionProvider.cs
- precedingsibling.cs
- ConfigXmlAttribute.cs
- ParseHttpDate.cs
- EncodingTable.cs
- StorageMappingItemCollection.cs
- DataGridViewCellStyle.cs
- IPPacketInformation.cs
- BackStopAuthenticationModule.cs
- MethodCallTranslator.cs
- DocumentApplicationJournalEntry.cs
- ExpressionBinding.cs
- ProxyElement.cs
- DesignerTransaction.cs
- SEHException.cs
- FigureParagraph.cs
- BamlResourceSerializer.cs
- Roles.cs
- SmtpTransport.cs
- RequestCache.cs
- WebPartDisplayModeEventArgs.cs
- XmlValueConverter.cs
- MatrixAnimationBase.cs
- HintTextConverter.cs
- BamlResourceSerializer.cs
- GlyphingCache.cs
- TempFiles.cs
- ColorDialog.cs
- WebServiceClientProxyGenerator.cs
- NullReferenceException.cs
- GuidConverter.cs
- MimePart.cs
- EtwTrace.cs
- PageContentAsyncResult.cs
- SqlGenericUtil.cs
- ParallelTimeline.cs
- MetadataHelper.cs
- AstTree.cs
- MulticastOption.cs
- SafeCoTaskMem.cs
- EventLogPermission.cs
- SystemIPGlobalStatistics.cs
- PlaceHolder.cs
- NativeDirectoryServicesQueryAPIs.cs
- QuotedStringWriteStateInfo.cs
- ToolStripSeparator.cs
- SuppressMergeCheckAttribute.cs
- CodeIdentifier.cs
- TCPClient.cs
- ParameterReplacerVisitor.cs
- FixedSOMSemanticBox.cs
- BitmapEffectInput.cs
- EditorAttributeInfo.cs
- Positioning.cs
- Font.cs
- DialogWindow.cs
- StringSource.cs
- ThicknessAnimationUsingKeyFrames.cs
- Helper.cs
- Oci.cs
- Propagator.JoinPropagator.cs
- SyndicationContent.cs
- FontSourceCollection.cs
- SelectionProviderWrapper.cs
- SByte.cs
- ObjectDataSource.cs
- UniformGrid.cs
- InstanceNotReadyException.cs
- SubtreeProcessor.cs
- ParseHttpDate.cs
- _AcceptOverlappedAsyncResult.cs
- MSAAEventDispatcher.cs
- ClientSponsor.cs
- GC.cs