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
- EasingKeyFrames.cs
- TextElementEnumerator.cs
- loginstatus.cs
- WebPartEditVerb.cs
- AdRotatorDesigner.cs
- TouchDevice.cs
- SecureEnvironment.cs
- FastEncoder.cs
- RefreshEventArgs.cs
- PlatformCulture.cs
- FixedPageStructure.cs
- MailMessageEventArgs.cs
- InheritanceContextHelper.cs
- PersonalizationProviderHelper.cs
- Localizer.cs
- RequiredFieldValidator.cs
- _LocalDataStore.cs
- HtmlValidatorAdapter.cs
- LayoutDump.cs
- LifetimeServices.cs
- BuildProviderAppliesToAttribute.cs
- HierarchicalDataBoundControl.cs
- RawAppCommandInputReport.cs
- HtmlTitle.cs
- XmlSerializationWriter.cs
- SurrogateEncoder.cs
- LoginView.cs
- CodeAttributeArgument.cs
- SQLGuidStorage.cs
- InfoCardX509Validator.cs
- ValidationResults.cs
- ServicePoint.cs
- DataServiceStreamResponse.cs
- FreezableOperations.cs
- GuidelineSet.cs
- HiddenFieldPageStatePersister.cs
- CompModSwitches.cs
- CollectionViewGroupRoot.cs
- UserPreferenceChangedEventArgs.cs
- NativeWindow.cs
- Classification.cs
- AddingNewEventArgs.cs
- ByteAnimationBase.cs
- EventToken.cs
- ComplexObject.cs
- ComponentResourceKey.cs
- TypeSemantics.cs
- GetReadStreamResult.cs
- ReflectPropertyDescriptor.cs
- HtmlMeta.cs
- BooleanConverter.cs
- BaseTreeIterator.cs
- ScrollChrome.cs
- ExpandCollapseProviderWrapper.cs
- HwndProxyElementProvider.cs
- InfoCardSymmetricAlgorithm.cs
- HttpRequestTraceRecord.cs
- PtsHelper.cs
- ScriptingScriptResourceHandlerSection.cs
- NonSerializedAttribute.cs
- InnerItemCollectionView.cs
- IdentityHolder.cs
- WebConvert.cs
- SoapCommonClasses.cs
- CodeObjectCreateExpression.cs
- ResponseStream.cs
- PackagingUtilities.cs
- BitmapEffectDrawingContextWalker.cs
- ThicknessKeyFrameCollection.cs
- IPEndPoint.cs
- ListViewTableCell.cs
- CommandID.cs
- AppSettings.cs
- Signature.cs
- DependentList.cs
- Misc.cs
- SortAction.cs
- CryptoApi.cs
- InvalidCastException.cs
- ListDictionary.cs
- BitmapEffectCollection.cs
- AuthenticationModulesSection.cs
- Journaling.cs
- DbUpdateCommandTree.cs
- DataGridViewCellPaintingEventArgs.cs
- NGCPageContentSerializerAsync.cs
- SelectionProcessor.cs
- PageWrapper.cs
- WebPartConnectionCollection.cs
- TraceContext.cs
- EventLogPermissionEntryCollection.cs
- SqlDelegatedTransaction.cs
- XmlEnumAttribute.cs
- DataServiceHostWrapper.cs
- HttpFormatExtensions.cs
- SmiEventSink.cs
- ObjectReaderCompiler.cs
- StylusPointPropertyId.cs
- SecureStringHasher.cs
- TemplateBindingExtension.cs