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
- QilScopedVisitor.cs
- EditingCoordinator.cs
- XmlBinaryReader.cs
- BooleanSwitch.cs
- WebPartDisplayModeEventArgs.cs
- Stack.cs
- OleDbParameterCollection.cs
- Gdiplus.cs
- RtfToXamlLexer.cs
- HtmlInputCheckBox.cs
- CallSiteOps.cs
- NodeFunctions.cs
- TableRow.cs
- SafeProcessHandle.cs
- Models.cs
- DefaultParameterValueAttribute.cs
- ExtendedProtectionPolicyTypeConverter.cs
- NavigationExpr.cs
- DataGridViewLinkCell.cs
- GlyphsSerializer.cs
- PrivilegedConfigurationManager.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- BCLDebug.cs
- IpcClientChannel.cs
- ControlCodeDomSerializer.cs
- QilVisitor.cs
- PropertyGridCommands.cs
- ExternalFile.cs
- PerformanceCounterCategory.cs
- TranslateTransform3D.cs
- AnnouncementEventArgs.cs
- SQLConvert.cs
- JsonFormatReaderGenerator.cs
- NetworkCredential.cs
- TextTrailingCharacterEllipsis.cs
- ContentType.cs
- BlockExpression.cs
- IriParsingElement.cs
- TraceProvider.cs
- UnmanagedHandle.cs
- CommandBindingCollection.cs
- EntityDesignPluralizationHandler.cs
- FreezableDefaultValueFactory.cs
- CodeRemoveEventStatement.cs
- UnsettableComboBox.cs
- VBCodeProvider.cs
- InternalMappingException.cs
- QueryOutputWriter.cs
- XmlValueConverter.cs
- XmlSchemaExternal.cs
- IisTraceListener.cs
- PositiveTimeSpanValidator.cs
- OpCodes.cs
- WindowsSecurityTokenAuthenticator.cs
- ObjectDataSourceMethodEventArgs.cs
- ContractNamespaceAttribute.cs
- Method.cs
- SchemaDeclBase.cs
- EntityDataSourceWizardForm.cs
- ListViewItem.cs
- MdiWindowListItemConverter.cs
- PolicyStatement.cs
- StrokeCollection2.cs
- RoutedCommand.cs
- SoapAttributes.cs
- FontFamily.cs
- XmlSchemaResource.cs
- SchemaNotation.cs
- NeedSkipTokenVisitor.cs
- StrokeSerializer.cs
- SafeArchiveContext.cs
- NameValuePermission.cs
- SpellerInterop.cs
- PauseStoryboard.cs
- HttpServerChannel.cs
- ToolTipService.cs
- ApplicationException.cs
- XmlQueryOutput.cs
- OleDbDataAdapter.cs
- DurationConverter.cs
- CmsInterop.cs
- Wizard.cs
- AffineTransform3D.cs
- ElementUtil.cs
- LinkClickEvent.cs
- ForeignConstraint.cs
- BasicSecurityProfileVersion.cs
- EncryptedKeyIdentifierClause.cs
- IndividualDeviceConfig.cs
- FormViewPagerRow.cs
- OutputCacheModule.cs
- BindingEntityInfo.cs
- Command.cs
- AddInBase.cs
- FieldAccessException.cs
- HandlerBase.cs
- StringUtil.cs
- HtmlLink.cs
- CustomAttributeSerializer.cs
- AccessControlEntry.cs