mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[General]Consolidate to language version C# 10 (#19209)
This commit is contained in:
committed by
GitHub
parent
3d8fbd0507
commit
e6be44623a
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -101,7 +102,7 @@ namespace PowerLauncher
|
||||
{
|
||||
var textToLog = new StringBuilder();
|
||||
textToLog.AppendLine("Begin PowerToys Run startup ----------------------------------------------------");
|
||||
textToLog.AppendLine($"Runtime info:{ErrorReporting.RuntimeInfo()}");
|
||||
textToLog.AppendLine(CultureInfo.InvariantCulture, $"Runtime info:{ErrorReporting.RuntimeInfo()}");
|
||||
|
||||
RegisterAppDomainExceptions();
|
||||
RegisterDispatcherUnhandledException();
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
@@ -36,7 +35,6 @@
|
||||
<DefineConstants>TRACE;RELEASE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace PowerLauncher
|
||||
content.AppendLine(ErrorReporting.RuntimeInfo());
|
||||
|
||||
// Using CurrentCulture since this is displayed to user in the report window
|
||||
content.AppendLine($"Date: {DateTime.Now.ToString(CultureInfo.CurrentCulture)}");
|
||||
content.AppendLine(CultureInfo.CurrentCulture, $"Date: {DateTime.Now.ToString(CultureInfo.CurrentCulture)}");
|
||||
content.AppendLine("Exception:");
|
||||
content.AppendLine(exception.ToString());
|
||||
var paragraph = new Paragraph();
|
||||
|
||||
@@ -69,16 +69,16 @@ namespace Wox.Infrastructure.Exception
|
||||
sb.AppendLine();
|
||||
|
||||
sb.AppendLine("## Environment");
|
||||
sb.AppendLine($"* Command Line: {Environment.CommandLine}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"* Command Line: {Environment.CommandLine}");
|
||||
|
||||
// Using InvariantCulture since this is internal
|
||||
sb.AppendLine($"* Timestamp: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
||||
sb.AppendLine($"* Wox version: {Constant.Version}");
|
||||
sb.AppendLine($"* OS Version: {Environment.OSVersion.VersionString}");
|
||||
sb.AppendLine($"* IntPtr Length: {IntPtr.Size}");
|
||||
sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}");
|
||||
sb.AppendLine($"* CLR Version: {Environment.Version}");
|
||||
sb.AppendLine($"* Installed .NET Framework: ");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"* Timestamp: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"* Wox version: {Constant.Version}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"* OS Version: {Environment.OSVersion.VersionString}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"* IntPtr Length: {IntPtr.Size}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"* x64: {Environment.Is64BitOperatingSystem}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"* CLR Version: {Environment.Version}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"* Installed .NET Framework: ");
|
||||
foreach (var result in GetFrameworkVersionFromRegistry())
|
||||
{
|
||||
sb.Append(" * ");
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
@@ -30,7 +29,6 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO.Abstractions;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
@@ -53,7 +54,7 @@ namespace Wox.Plugin.Logger
|
||||
var formattedOutput = new StringBuilder();
|
||||
|
||||
formattedOutput.AppendLine("-------------------------- Begin exception --------------------------");
|
||||
formattedOutput.AppendLine($"Message: {message}");
|
||||
formattedOutput.AppendLine(CultureInfo.InvariantCulture, $"Message: {message}");
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
@@ -31,7 +30,6 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
@@ -29,7 +28,6 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user