Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Configuration / InternalEnumValidator.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripItem.cs
- RectangleF.cs
- CodeExporter.cs
- BamlLocalizer.cs
- DataGridViewCellEventArgs.cs
- DesignerAttribute.cs
- SafeBitVector32.cs
- ConditionCollection.cs
- ThreadStaticAttribute.cs
- XmlRootAttribute.cs
- BooleanExpr.cs
- SystemColorTracker.cs
- InstancePersistence.cs
- TransactedBatchContext.cs
- RawUIStateInputReport.cs
- StaticSiteMapProvider.cs
- WpfKnownType.cs
- CollectionConverter.cs
- ArgIterator.cs
- FixedPageStructure.cs
- TemplatePartAttribute.cs
- TabControlAutomationPeer.cs
- CompilationSection.cs
- ProfileSettings.cs
- AutomationAttributeInfo.cs
- XmlSerializerNamespaces.cs
- WinFormsUtils.cs
- Matrix3DValueSerializer.cs
- UInt16Converter.cs
- DocumentReferenceCollection.cs
- ExtenderProvidedPropertyAttribute.cs
- HyperLinkColumn.cs
- ViewValidator.cs
- NavigationProperty.cs
- ToolStripHighContrastRenderer.cs
- XPathSelectionIterator.cs
- RequestQueryParser.cs
- DbParameterCollection.cs
- SafeProcessHandle.cs
- FileAuthorizationModule.cs
- NavigationProgressEventArgs.cs
- GridViewUpdateEventArgs.cs
- IgnorePropertiesAttribute.cs
- ReflectionServiceProvider.cs
- basecomparevalidator.cs
- AuthorizationSection.cs
- Underline.cs
- XmlPreloadedResolver.cs
- InvariantComparer.cs
- LinqDataSourceEditData.cs
- KeyProperty.cs
- KnownBoxes.cs
- RoutedEventValueSerializer.cs
- HtmlButton.cs
- _TLSstream.cs
- EmptyCollection.cs
- Multiply.cs
- ImageCodecInfo.cs
- AccessText.cs
- HttpProfileGroupBase.cs
- HtmlTableRowCollection.cs
- _SecureChannel.cs
- ObjectPropertyMapping.cs
- SingleStorage.cs
- DesignerLoader.cs
- GeneralTransform3DCollection.cs
- DataPagerFieldItem.cs
- HwndAppCommandInputProvider.cs
- ValueSerializer.cs
- WebExceptionStatus.cs
- _Events.cs
- QuotedStringWriteStateInfo.cs
- XmlSubtreeReader.cs
- ListControl.cs
- Literal.cs
- Model3D.cs
- ConfigurationLoaderException.cs
- PhysicalOps.cs
- DataGridCommandEventArgs.cs
- ComponentCodeDomSerializer.cs
- ProfilePropertyMetadata.cs
- TextElement.cs
- EnumConverter.cs
- FixedDocument.cs
- ServiceRouteHandler.cs
- HeaderedContentControl.cs
- PriorityQueue.cs
- ItemContainerGenerator.cs
- RequestCachingSection.cs
- StatusBarItemAutomationPeer.cs
- CodeBinaryOperatorExpression.cs
- Pkcs7Recipient.cs
- IPAddress.cs
- PngBitmapEncoder.cs
- TemplateDefinition.cs
- IndentTextWriter.cs
- TextDecorationCollection.cs
- SessionStateContainer.cs
- LineUtil.cs
- MetadataSerializer.cs