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
- StrokeRenderer.cs
- SystemDropShadowChrome.cs
- CustomValidator.cs
- UserControlBuildProvider.cs
- _SSPIWrapper.cs
- SurrogateEncoder.cs
- DomNameTable.cs
- EdmItemError.cs
- CodeTypeReferenceCollection.cs
- DocumentPageViewAutomationPeer.cs
- COM2IDispatchConverter.cs
- RegexStringValidator.cs
- ToolStripDesignerAvailabilityAttribute.cs
- TogglePattern.cs
- GridViewCellAutomationPeer.cs
- DataSourceCacheDurationConverter.cs
- UIElementParagraph.cs
- VisualStyleElement.cs
- CompositeDataBoundControl.cs
- TTSVoice.cs
- _FixedSizeReader.cs
- FailedToStartupUIException.cs
- BidPrivateBase.cs
- CatalogPart.cs
- ScriptManager.cs
- FileLoadException.cs
- XPathDescendantIterator.cs
- WebPartConnectionsConfigureVerb.cs
- HtmlInputRadioButton.cs
- PartDesigner.cs
- SQLDateTimeStorage.cs
- KerberosTokenFactoryCredential.cs
- AutoFocusStyle.xaml.cs
- PageContentCollection.cs
- SessionPageStateSection.cs
- EdmFunctions.cs
- Profiler.cs
- HttpStreamMessageEncoderFactory.cs
- CompModSwitches.cs
- ProcessInputEventArgs.cs
- StaticResourceExtension.cs
- ProcessingInstructionAction.cs
- X509RawDataKeyIdentifierClause.cs
- WebPartHelpVerb.cs
- MailMessageEventArgs.cs
- DbConnectionOptions.cs
- FixedElement.cs
- EasingFunctionBase.cs
- XomlCompiler.cs
- WebResourceAttribute.cs
- ButtonPopupAdapter.cs
- Int32Animation.cs
- TraceInternal.cs
- ResXDataNode.cs
- ExceptionNotification.cs
- FreezableDefaultValueFactory.cs
- ClassHandlersStore.cs
- SqlDataSource.cs
- EnumerationRangeValidationUtil.cs
- ProtocolsSection.cs
- ClientConvert.cs
- IISMapPath.cs
- HashJoinQueryOperatorEnumerator.cs
- AdPostCacheSubstitution.cs
- ProcessManager.cs
- EventData.cs
- TextClipboardData.cs
- XPathAncestorIterator.cs
- SelectingProviderEventArgs.cs
- ISCIIEncoding.cs
- CipherData.cs
- ListMarkerSourceInfo.cs
- SplineKeyFrames.cs
- TableProviderWrapper.cs
- SimpleBitVector32.cs
- BasicExpressionVisitor.cs
- SyndicationFeed.cs
- columnmapkeybuilder.cs
- ScrollViewerAutomationPeer.cs
- ParameterModifier.cs
- UniqueTransportManagerRegistration.cs
- DriveInfo.cs
- DataView.cs
- SimpleWebHandlerParser.cs
- MinimizableAttributeTypeConverter.cs
- XmlCDATASection.cs
- WorkflowPersistenceService.cs
- XsltContext.cs
- ExceptionUtil.cs
- Version.cs
- LayoutTableCell.cs
- CaseInsensitiveHashCodeProvider.cs
- ArcSegment.cs
- HttpServerChannel.cs
- SingleKeyFrameCollection.cs
- DynamicDocumentPaginator.cs
- TypefaceMap.cs
- InputLanguageEventArgs.cs
- DbException.cs
- SamlSecurityTokenAuthenticator.cs