Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / ServiceModelEnumValidator.cs / 1 / ServiceModelEnumValidator.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 ServiceModelEnumValidator : ConfigurationValidatorBase { Type enumHelperType; MethodInfo isDefined; public ServiceModelEnumValidator(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
- HttpVersion.cs
- RequestUriProcessor.cs
- XPathDocument.cs
- ProcessProtocolHandler.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- SafeLibraryHandle.cs
- AppDomainAttributes.cs
- SecurityTokenValidationException.cs
- DataBindingHandlerAttribute.cs
- SoapUnknownHeader.cs
- ZipIORawDataFileBlock.cs
- WebPartVerb.cs
- UnsafeNativeMethods.cs
- ToolStripPanelCell.cs
- BindingExpression.cs
- ConfigurationStrings.cs
- TreeNode.cs
- DataGridTextBox.cs
- PathFigureCollectionValueSerializer.cs
- HttpPostedFile.cs
- XpsResourceDictionary.cs
- DefaultBindingPropertyAttribute.cs
- ArgumentValueSerializer.cs
- VersionedStream.cs
- ObjectConverter.cs
- ChannelEndpointElementCollection.cs
- ExpressionBinding.cs
- ConfigXmlAttribute.cs
- MemoryStream.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- NativeMethods.cs
- Point3DAnimationUsingKeyFrames.cs
- ConstraintStruct.cs
- PropertyPathConverter.cs
- StrokeCollection.cs
- OleDbEnumerator.cs
- UIPropertyMetadata.cs
- MetabaseReader.cs
- EntityTypeEmitter.cs
- StopStoryboard.cs
- DispatchChannelSink.cs
- GraphicsState.cs
- LicenseContext.cs
- HttpCachePolicy.cs
- TimeoutConverter.cs
- __ComObject.cs
- Attribute.cs
- HttpWebRequest.cs
- Propagator.Evaluator.cs
- BeginCreateSecurityTokenRequest.cs
- HybridDictionary.cs
- Debug.cs
- SqlDataSourceAdvancedOptionsForm.cs
- RequiredAttributeAttribute.cs
- SignatureResourceHelper.cs
- Peer.cs
- COM2FontConverter.cs
- Query.cs
- VisualBrush.cs
- DataContractSet.cs
- Interlocked.cs
- securitycriticaldataClass.cs
- TextOnlyOutput.cs
- IgnoreFileBuildProvider.cs
- UnsafeNativeMethods.cs
- DoubleCollection.cs
- MexHttpsBindingElement.cs
- ZipArchive.cs
- SelectingProviderEventArgs.cs
- OrderByQueryOptionExpression.cs
- BitmapEffectInputData.cs
- Switch.cs
- SimpleRecyclingCache.cs
- XmlSchemaRedefine.cs
- XmlAttributeHolder.cs
- XamlToRtfParser.cs
- DataGridLength.cs
- KerberosRequestorSecurityToken.cs
- UpdateManifestForBrowserApplication.cs
- XmlSerializerAssemblyAttribute.cs
- FacetEnabledSchemaElement.cs
- FileRecordSequence.cs
- ComponentEditorForm.cs
- ContextActivityUtils.cs
- COM2IDispatchConverter.cs
- ParagraphResult.cs
- BitConverter.cs
- WhileDesigner.cs
- SystemUnicastIPAddressInformation.cs
- XPathConvert.cs
- RangeValidator.cs
- DCSafeHandle.cs
- Literal.cs
- RMPermissions.cs
- SystemResourceKey.cs
- SqlFunctionAttribute.cs
- WindowsBrush.cs
- StackSpiller.cs
- DataBindingExpressionBuilder.cs
- IProvider.cs