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
- FontCacheLogic.cs
- ResourcesChangeInfo.cs
- HttpStreamXmlDictionaryWriter.cs
- BitmapMetadata.cs
- ControlBindingsCollection.cs
- TextBoxBase.cs
- SecurityPolicyVersion.cs
- StringDictionary.cs
- Properties.cs
- RowUpdatingEventArgs.cs
- DesignerListAdapter.cs
- CodePrimitiveExpression.cs
- DataContractJsonSerializer.cs
- RightsManagementInformation.cs
- BrowserCapabilitiesFactory.cs
- FontSource.cs
- FileSystemEnumerable.cs
- NumberFormatInfo.cs
- CallSite.cs
- NativeMethods.cs
- SqlClientMetaDataCollectionNames.cs
- SearchForVirtualItemEventArgs.cs
- TextDecorationCollectionConverter.cs
- InputReport.cs
- InstanceCreationEditor.cs
- StrokeNodeOperations.cs
- WebBrowserSiteBase.cs
- NetWebProxyFinder.cs
- Ref.cs
- SqlMethodTransformer.cs
- GroupLabel.cs
- RTLAwareMessageBox.cs
- ServerReliableChannelBinder.cs
- Menu.cs
- PageVisual.cs
- ObjectStateFormatter.cs
- srgsitem.cs
- WebPartDescription.cs
- PeerNearMe.cs
- LineUtil.cs
- DataGridViewRowsAddedEventArgs.cs
- DecoderFallback.cs
- LinkButton.cs
- HttpCacheVaryByContentEncodings.cs
- DataGridCellItemAutomationPeer.cs
- TransactionsSectionGroup.cs
- Marshal.cs
- ResourceExpression.cs
- PrintDocument.cs
- PlainXmlWriter.cs
- HyperLinkField.cs
- TypeBrowserDialog.cs
- DateRangeEvent.cs
- LowerCaseStringConverter.cs
- DataSourceControlBuilder.cs
- ActivatedMessageQueue.cs
- SizeKeyFrameCollection.cs
- DescendantBaseQuery.cs
- DrawingContextWalker.cs
- RelatedImageListAttribute.cs
- ByeMessageCD1.cs
- QilScopedVisitor.cs
- CustomAttribute.cs
- SQLDateTimeStorage.cs
- VerticalAlignConverter.cs
- ThrowHelper.cs
- IConvertible.cs
- XmlReaderSettings.cs
- XmlAtomicValue.cs
- DataRelationPropertyDescriptor.cs
- RadioButtonList.cs
- AttributeData.cs
- CfgSemanticTag.cs
- AxisAngleRotation3D.cs
- FormViewInsertedEventArgs.cs
- GroupByQueryOperator.cs
- BStrWrapper.cs
- TextSelectionHighlightLayer.cs
- BasicExpandProvider.cs
- UInt16Storage.cs
- ToolStripSeparatorRenderEventArgs.cs
- VectorConverter.cs
- Properties.cs
- FusionWrap.cs
- CodeArrayCreateExpression.cs
- BrowserInteropHelper.cs
- Part.cs
- DataListItem.cs
- NavigationProperty.cs
- CreateUserWizardStep.cs
- OLEDB_Util.cs
- Int32RectConverter.cs
- MarkerProperties.cs
- OleDbDataReader.cs
- CommonRemoteMemoryBlock.cs
- NotFiniteNumberException.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ZipIOExtraFieldPaddingElement.cs
- CellParaClient.cs
- CounterCreationData.cs