89 references to TryParse
aspire (1)
Commands\PublishCommandBase.cs (1)
471if (!Enum.TryParse<InputType>(input.InputType, ignoreCase: true, out var inputType))
Aspire.Dashboard (3)
Components\Pages\StructuredLogs.razor.cs (1)
445if (LogLevelText is not null && Enum.TryParse<LogLevel>(LogLevelText, ignoreCase: true, out var logLevel))
Model\Otlp\TelemetryFilter.cs (1)
112if (Enum.TryParse<LogLevel>(Value, ignoreCase: true, out var value))
src\Shared\IConfigurationExtensions.cs (1)
183else if (Enum.TryParse<T>(value, ignoreCase: true, out var e))
Aspire.EndToEnd.Tests (1)
tests\testproject\Common\TestResourceNames.cs (1)
24if (Enum.TryParse<TestResourceNames>(resourceName, ignoreCase: true, out var name))
Aspire.Hosting (1)
src\Shared\IConfigurationExtensions.cs (1)
183else if (Enum.TryParse<T>(value, ignoreCase: true, out var e))
Aspire.Hosting.Testing.Tests (1)
tests\testproject\Common\TestResourceNames.cs (1)
24if (Enum.TryParse<TestResourceNames>(resourceName, ignoreCase: true, out var name))
dotnet-dev-certs (1)
Program.cs (1)
423if (exportFormat.HasValue() && !Enum.TryParse(exportFormat.Value(), ignoreCase: true, out format))
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpTransportBindingElement.cs (1)
550if (!Enum.TryParse<TransferMode>(transferMode, true, out result) || !TransferModeHelper.IsDefined(result) || result == TransferMode.Buffered)
GenerateDocumentationAndConfigFiles (4)
src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (1)
296if (Enum.TryParse(severityPart, ignoreCase: true, out DiagnosticSeverity parsedSeverity))
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
illink (2)
Metrics (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Metrics.Legacy (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.AspNetCore.Components.Endpoints (1)
FormMapping\Converters\EnumConverter.cs (1)
15if (Enum.TryParse(value, ignoreCase: true, out result))
Microsoft.AspNetCore.Http.Extensions (1)
src\Components\Endpoints\src\FormMapping\Converters\EnumConverter.cs (1)
15if (Enum.TryParse(value, ignoreCase: true, out result))
Microsoft.AspNetCore.Identity.UI (1)
IdentityBuilderUIExtensions.cs (1)
95if (!Enum.TryParse(metadata, ignoreCase: true, out uiFramework))
Microsoft.AspNetCore.JsonPatch (1)
Operations\OperationBase.cs (1)
37if (!Enum.TryParse(value, ignoreCase: true, result: out result))
Microsoft.AspNetCore.JsonPatch.SystemTextJson (1)
Operations\OperationBase.cs (1)
37if (!Enum.TryParse(value, ignoreCase: true, result: out result))
Microsoft.AspNetCore.OpenApi (1)
Extensions\JsonNodeSchemaExtensions.cs (1)
498if (Enum.TryParse<JsonSchemaType>(jsonNode?.GetValue<string>(), true, out var openApiSchemaType))
Microsoft.AspNetCore.Rewrite (1)
IISUrlRewrite\UrlRewriteFileParser.cs (1)
277else if (!Enum.TryParse(attribute.Value, ignoreCase: true, result: out enumResult))
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Internal\ConfigurationReader.cs (3)
168if (Enum.TryParse<ClientCertificateMode>(clientCertificateMode, ignoreCase: true, out var result)) 178if (Enum.TryParse<HttpProtocols>(protocols, ignoreCase: true, out var result)) 202if (Enum.TryParse(current, ignoreCase: true, out SslProtocols parsed))
Microsoft.CodeAnalysis.Analyzers (4)
MetaAnalyzers\ReleaseTrackingHelper.cs (1)
296if (Enum.TryParse(severityPart, ignoreCase: true, out DiagnosticSeverity parsedSeverity))
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.CodeAnalysis.BannedApiAnalyzers (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.CodeAnalysis.PublicApiAnalyzers (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
MSBuild\ProjectFile\Conversions.cs (1)
62return Enum.TryParse<TEnum>(value, ignoreCase, out var result)
Microsoft.DotNet.Build.Tasks.Feed (4)
src\PublishArtifactsInManifest.cs (1)
175set { Enum.TryParse<PublishingConstants.BuildQuality>(value, true, out _buildQuality); }
src\PublishArtifactsInManifestBase.cs (2)
1175if (!Enum.TryParse(category, ignoreCase: true, out TargetFeedContentType categoryKey)) 1203if (!Enum.TryParse(category, ignoreCase: true, out TargetFeedContentType categoryKey))
src\PushToBuildStorage.cs (1)
504if (Enum.TryParse(item.ItemSpec, true, out ArtifactVisibility parsedVisibility))
Microsoft.DotNet.Build.Tasks.Packaging (1)
Extensions.cs (1)
70Enum.TryParse(packageDirectoryName, true, out result);
Microsoft.DotNet.SignTool (1)
src\SignToolTask.cs (1)
573if (!string.IsNullOrEmpty(executableTypeMetadata) && !Enum.TryParse<ExecutableType>(executableTypeMetadata, true, out executableType))
Microsoft.Extensions.Http (1)
DependencyInjection\SocketsHttpHandlerBuilderExtensions.cs (1)
218=> Enum.TryParse<TEnum>(enumString, ignoreCase: true, out var result) ? result : null;
Microsoft.Extensions.Logging.Configuration (1)
LoggerFilterConfigureOptions.cs (1)
79else if (Enum.TryParse(value, true, out level))
Microsoft.Extensions.Logging.Console (1)
ConfigurationConsoleLoggerSettings.cs (1)
92else if (Enum.TryParse<LogLevel>(value, true, out level))
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 (3)
DecorableTextElement.cs (1)
38 if (Enum.TryParse(item.Trim(), true, out TextDecorations textDecorations))
FontAttributes.cs (1)
56 if (Enum.TryParse(part, true, out FontAttributes attr))
FontSizeConverter.cs (1)
52 else if (Enum.TryParse(value, ignoreCase, out NamedSize ns))
Microsoft.Maui.Controls.Build.Tasks (1)
SetPropertiesVisitor.cs (1)
506 || !Enum.TryParse((modeNode as ValueNode)?.Value as string, true, out BindingMode declaredmode))
Microsoft.Maui.Controls.DesignTools (2)
ButtonContentDesignTypeConverter.cs (2)
34 if (parts.Length == 2 && !Enum.TryParse(parts[1], true, out ImagePosition _)) 40 if (!Enum.TryParse(parts[0], true, out ImagePosition _))
Microsoft.ML.Transforms (1)
OneHotEncoding.cs (1)
53if (!Enum.TryParse(extra, true, out OneHotEncodingEstimator.OutputKind kind))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
127if (!Enum.TryParse(GetStringOption(CompilerOptions.OPTID_PLATFORM, ""), ignoreCase: true, result: out Platform platform))
Roslyn.Diagnostics.Analyzers (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
834TryParse(value, ignoreCase: false, out result);
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.cs (1)
111if (!Enum.TryParse(rawValue, true, out highDpiMode) ||
Test.Utilities (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);
TestProject.AppHost (1)
tests\testproject\Common\TestResourceNames.cs (1)
24if (Enum.TryParse<TestResourceNames>(resourceName, ignoreCase: true, out var name))
TestProject.IntegrationServiceA (1)
tests\testproject\Common\TestResourceNames.cs (1)
24if (Enum.TryParse<TestResourceNames>(resourceName, ignoreCase: true, out var name))
Text.Analyzers (3)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
144tryParseValue: static (value, out result) => Enum.TryParse(value, ignoreCase: true, result: out result), 164if (Enum.TryParse(kindStr, ignoreCase: true, result: out TEnum kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
173return Enum.TryParse(str, ignoreCase: true, out result);