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
- ControlAdapter.cs
- LicenseManager.cs
- ByeOperationCD1AsyncResult.cs
- TextModifierScope.cs
- SettingsSection.cs
- NotSupportedException.cs
- EventToken.cs
- SecurityTokenParametersEnumerable.cs
- InputScope.cs
- TextRangeAdaptor.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ExpandableObjectConverter.cs
- DesignerSerializationVisibilityAttribute.cs
- CultureInfo.cs
- DataGridViewCell.cs
- XmlSchemaImporter.cs
- OutgoingWebRequestContext.cs
- DataExchangeServiceBinder.cs
- StorageEndPropertyMapping.cs
- PerfService.cs
- ColorIndependentAnimationStorage.cs
- translator.cs
- LinqDataSourceInsertEventArgs.cs
- DataServiceProcessingPipeline.cs
- DrawingVisualDrawingContext.cs
- AuthorizationRuleCollection.cs
- PageThemeCodeDomTreeGenerator.cs
- DataGridViewCellEventArgs.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- RangeContentEnumerator.cs
- Vector3D.cs
- HttpServerChannel.cs
- DiagnosticTraceSource.cs
- QilList.cs
- WindowsAuthenticationModule.cs
- ConnectionStringsSection.cs
- OrCondition.cs
- RegexMatchCollection.cs
- ClearTypeHintValidation.cs
- DbFunctionCommandTree.cs
- SqlNodeTypeOperators.cs
- Debug.cs
- PageContent.cs
- Choices.cs
- DataTableNameHandler.cs
- GenericIdentity.cs
- ListViewSortEventArgs.cs
- ParallelQuery.cs
- Cast.cs
- DataGridViewMethods.cs
- BindStream.cs
- NamedPermissionSet.cs
- ChangeNode.cs
- TypedReference.cs
- embossbitmapeffect.cs
- Viewport3DAutomationPeer.cs
- EventLogConfiguration.cs
- SafeCoTaskMem.cs
- SqlDataSourceFilteringEventArgs.cs
- ExpressionBuilder.cs
- Bind.cs
- OracleConnectionFactory.cs
- DateRangeEvent.cs
- FlowchartDesigner.xaml.cs
- AutomationElementCollection.cs
- DomainUpDown.cs
- XPathScanner.cs
- Parameter.cs
- ThreadPoolTaskScheduler.cs
- HtmlFormWrapper.cs
- XmlEnumAttribute.cs
- SymbolResolver.cs
- SynchronizedDisposablePool.cs
- UInt32Converter.cs
- InfoCardAsymmetricCrypto.cs
- MaterialCollection.cs
- MemoryRecordBuffer.cs
- TaiwanLunisolarCalendar.cs
- CriticalFileToken.cs
- List.cs
- CompositeFontFamily.cs
- DummyDataSource.cs
- RegexRunner.cs
- ConstraintConverter.cs
- HostingEnvironmentSection.cs
- StringWriter.cs
- HyperLink.cs
- ChangeConflicts.cs
- PhonemeConverter.cs
- ConstructorExpr.cs
- HttpCapabilitiesSectionHandler.cs
- DataObjectCopyingEventArgs.cs
- WebPartDescription.cs
- InvariantComparer.cs
- PrimitiveSchema.cs
- WindowCollection.cs
- KnownAssemblyEntry.cs
- CircleHotSpot.cs
- UserControl.cs
- ParameterToken.cs