Skip to content

Commit

Permalink
[General]Consolidate to language version C# 10 (#19209)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegiacometti committed Jul 15, 2022
1 parent 3d8fbd0 commit e6be446
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/modules/colorPicker/ColorPickerUI/ColorPickerUI.csproj
Expand Up @@ -16,7 +16,6 @@
<RootNamespace>ColorPicker</RootNamespace>
<AssemblyName>PowerToys.ColorPickerUI</AssemblyName>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
Expand Down
Expand Up @@ -7,7 +7,6 @@
<RootNamespace>Microsoft.ColorPicker.UnitTests</RootNamespace>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion>
<OutputType>Library</OutputType>
<Version>$(Version).0</Version>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/modules/launcher/PowerLauncher/App.xaml.cs
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
Expand Down Expand Up @@ -101,7 +102,7 @@ private void OnStartup(object sender, StartupEventArgs e)
{
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();
Expand Down
2 changes: 0 additions & 2 deletions src/modules/launcher/PowerLauncher/PowerLauncher.csproj
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/launcher/PowerLauncher/ReportWindow.xaml.cs
Expand Up @@ -47,7 +47,7 @@ private void SetException(Exception exception)
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();
Expand Down
Expand Up @@ -69,16 +69,16 @@ private static string CreateExceptionReport(System.Exception ex)
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(" * ");
Expand Down
Expand Up @@ -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>
Expand All @@ -30,7 +29,6 @@
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/modules/launcher/Wox.Plugin/Logger/Log.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -53,7 +54,7 @@ private static void LogInternalException(string message, System.Exception e, Typ
var formattedOutput = new StringBuilder();

formattedOutput.AppendLine("-------------------------- Begin exception --------------------------");
formattedOutput.AppendLine($"Message: {message}");
formattedOutput.AppendLine(CultureInfo.InvariantCulture, $"Message: {message}");

do
{
Expand Down
2 changes: 0 additions & 2 deletions src/modules/launcher/Wox.Plugin/Wox.Plugin.csproj
Expand Up @@ -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>
Expand All @@ -31,7 +30,6 @@
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/modules/launcher/Wox.Test/Wox.Test.csproj
Expand Up @@ -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>
Expand All @@ -29,7 +28,6 @@
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
Expand Down

0 comments on commit e6be446

Please sign in to comment.