Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Configuration / InternalEnumValidator.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Brush.cs
- SqlConnectionHelper.cs
- ResourcesChangeInfo.cs
- DictionaryContent.cs
- DataGridPagerStyle.cs
- StateItem.cs
- AutoScrollExpandMessageFilter.cs
- XpsInterleavingPolicy.cs
- RawMouseInputReport.cs
- InvalidAsynchronousStateException.cs
- DbConnectionInternal.cs
- SQLDecimalStorage.cs
- ProxyManager.cs
- DropTarget.cs
- HttpWebRequestElement.cs
- EndOfStreamException.cs
- ButtonColumn.cs
- BmpBitmapEncoder.cs
- InheritablePropertyChangeInfo.cs
- Stroke.cs
- DataSourceIDConverter.cs
- AssociationEndMember.cs
- Geometry.cs
- StringArrayEditor.cs
- MaskedTextBox.cs
- storagemappingitemcollection.viewdictionary.cs
- AutomationElement.cs
- SafeSecurityHelper.cs
- SQLMoney.cs
- ReferencedType.cs
- EdmComplexPropertyAttribute.cs
- TraceEventCache.cs
- WindowsStatusBar.cs
- GestureRecognizer.cs
- DesignConnection.cs
- DynamicMethod.cs
- TemplateBindingExpressionConverter.cs
- VisualTarget.cs
- ConfigXmlWhitespace.cs
- User.cs
- Cursor.cs
- Point4DConverter.cs
- TypeForwardedToAttribute.cs
- DesignerRegion.cs
- PlatformNotSupportedException.cs
- ObjectConverter.cs
- TickBar.cs
- PageCodeDomTreeGenerator.cs
- ListChangedEventArgs.cs
- LocalFileSettingsProvider.cs
- BufferedGraphics.cs
- DigestTraceRecordHelper.cs
- RectangleConverter.cs
- TextEndOfSegment.cs
- ChtmlTextWriter.cs
- Literal.cs
- ZoneLinkButton.cs
- SmtpException.cs
- SiteMapDataSourceView.cs
- StateBag.cs
- TraceHwndHost.cs
- XmlResolver.cs
- RegistryExceptionHelper.cs
- EnglishPluralizationService.cs
- TextViewSelectionProcessor.cs
- SendMailErrorEventArgs.cs
- BitStream.cs
- DeviceOverridableAttribute.cs
- StringExpressionSet.cs
- RenderDataDrawingContext.cs
- UIAgentInitializationException.cs
- DirectoryInfo.cs
- CodeLinePragma.cs
- PresentationAppDomainManager.cs
- ItemList.cs
- EntitySqlException.cs
- SendMailErrorEventArgs.cs
- CodeTypeReferenceExpression.cs
- ServiceModelConfigurationSection.cs
- BaseCollection.cs
- HasRunnableWorkflowEvent.cs
- FixedSOMTableCell.cs
- AdornerLayer.cs
- DashStyles.cs
- FilteredDataSetHelper.cs
- UnmanagedMemoryAccessor.cs
- AndCondition.cs
- QueryCoreOp.cs
- PathStreamGeometryContext.cs
- HtmlTableRowCollection.cs
- StronglyTypedResourceBuilder.cs
- SiteMapDataSourceView.cs
- EntityDataSourceDesignerHelper.cs
- RemoveFromCollection.cs
- InputElement.cs
- DllNotFoundException.cs
- Base64Decoder.cs
- ParallelTimeline.cs
- IPEndPointCollection.cs
- DataGridRow.cs