137 references to IsDefined
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
139if (!Enum.IsDefined(enumType, name))
CSharpSyntaxGenerator (6)
src\Compilers\CSharp\Portable\Syntax\SyntaxKindFacts.cs (6)
22Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 151Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 181Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 187Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 193Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 1241Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\PrincipalPermissionMode.cs (1)
20return Enum.IsDefined(typeof(PrincipalPermissionMode), principalPermissionMode);
IIS.Tests (1)
TlsHandshakeFeatureTests.cs (1)
34Assert.True(Enum.IsDefined(typeof(SslProtocols), protocol), "Defined: " + protocol); // Mapping is required, make sure it's current
ILLink.RoslynAnalyzer (1)
COMAnalyzer.cs (1)
79if (Enum.IsDefined(typeof(UnmanagedType), unmanagedType))
Interop.FunctionalTests (1)
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Components (2)
BindConverter.cs (2)
1618if (!Enum.IsDefined(typeof(T), converted)) 1643if (!Enum.IsDefined(typeof(T), converted))
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Binders\EnumTypeModelBinder.cs (1)
87return Enum.IsDefined(modelType, model);
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
HttpsTests.cs (1)
166Assert.True(Enum.IsDefined(typeof(SslProtocols), protocol), "Defined: " + protocol); // Mapping is required, make sure it's current
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\ThrowHelper.cs (1)
24Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.CodeAnalysis.CSharp (6)
Syntax\SyntaxKindFacts.cs (6)
22Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 151Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 181Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 187Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 193Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 1241Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (6)
src\Compilers\CSharp\Portable\Syntax\SyntaxKindFacts.cs (6)
22Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 151Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 181Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 187Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 193Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 1241Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Syntax\SyntaxTests.cs (2)
292Assert.True(Enum.IsDefined(typeof(SyntaxKind), kind), $"Nonexistent kind '{kind}' returned from method '{method.Name}'"); 314if (Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i))
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (6)
src\Compilers\CSharp\Portable\Syntax\SyntaxKindFacts.cs (6)
22Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 151Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 181Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 187Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 193Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 1241Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
Microsoft.DotNet.Build.Tasks.Feed (1)
src\PushToBuildStorage.cs (1)
191if (!Enum.IsDefined(typeof(PublishingInfraVersion), PublishingVersion))
Microsoft.Extensions.AI (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.AI.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.AI.AzureAIInference (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.AI.Evaluation (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.AI.Evaluation.Quality (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.AI.Evaluation.Reporting (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.AI.Evaluation.Safety (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.AI.OpenAI (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.Compliance.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.Compliance.Redaction (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.Primitives (2)
ThrowHelper.cs (2)
61Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), resource), 79Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
Microsoft.Extensions.Resilience (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.Telemetry.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Extensions.TimeProvider.Testing (1)
src\Shared\Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
Microsoft.Interop.ComInterfaceGenerator (1)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
177return !Enum.IsDefined(typeof(UnmanagedType), unmanagedType)
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
206return !Enum.IsDefined(typeof(UnmanagedType), unmanagedType)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (1)
690|| !Enum.IsDefined(typeof(MarshalMode), (MarshalMode)marshalMode))
Microsoft.Interop.SourceGeneration (1)
MarshalAsParser.cs (1)
158if (!Enum.IsDefined(typeof(UnmanagedType), unmanagedType)
Microsoft.Maui.Controls (4)
CompareStateTrigger.cs (1)
86 return Enum.IsDefined(enumType, value) ? Enum.ToObject(enumType, value) : null;
ListView\ListView.cs (2)
389 if (!Enum.IsDefined(typeof(ScrollToPosition), position)) 404 if (!Enum.IsDefined(typeof(ScrollToPosition), position))
ScrollView\ScrollView.cs (1)
264 if (!Enum.IsDefined(typeof(ScrollToPosition), position))
Microsoft.ML.Data (14)
Commands\TrainCommand.cs (1)
449ch.CheckUserArg(Enum.IsDefined(typeof(NormalizeOption), autoNorm), nameof(TrainCommand.Arguments.NormalizeFeatures),
DataLoadSave\Binary\BinaryLoader.cs (5)
344bool knowCompression = Enum.IsDefined(typeof(CompressionKind), compression); 503ectx.Assert(Enum.IsDefined(typeof(CompressionKind), compression)); 530Contracts.Assert((codec == null) || !Enum.IsDefined(typeof(CompressionKind), compression)); 1110bool knowCompression = Enum.IsDefined(typeof(CompressionKind), compression); 1779Ectx.Assert(Enum.IsDefined(typeof(CompressionKind), entry.Compression));
DataLoadSave\Database\DatabaseLoader.cs (1)
499ch.CheckUserArg(Enum.IsDefined(typeof(DbType), col.Type), nameof(Column.Type), "Bad item type");
EntryPoints\InputBuilder.cs (1)
446if (!Enum.IsDefined(type, value.Value<string>()))
Model\Pfa\SavePfaCommand.cs (1)
82Host.CheckUserArg(Enum.IsDefined(typeof(Formatting), args.Formatting), nameof(args.Formatting), "Undefined value");
Transforms\ColumnSelecting.cs (2)
345Contracts.Assert(Enum.IsDefined(typeof(HiddenColumnOption), hiddenOption)); 361Contracts.Assert(Enum.IsDefined(typeof(HiddenColumnOption), colHiddenOption));
Transforms\ValueToKeyMappingTransformer.cs (2)
283if (!Enum.IsDefined(typeof(ValueToKeyMappingEstimator.KeyOrdinality), options.Sort)) 290if (!Enum.IsDefined(typeof(ValueToKeyMappingEstimator.KeyOrdinality), sortOrder))
Transforms\ValueToKeyMappingTransformerImpl.cs (1)
519ectx.CheckDecode(Enum.IsDefined(typeof(MapType), mtype));
Microsoft.ML.Ensemble (6)
OutputCombiners\MultiWeightedAverage.cs (3)
59Host.CheckUserArg(Enum.IsDefined(typeof(MultiWeightageKind), _weightageKind), nameof(options.WeightageName)); 69Host.CheckDecode(Enum.IsDefined(typeof(MultiWeightageKind), _weightageKind)); 87Host.Assert(Enum.IsDefined(typeof(MultiWeightageKind), _weightageKind));
OutputCombiners\WeightedAverage.cs (3)
57Host.CheckUserArg(Enum.IsDefined(typeof(WeightageKind), _weightageKind), nameof(options.WeightageName)); 66Host.CheckDecode(Enum.IsDefined(typeof(WeightageKind), _weightageKind)); 85Contracts.Assert(Enum.IsDefined(typeof(WeightageKind), _weightageKind));
Microsoft.ML.FastTree (3)
Dataset\IntArray.cs (2)
91Contracts.CheckParam(Enum.IsDefined(typeof(IntArrayType), type) && type != IntArrayType.Current, nameof(type)); 92Contracts.CheckParam(Enum.IsDefined(typeof(IntArrayBits), bitsPerItem), nameof(bitsPerItem));
SumupPerformanceCommand.cs (1)
89_host.CheckUserArg(Enum.IsDefined(typeof(IntArrayType), args.Type) && args.Type != IntArrayType.Current, nameof(args.Type), "Value not defined");
Microsoft.ML.ImageAnalytics (4)
ImageResizer.cs (4)
207Host.CheckDecode(Enum.IsDefined(typeof(ImageResizingEstimator.ResizingKind), scale)); 209Host.CheckDecode(Enum.IsDefined(typeof(ImageResizingEstimator.Anchor), anchor)); 456Contracts.CheckUserArg(Enum.IsDefined(typeof(ResizingKind), resizing), nameof(resizing)); 457Contracts.CheckUserArg(Enum.IsDefined(typeof(Anchor), anchor), nameof(anchor));
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
94Debug.Assert(!Enum.IsDefined(typeof(NameType), desiredName));
Microsoft.ML.TimeSeries (16)
SequentialAnomalyDetectionTransformBase.cs (9)
173Host.CheckUserArg(Enum.IsDefined(typeof(MartingaleType), martingale), nameof(ArgumentsBase.Martingale), "Value is undefined."); 174Host.CheckUserArg(Enum.IsDefined(typeof(AnomalySide), anomalySide), nameof(ArgumentsBase.Side), "Value is undefined."); 175Host.CheckUserArg(Enum.IsDefined(typeof(AlertingScore), alertingScore), nameof(ArgumentsBase.AlertOn), "Value is undefined."); 211Host.CheckDecode(Enum.IsDefined(typeof(MartingaleType), temp)); 215Host.CheckDecode(Enum.IsDefined(typeof(AlertingScore), temp)); 222Host.CheckDecode(Enum.IsDefined(typeof(AnomalySide), temp)); 240Host.Assert(Enum.IsDefined(typeof(MartingaleType), Martingale)); 241Host.Assert(Enum.IsDefined(typeof(AlertingScore), ThresholdScore)); 244Host.Assert(Enum.IsDefined(typeof(AnomalySide), Side));
SlidingWindowTransformBase.cs (3)
74Host.CheckUserArg(Enum.IsDefined(typeof(BeginOptions), args.Begin), nameof(args.Begin), "Undefined value."); 92Host.CheckDecode(Enum.IsDefined(typeof(BeginOptions), r)); 114Host.Assert(Enum.IsDefined(typeof(BeginOptions), _begin));
SsaAnomalyDetectionBase.cs (3)
196Host.CheckUserArg(Enum.IsDefined(typeof(ErrorFunction), options.ErrorFunction), nameof(options.ErrorFunction), ErrorFunctionUtils.ErrorFunctionHelpText); 233Host.CheckDecode(Enum.IsDefined(typeof(ErrorFunction), temp)); 272Host.Assert(Enum.IsDefined(typeof(ErrorFunction), ErrorFunction));
SsaChangePointDetector.cs (1)
143InternalTransform.Host.Assert(!Enum.IsDefined(typeof(MartingaleType), InternalTransform.Martingale));
Microsoft.ML.Transforms (12)
GcnTransform.cs (1)
846Contracts.CheckDecode(Enum.IsDefined(typeof(NormFunction), normKindVal));
MissingValueReplacing.cs (1)
441if (!Enum.IsDefined(typeof(ReplacementKind), kind))
OneHotEncoding.cs (1)
65if (!Enum.IsDefined(typeof(OneHotEncodingEstimator.OutputKind), kind))
Text\NgramTransform.cs (2)
160Contracts.CheckDecode(Enum.IsDefined(typeof(NgramExtractingEstimator.WeightingCriteria), Weighting)); 179Contracts.Assert(Enum.IsDefined(typeof(NgramExtractingEstimator.WeightingCriteria), Weighting));
Text\StopWordsRemovingTransformer.cs (1)
237Contracts.CheckDecode(Enum.IsDefined(typeof(StopWordsRemovingEstimator.Language), lang));
Text\TextFeaturizingEstimator.cs (2)
385host.Check(Enum.IsDefined(typeof(Language), parent.OptionalSettings.Language)); 386host.Check(Enum.IsDefined(typeof(CaseMode), parent.OptionalSettings.CaseMode));
Text\TextNormalizing.cs (1)
164host.CheckDecode(Enum.IsDefined(typeof(TextNormalizingEstimator.CaseMode), _caseMode));
Text\WordEmbeddingsExtractor.cs (2)
187env.CheckUserArg(Enum.IsDefined(typeof(WordEmbeddingEstimator.PretrainedModelKind), modelKind), nameof(modelKind)); 227env.CheckUserArg(!options.ModelKind.HasValue || Enum.IsDefined(typeof(WordEmbeddingEstimator.PretrainedModelKind), options.ModelKind), nameof(options.ModelKind));
UngroupTransform.cs (1)
355ectx.CheckDecode(Enum.IsDefined(typeof(UngroupMode), modeIndex));
Shared (1)
Throw\Throw.cs (1)
228if (!Enum.IsDefined(typeof(T), argument))
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (1)
98return Enum.IsDefined(EnumType, convertedValue);
System.ComponentModel.TypeConverter (2)
System\ComponentModel\EnumConverter.cs (2)
131if (!EnumType.IsDefined(typeof(FlagsAttribute), false) && !Enum.IsDefined(EnumType, value)) 331public override bool IsValid(ITypeDescriptorContext? context, object? value) => Enum.IsDefined(EnumType, value!);
System.Drawing.Common.Tests (3)
System\Drawing\PenTests.cs (2)
1008if (Enum.IsDefined(typeof(DashCap), dashCap)) 1016Assert.Equal(Enum.IsDefined(typeof(DashCap), dashCap) ? dashCap : DashCap.Flat, pen.DashCap);
System\Drawing\Printing\PrintDocumentTests.cs (1)
246Assert.True(Enum.IsDefined(typeof(PrinterResolutionKind), pageSettings.PrinterResolution.Kind));
System.ServiceModel.Federation (1)
System\ServiceModel\Federation\WSTrustChannelSecurityTokenProvider.cs (1)
369if (!Enum.IsDefined(typeof(SecurityKeyEntropyMode), value))
System.Text.Encodings.Web (1)
System\Text\Encodings\Web\ThrowHelper.cs (1)
25Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
System.Text.Json (1)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
400s_isFlagsEnum || (dictionaryKeyPolicy is not null && Enum.IsDefined(typeof(T), value)),
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.cs (1)
112!Enum.IsDefined(typeof(HighDpiMode), highDpiMode))
System.Windows.Forms.Tests (3)
MaskedTextBoxTests.cs (1)
440if (!Enum.IsDefined(typeof(InsertKeyMode), insertMode))
System\Windows\Forms\KeyEventArgsTests.cs (1)
36if (Enum.IsDefined(typeof(Keys), e.KeyValue))
System\Windows\Forms\PreviewKeyDownEventArgsTests.cs (1)
35if (Enum.IsDefined(typeof(Keys), e.KeyValue))