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
- ConnectivityStatus.cs
- FileLogRecord.cs
- CannotUnloadAppDomainException.cs
- DES.cs
- PolicyManager.cs
- CmsInterop.cs
- ProgressBar.cs
- ToolStripLocationCancelEventArgs.cs
- WebRequestModuleElementCollection.cs
- MessageAction.cs
- AnnotationObservableCollection.cs
- safesecurityhelperavalon.cs
- CheckBoxAutomationPeer.cs
- RemoteWebConfigurationHostServer.cs
- NativeMethods.cs
- OutputCacheEntry.cs
- SapiAttributeParser.cs
- ThreadWorkerController.cs
- SystemDiagnosticsSection.cs
- ProfilePropertySettingsCollection.cs
- CngKeyBlobFormat.cs
- ListenerSingletonConnectionReader.cs
- WpfMemberInvoker.cs
- documentsequencetextview.cs
- TimeSpanOrInfiniteValidator.cs
- RegisteredExpandoAttribute.cs
- ColumnBinding.cs
- KeyFrames.cs
- control.ime.cs
- DataGridViewTopLeftHeaderCell.cs
- SourceFileBuildProvider.cs
- ToolStripPanelRow.cs
- TextFindEngine.cs
- RecognitionEventArgs.cs
- DbConnectionInternal.cs
- GlobalItem.cs
- ArcSegment.cs
- MsmqQueue.cs
- ComplexObject.cs
- DataGridViewComponentPropertyGridSite.cs
- _UncName.cs
- LayoutTable.cs
- DetailsViewPageEventArgs.cs
- FileDialogCustomPlaces.cs
- HMACSHA512.cs
- LinqDataView.cs
- securitycriticaldata.cs
- RegexInterpreter.cs
- NativeBuffer.cs
- EntityViewGenerator.cs
- MobileUserControl.cs
- SchemaMapping.cs
- RepeatButtonAutomationPeer.cs
- Stopwatch.cs
- InputLangChangeRequestEvent.cs
- Link.cs
- PointLight.cs
- ProvideValueServiceProvider.cs
- DrawingBrush.cs
- ToolStripContainer.cs
- EntityDataSourceColumn.cs
- ParserStreamGeometryContext.cs
- hebrewshape.cs
- TextTreeDeleteContentUndoUnit.cs
- ContentElementAutomationPeer.cs
- TrackingProfileDeserializationException.cs
- DatagridviewDisplayedBandsData.cs
- DocumentOrderQuery.cs
- Intellisense.cs
- XamlSerializer.cs
- CapabilitiesUse.cs
- MachineKeyConverter.cs
- PkcsUtils.cs
- RectIndependentAnimationStorage.cs
- Win32KeyboardDevice.cs
- VersionedStreamOwner.cs
- ConfigurationValues.cs
- PeerMaintainer.cs
- ToolStripSettings.cs
- Nullable.cs
- WebPartEditorOkVerb.cs
- AssemblyBuilderData.cs
- AdvancedBindingEditor.cs
- MenuItemBinding.cs
- FixedBufferAttribute.cs
- StoreAnnotationsMap.cs
- ImportCatalogPart.cs
- TimeSpanValidatorAttribute.cs
- WsatConfiguration.cs
- TileBrush.cs
- ConnectorRouter.cs
- FormViewInsertedEventArgs.cs
- DrawingVisualDrawingContext.cs
- ManagedWndProcTracker.cs
- BitmapEffectDrawingContextWalker.cs
- RuntimeVariablesExpression.cs
- DataGridSortCommandEventArgs.cs
- OracleBoolean.cs
- CommandField.cs
- OleDbDataReader.cs