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
- TypeUtils.cs
- FileDialogPermission.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- LexicalChunk.cs
- ToolBarPanel.cs
- IdentifierCollection.cs
- XmlSchemaElement.cs
- Query.cs
- SqlRemoveConstantOrderBy.cs
- WebScriptMetadataMessage.cs
- TrackingDataItemValue.cs
- WebPartMenu.cs
- ImageSourceValueSerializer.cs
- ConditionBrowserDialog.cs
- StoragePropertyMapping.cs
- FileSystemWatcher.cs
- ImageInfo.cs
- ViewEventArgs.cs
- NativeMethods.cs
- ProcessHostMapPath.cs
- Italic.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ResourceContainer.cs
- HWStack.cs
- ScriptingRoleServiceSection.cs
- ServiceX509SecurityTokenProvider.cs
- SkipQueryOptionExpression.cs
- SQLBytesStorage.cs
- DataSourceExpression.cs
- SqlNodeAnnotation.cs
- ToolStripOverflow.cs
- JournalEntry.cs
- StackBuilderSink.cs
- indexingfiltermarshaler.cs
- TextSearch.cs
- BufferedResponseStream.cs
- TreeChangeInfo.cs
- LinqDataSource.cs
- TraceContext.cs
- StreamWriter.cs
- FtpCachePolicyElement.cs
- PartitionedStreamMerger.cs
- _HeaderInfoTable.cs
- SchemaDeclBase.cs
- AgileSafeNativeMemoryHandle.cs
- WindowHideOrCloseTracker.cs
- WebPartTransformerCollection.cs
- OdbcError.cs
- PersonalizationStateInfoCollection.cs
- TextEndOfParagraph.cs
- StateMachineWorkflow.cs
- ZipArchive.cs
- CryptoProvider.cs
- DockProviderWrapper.cs
- ReferenceService.cs
- dataobject.cs
- TypeBuilder.cs
- AnyAllSearchOperator.cs
- HwndProxyElementProvider.cs
- PieceNameHelper.cs
- NotificationContext.cs
- TrustSection.cs
- AdapterDictionary.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- PeerHopCountAttribute.cs
- LayoutUtils.cs
- FixedBufferAttribute.cs
- userdatakeys.cs
- Window.cs
- SqlNodeAnnotation.cs
- Matrix3DStack.cs
- OleStrCAMarshaler.cs
- InstanceLockedException.cs
- PreviewPageInfo.cs
- HandleRef.cs
- SqlEnums.cs
- PageMediaSize.cs
- COAUTHINFO.cs
- PropertyGrid.cs
- WindowsGraphicsCacheManager.cs
- HorizontalAlignConverter.cs
- InplaceBitmapMetadataWriter.cs
- SQLDoubleStorage.cs
- ComponentGlyph.cs
- Int32.cs
- MetadataCacheItem.cs
- EventLogger.cs
- ClientApiGenerator.cs
- RedistVersionInfo.cs
- BookmarkOptionsHelper.cs
- Pen.cs
- PropertyGridCommands.cs
- ListChunk.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- Function.cs
- XmlSerializerAssemblyAttribute.cs
- SQLInt64.cs
- UDPClient.cs
- SqlCacheDependencyDatabaseCollection.cs
- ReturnValue.cs