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
- ImageSource.cs
- hresults.cs
- ProtocolsConfiguration.cs
- EntityDataSourceWizardForm.cs
- SerializationStore.cs
- StringValidatorAttribute.cs
- ToolStripDropDownItem.cs
- StateWorkerRequest.cs
- ThreadStaticAttribute.cs
- AssertValidation.cs
- RelationshipEndMember.cs
- CommonXSendMessage.cs
- SimpleWebHandlerParser.cs
- FixUp.cs
- URL.cs
- _SecureChannel.cs
- AttachInfo.cs
- ProviderUtil.cs
- ParameterModifier.cs
- FontClient.cs
- CommandConverter.cs
- LayoutTableCell.cs
- BinaryNode.cs
- PeerTransportListenAddressValidator.cs
- RequiredFieldValidator.cs
- MinMaxParagraphWidth.cs
- AdRotator.cs
- BaseAsyncResult.cs
- StringWriter.cs
- FontClient.cs
- ExpressionBindings.cs
- SchemaImporter.cs
- OdbcTransaction.cs
- SessionIDManager.cs
- SystemInfo.cs
- CopyOfAction.cs
- ViewUtilities.cs
- entityreference_tresulttype.cs
- CultureInfoConverter.cs
- input.cs
- BitmapEffectInput.cs
- FontResourceCache.cs
- RewritingProcessor.cs
- TableRow.cs
- FreezableCollection.cs
- PolyLineSegment.cs
- AsyncOperationManager.cs
- HttpModulesSection.cs
- DebuggerAttributes.cs
- UserControlBuildProvider.cs
- ApplicationHost.cs
- TextTrailingWordEllipsis.cs
- DynamicArgumentDialog.cs
- Rect3DValueSerializer.cs
- FormsAuthenticationModule.cs
- FilterFactory.cs
- StreamInfo.cs
- SoundPlayer.cs
- TypeElementCollection.cs
- ZipIOFileItemStream.cs
- NameValuePermission.cs
- DbgCompiler.cs
- EntityTransaction.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- WhiteSpaceTrimStringConverter.cs
- EmbeddedMailObjectsCollection.cs
- DataServiceResponse.cs
- GroupDescription.cs
- PeerApplication.cs
- DetailsViewPagerRow.cs
- TemplateBindingExpressionConverter.cs
- MetadataItemEmitter.cs
- ExecutionContext.cs
- ToolStripDropDownMenu.cs
- DbResourceAllocator.cs
- ProcessModuleCollection.cs
- DispatcherHooks.cs
- StreamWriter.cs
- StaticTextPointer.cs
- ProtocolsSection.cs
- MimeMultiPart.cs
- DatatypeImplementation.cs
- BindingsCollection.cs
- x509store.cs
- LoginView.cs
- InstanceData.cs
- ImageAutomationPeer.cs
- MultiSelector.cs
- PkcsUtils.cs
- PersonalizationStateQuery.cs
- RawStylusInput.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SizeIndependentAnimationStorage.cs
- Walker.cs
- AssemblyBuilder.cs
- FontInfo.cs
- PrePrepareMethodAttribute.cs
- RoutingChannelExtension.cs
- ComponentResourceKeyConverter.cs
- DataGrid.cs