2153 references to Enum
AnalyzerRunner (2)
aspire (1)
Aspire.Dashboard (11)
Aspire.Dashboard.Components.Tests (1)
Aspire.Dashboard.Tests (3)
Aspire.EndToEnd.Tests (4)
Aspire.Hosting (4)
Aspire.Hosting.Testing.Tests (2)
Aspire.Hosting.Tests (1)
Aspire.Hosting.Yarp (2)
Binding.Http.IntegrationTests (9)
BasicHttpBindingTests.4.0.0.cs (6)
37serviceProxy = factory.CreateChannel(new EndpointAddress(Endpoints.HttpBaseAddress_Basic + Enum.GetName(typeof(WSMessageEncoding), messageEncoding)));
76factory = new ChannelFactory<IWcfService>(customBinding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic + Enum.GetName(typeof(WSMessageEncoding), messageEncoding)));
112factory = new ChannelFactory<IWcfService>(binding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic + Enum.GetName(typeof(WSMessageEncoding), messageEncoding)));
158factory = new ChannelFactory<IWcfService>(binding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic + Enum.GetName(typeof(WSMessageEncoding), messageEncoding)));
214factory = new ChannelFactory<IWcfService>(binding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic + Enum.GetName(typeof(WSMessageEncoding), messageEncoding)));
254factory = new ChannelFactory<IWcfService>(binding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic + Enum.GetName(typeof(WSMessageEncoding), messageEncoding)));
Binding.WS.FederationHttp.IntegrationTests (2)
BuildActionTelemetryTable (4)
CodeStyleConfigFileGenerator (5)
ConfigurationSchemaGenerator (1)
ConfigurationSchemaGenerator.Tests (1)
CSharpSyntaxGenerator (8)
dotnet-dev-certs (1)
dotnet-openapi (4)
dotnet-svcutil-lib (31)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SecurityAttributeGenerationHelper.cs (1)
43else if (value is Enum)
Extensibility.WebSockets.IntegrationTests (10)
WebSocketTests.4.1.0.cs (10)
48endpointAddress = Endpoints.WebSocketHttpDuplexStreamed_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding);
142endpointAddress = new EndpointAddress(Endpoints.WebSocketHttpDuplexBuffered_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding));
214endpointAddress = new EndpointAddress(Endpoints.WebSocketHttpDuplexBuffered_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding));
289endpointAddress = Endpoints.WebSocketHttpsDuplexStreamed_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding);
387endpointAddress = new EndpointAddress(Endpoints.WebSocketHttpsDuplexBuffered_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding));
451endpointAddress = new EndpointAddress(Endpoints.WebSocketHttpRequestReplyStreamed_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding));
520endpointAddress = new EndpointAddress(Endpoints.WebSocketHttpRequestReplyBuffered_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding));
578endpointAddress = new EndpointAddress(Endpoints.WebSocketHttpRequestReplyBuffered_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding));
638endpointAddress = new EndpointAddress(Endpoints.WebSocketHttpsRequestReplyBuffered_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding));
698endpointAddress = new EndpointAddress(Endpoints.WebSocketHttpsRequestReplyBuffered_Address + Enum.GetName(typeof(NetHttpMessageEncoding), messageEncoding));
GenerateDocumentationAndConfigFiles (37)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
GetDocument.Insider (1)
IIS.Tests (1)
illink (5)
ILLink.RoslynAnalyzer (3)
InMemory.FunctionalTests (4)
Interop.FunctionalTests (1)
Metrics (35)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Metrics.Legacy (35)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Microsoft.Analyzers.Local (4)
Microsoft.Analyzers.Local.Tests (2)
Microsoft.AspNetCore.App.Analyzers (1)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.AsyncState (2)
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
Microsoft.AspNetCore.Components (6)
BindConverter.cs (6)
1604private static bool ConvertToEnum<T>(object? obj, CultureInfo? _, out T value) where T : struct, Enum
1613if (!Enum.TryParse<T>(text, out var converted))
1619if (!Enum.IsDefined(typeof(T), converted))
1629private static bool ConvertToNullableEnum<T>(object? obj, CultureInfo? _, out T? value) where T : struct, Enum
1638if (!Enum.TryParse<T>(text, out var converted))
1644if (!Enum.IsDefined(typeof(T), converted))
Microsoft.AspNetCore.Components.Endpoints (2)
Microsoft.AspNetCore.Components.Web.Tests (2)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.Connections.Abstractions (1)
Microsoft.AspNetCore.DataProtection (2)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Microsoft.AspNetCore.HeaderParsing (2)
Microsoft.AspNetCore.Http.Abstractions (1)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Http.Connections.Tests (3)
Microsoft.AspNetCore.Http.Extensions (7)
Microsoft.AspNetCore.Identity.UI (2)
Microsoft.AspNetCore.JsonPatch (1)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (1)
Microsoft.AspNetCore.Mvc.Abstractions (10)
Microsoft.AspNetCore.Mvc.Core (10)
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
Microsoft.AspNetCore.Mvc.ViewFeatures (19)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Microsoft.AspNetCore.OpenApi (8)
Microsoft.AspNetCore.Rewrite (1)
Microsoft.AspNetCore.Server.HttpSys (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.Kestrel.Core (6)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
Microsoft.AspNetCore.Shared.Tests (1)
Microsoft.AspNetCore.Testing (2)
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Microsoft.Build.Framework (5)
Microsoft.Build.Tasks.CodeAnalysis (4)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (5)
Microsoft.Cci.Extensions (2)
Microsoft.CodeAnalysis (11)
Microsoft.CodeAnalysis.Analyzers (39)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Microsoft.CodeAnalysis.AnalyzerUtilities (37)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Microsoft.CodeAnalysis.BannedApiAnalyzers (36)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Microsoft.CodeAnalysis.CodeStyle (34)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.Collections.Package (4)
Microsoft.CodeAnalysis.Contracts.Package (4)
Microsoft.CodeAnalysis.CSharp (9)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (7)
Microsoft.CodeAnalysis.CSharp.Features (1)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (11)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Microsoft.CodeAnalysis.Debugging.Package (5)
Microsoft.CodeAnalysis.EditorFeatures (6)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (12)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (5)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (6)
Microsoft.CodeAnalysis.Extensions.Package (5)
Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests (6)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.UnitTests (4)
Microsoft.CodeAnalysis.Features (18)
Microsoft.CodeAnalysis.Features.UnitTests (4)
Microsoft.CodeAnalysis.InteractiveHost (5)
Microsoft.CodeAnalysis.LanguageServer (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (36)
Microsoft.CodeAnalysis.PooledObjects.Package (5)
Microsoft.CodeAnalysis.PublicApiAnalyzers (35)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Microsoft.CodeAnalysis.Rebuild (3)
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (35)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Microsoft.CodeAnalysis.Test.Utilities (2)
Microsoft.CodeAnalysis.Threading.Package (4)
Microsoft.CodeAnalysis.UnitTests (5)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (39)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (11)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (8)
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Microsoft.CommonLanguageServerProtocol.Framework.Example (4)
Microsoft.CommonLanguageServerProtocol.Framework.Package (5)
Microsoft.CSharp (6)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.ArcadeLogging (1)
Microsoft.DotNet.Build.Manifest (2)
Microsoft.DotNet.Build.Tasks.Feed (7)
Microsoft.DotNet.Build.Tasks.Feed.Tests (2)
Microsoft.DotNet.Build.Tasks.Installers (4)
Microsoft.DotNet.Build.Tasks.Packaging (2)
Microsoft.DotNet.GenAPI (3)
Microsoft.DotNet.Helix.Client (1)
Microsoft.DotNet.Internal.SymbolHelper (1)
Microsoft.DotNet.SignCheckTask (2)
Microsoft.DotNet.SignTool (3)
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (7)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Microsoft.Extensions.AI.AzureAIInference (2)
Microsoft.Extensions.AI.Evaluation (2)
Microsoft.Extensions.AI.Evaluation.Console (2)
Microsoft.Extensions.AI.Evaluation.Integration.Tests (1)
Microsoft.Extensions.AI.Evaluation.NLP (2)
Microsoft.Extensions.AI.Evaluation.Quality (2)
Microsoft.Extensions.AI.Evaluation.Reporting (3)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (3)
Microsoft.Extensions.AI.Evaluation.Safety (3)
Microsoft.Extensions.AI.Integration.Tests (2)
Microsoft.Extensions.AI.OpenAI (2)
Microsoft.Extensions.AI.Tests (1)
Microsoft.Extensions.AmbientMetadata.Application (2)
Microsoft.Extensions.AsyncState (2)
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Compliance.Abstractions (2)
Microsoft.Extensions.Compliance.Redaction (3)
Microsoft.Extensions.Compliance.Testing (3)
Microsoft.Extensions.Configuration.Binder (2)
Microsoft.Extensions.DependencyInjection (1)
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Microsoft.Extensions.DependencyInjection.AutoActivation (2)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (4)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (2)
Microsoft.Extensions.Diagnostics.Probes (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Microsoft.Extensions.Diagnostics.Testing (2)
Microsoft.Extensions.Hosting.Testing (2)
Microsoft.Extensions.Http (2)
Microsoft.Extensions.Http.Resilience (2)
Microsoft.Extensions.Logging.Configuration (1)
Microsoft.Extensions.Logging.Console (1)
Microsoft.Extensions.ObjectPool.DependencyInjection (2)
Microsoft.Extensions.Options.Contextual (2)
Microsoft.Extensions.Primitives (2)
Microsoft.Extensions.Resilience (2)
Microsoft.Extensions.Telemetry (2)
Microsoft.Extensions.Telemetry.Abstractions (2)
Microsoft.Extensions.TimeProvider.Testing (2)
Microsoft.Interop.ComInterfaceGenerator (1)
Microsoft.Interop.JavaScript.JSImportGenerator (3)
Microsoft.Interop.LibraryImportGenerator (4)
Microsoft.Interop.SourceGeneration (1)
Microsoft.Maui (6)
Converters\FlexEnumsConverters.cs (6)
24 if (Enum.TryParse(strValue, true, out FlexJustify justify))
63 if (Enum.TryParse(strValue, true, out FlexDirection aligncontent))
98 if (Enum.TryParse(strValue, true, out FlexAlignContent aligncontent))
137 if (Enum.TryParse(strValue, true, out FlexAlignItems alignitems))
172 if (Enum.TryParse(strValue, true, out FlexAlignSelf alignself))
207 if (Enum.TryParse(strValue, true, out FlexWrap wrap))
Microsoft.Maui.Controls (14)
Microsoft.Maui.Controls.Build.Tasks (3)
Microsoft.Maui.Controls.DesignTools (2)
Microsoft.Maui.Graphics (2)
Microsoft.ML.AutoML (10)
Microsoft.ML.AutoML.Tests (7)
Microsoft.ML.CodeGenerator (3)
Microsoft.ML.Core (4)
Microsoft.ML.Core.Tests (1)
Microsoft.ML.Data (22)
Microsoft.ML.Ensemble (9)
Microsoft.ML.EntryPoints (1)
Microsoft.ML.FastTree (9)
Microsoft.ML.ImageAnalytics (4)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.ML.SearchSpace (5)
Microsoft.ML.Tests (1)
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));
Microsoft.ML.Transforms (17)
Microsoft.VisualBasic.Core (14)
Microsoft.VisualStudio.LanguageServices (7)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Microsoft.VisualStudio.LanguageServices.DevKit (1)
Microsoft.VisualStudio.LanguageServices.Implementation (1)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
mscorlib (1)
netstandard (1)
PresentationBuildTasks (2)
PresentationCore (10)
PresentationCore.Tests (1)
PresentationFramework (15)
PresentationFramework.Tests (1)
PresentationUI (5)
ReachFramework (36)
Replay (4)
Roslyn.Diagnostics.Analyzers (36)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
Roslyn.Test.PdbUtilities (1)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (2)
Security.TransportSecurity.IntegrationTests (1)
SemanticSearch.BuildTask (4)
ServerComparison.FunctionalTests (1)
Shared (2)
SocialWeather (1)
System.ComponentModel.Annotations (6)
System.ComponentModel.Composition (1)
System.ComponentModel.TypeConverter (36)
System\ComponentModel\EnumConverter.cs (31)
15/// Provides a type converter to convert <see cref='System.Enum'/> objects to and
26if (!type.IsEnum && !type.Equals(typeof(Enum)))
44if (sourceType == typeof(string) || sourceType == typeof(Enum[]))
57if (destinationType == typeof(Enum[]) || destinationType == typeof(InstanceDescriptor))
88bool isUnderlyingTypeUInt64 = Enum.GetUnderlyingType(EnumType) == typeof(ulong);
92convertedValue |= GetEnumValue(isUnderlyingTypeUInt64, Enum.Parse(EnumType, strValue.AsSpan(v), true), culture);
94return Enum.ToObject(EnumType, convertedValue);
98return Enum.Parse(EnumType, strValue, true);
106else if (value is Enum[])
108bool isUnderlyingTypeUInt64 = Enum.GetUnderlyingType(EnumType) == typeof(ulong);
110foreach (Enum e in (Enum[])value)
114return Enum.ToObject(EnumType, finalValue);
130if (!EnumType.IsDefined(typeof(FlagsAttribute), false) && !Enum.IsDefined(EnumType, value))
135return Enum.Format(EnumType, value, "G");
149Type underlyingType = Enum.GetUnderlyingType(EnumType);
154MethodInfo? method = typeof(Enum).GetMethod("ToObject", new Type[] { typeof(Type), underlyingType });
174if (destinationType == typeof(Enum[]) && value != null)
178bool isUnderlyingTypeUInt64 = Enum.GetUnderlyingType(EnumType) == typeof(ulong);
179List<Enum> flagValues = new List<Enum>();
181Array objValues = Enum.GetValuesAsUnderlyingType(EnumType);
197flagValues.Add((Enum)Enum.ToObject(EnumType, ul));
212flagValues.Add((Enum)Enum.ToObject(EnumType, longValue));
219return new Enum[] { (Enum)Enum.ToObject(EnumType, value) };
283value = Enum.Parse(EnumType, field.Name);
330public override bool IsValid(ITypeDescriptorContext? context, object? value) => Enum.IsDefined(EnumType, value!);
System.Configuration.ConfigurationManager (5)
System.Data.Common (6)
System.Diagnostics.Process (5)
System.Diagnostics.TraceSource (2)
System.Drawing.Common (2)
System.Drawing.Common.Tests (4)
System.Formats.Asn1 (28)
System.IO.Compression.ZipFile (1)
System.IO.FileSystem.DriveInfo (3)
System.IO.FileSystem.Watcher (1)
System.IO.Packaging (1)
System.Linq.Expressions (17)
System\Linq\Expressions\Interpreter\TypeOperations.cs (11)
399frame.Push(from == null ? null : Enum.ToObject(_t, from));
426frame.Push(Enum.ToObject(_t, (int)from));
429frame.Push(Enum.ToObject(_t, (long)from));
432frame.Push(Enum.ToObject(_t, (uint)from));
435frame.Push(Enum.ToObject(_t, (ulong)from));
438frame.Push(Enum.ToObject(_t, (byte)from));
441frame.Push(Enum.ToObject(_t, (sbyte)from));
444frame.Push(Enum.ToObject(_t, (short)from));
447frame.Push(Enum.ToObject(_t, (ushort)from));
451frame.Push(Enum.ToObject(_t, (char)from));
457frame.Push(Enum.ToObject(_t, (bool)from));
System.Net.Http (1)
System.Net.Security (3)
System.Net.WebSockets (1)
System.Private.CoreLib (103)
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (22)
129return Enum.GetName(this, Enum.ToUInt64(value));
140string[] ret = Enum.GetNamesNoCopy(this);
153Array values = Enum.GetValuesAsUnderlyingTypeNoCopy(this);
176return Enum.GetValuesAsUnderlyingType(this);
184return Enum.InternalGetUnderlyingType(this);
240return Array.IndexOf(Enum.GetNamesNoCopy(this), (string)value) >= 0;
246RuntimeType underlyingType = Enum.InternalGetUnderlyingType(this);
252TypeCode.SByte => Enum.IsDefinedPrimitive(this, (byte)(sbyte)value),
253TypeCode.Byte => Enum.IsDefinedPrimitive(this, (byte)value),
254TypeCode.Int16 => Enum.IsDefinedPrimitive(this, (ushort)(short)value),
255TypeCode.UInt16 => Enum.IsDefinedPrimitive(this, (ushort)value),
256TypeCode.Int32 => Enum.IsDefinedPrimitive(this, (uint)(int)value),
257TypeCode.UInt32 => Enum.IsDefinedPrimitive(this, (uint)value),
258TypeCode.Int64 => Enum.IsDefinedPrimitive(this, (ulong)(long)value),
259TypeCode.UInt64 => Enum.IsDefinedPrimitive(this, (ulong)value),
260TypeCode.Single => Enum.IsDefinedPrimitive(this, (float)value),
261TypeCode.Double => Enum.IsDefinedPrimitive(this, (double)value),
262TypeCode.Char => Enum.IsDefinedPrimitive(this, (char)value),
264underlyingType == typeof(nint) ? Enum.IsDefinedPrimitive(this, (nuint)(nint)value) :
265underlyingType == typeof(nuint) ? Enum.IsDefinedPrimitive(this, (nuint)value) :
782type = (RuntimeType)Enum.GetUnderlyingType(type);
System.Private.DataContractSerialization (13)
System.Private.Windows.Core.TestUtilities (6)
System.Private.Xml (27)
System.Reflection.Emit (1)
System.Reflection.Metadata (3)
System.Resources.Extensions (1)
System.Resources.Writer (1)
System.Runtime (1)
System.Security.Cryptography (2)
System.Security.Cryptography.Pkcs (2)
System.ServiceModel.Federation (1)
System.ServiceModel.NetFramingBase (1)
System.ServiceModel.NetTcp (1)
System.ServiceModel.Primitives (2)
System.ServiceModel.UnixDomainSocket (1)
System.Text.Encodings.Web (1)
System.Text.Json (11)
System.Text.Json.SourceGeneration (1)
System.Text.RegularExpressions (6)
System.Windows.Forms (25)
System.Windows.Forms.Analyzers.CSharp (3)
System.Windows.Forms.Analyzers.CSharp.Tests (1)
System.Windows.Forms.Analyzers.Tests (4)
System.Windows.Forms.Design (9)
System.Windows.Forms.Design.Tests (2)
System.Windows.Forms.Primitives (2)
System.Windows.Forms.Primitives.Tests (1)
System.Windows.Forms.Primitives.TestUtilities (1)
System.Windows.Forms.Tests (402)
System\Windows\Forms\KeysConverterTests.cs (11)
46yield return new object[] { "fr-FR", Keys.None, new Enum[] { Keys.None } };
47yield return new object[] { "de-DE", Keys.S, new Enum[] { Keys.S } };
48yield return new object[] { "zh-CN", Keys.Control | Keys.C, new Enum[] { Keys.Control, Keys.C } };
49yield return new object[] { "it-IT", Keys.Control | Keys.Add, new Enum[] { Keys.Control, Keys.Add } };
50yield return new object[] { "ko-KR", Keys.Control | Keys.Alt | Keys.D, new Enum[] { Keys.Control, Keys.Alt, Keys.D } };
51yield return new object[] { "ru-RU", Keys.Control | Keys.Alt | Keys.Shift | Keys.A, new Enum[] { Keys.Control, Keys.Alt, Keys.Shift, Keys.A } };
52yield return new object[] { "zh-TW", Keys.Control | Keys.Alt | Keys.Shift | Keys.F1, new Enum[] { Keys.Control, Keys.Alt, Keys.Shift, Keys.F1 } };
57public void ConvertToEnumArray_ShouldConvertKeys(string cultureName, Keys keys, Enum[] expectedResult)
60object result = converter.ConvertTo(keys, typeof(Enum[]));
68object resultWithoutCulture = converter.ConvertTo(context: null, culture: null, keys, typeof(Enum[]));
69object resultWithUICulture = converter.ConvertTo(context: null, culture: Thread.CurrentThread.CurrentUICulture, keys, typeof(Enum[]));
System.Windows.Forms.TestUtilities (8)
System.Windows.Forms.UI.IntegrationTests (1)
System.Xaml (1)
Test.Utilities (34)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
TestProject.AppHost (2)
TestProject.IntegrationServiceA (2)
Text.Analyzers (36)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (9)
104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum
112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
158private static bool TryParseEnum<T>(string str, out T result) where T : struct, Enum
173return Enum.TryParse(str, ignoreCase: true, out result);
209where TFromEnum : struct, Enum
210where TToEnum : struct, Enum
UIAutomationClient (1)
UIAutomationClientSideProviders (2)
Wasm.Performance.ConsoleHost (1)
WindowsBase.Tests (13)
WinFormsControlsTest (1)
xunit.console (1)