mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
.NET Core on *nix doesn't like console
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'!='netcoreapp3.1'">
|
||||
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Mono.Data.Sqlite.Portable" Version="1.0.3.5" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -8,11 +8,18 @@ namespace SabreTools.Library.Data
|
||||
public static class Build
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns true if running in a Mono environment
|
||||
/// Returns true if running in a Mono or .NET Core environment
|
||||
/// </summary>
|
||||
public static bool MonoEnvironment
|
||||
public static bool MonoOrCoreEnvironment
|
||||
{
|
||||
get { return (Type.GetType("Mono.Runtime") != null); }
|
||||
get
|
||||
{
|
||||
#if NET_FRAMEWORK
|
||||
return Type.GetType("Mono.Runtime") != null;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -33,7 +40,7 @@ namespace SabreTools.Library.Data
|
||||
// Set the console to ready state
|
||||
ConsoleColor formertext = ConsoleColor.White;
|
||||
ConsoleColor formerback = ConsoleColor.Black;
|
||||
if (!MonoEnvironment)
|
||||
if (!MonoOrCoreEnvironment)
|
||||
{
|
||||
Console.SetBufferSize(Console.BufferWidth, 999);
|
||||
formertext = Console.ForegroundColor;
|
||||
@@ -51,7 +58,7 @@ namespace SabreTools.Library.Data
|
||||
Console.WriteLine();
|
||||
|
||||
// Return the console to the original text and background colors
|
||||
if (!MonoEnvironment)
|
||||
if (!MonoOrCoreEnvironment)
|
||||
{
|
||||
Console.ForegroundColor = formertext;
|
||||
Console.BackgroundColor = formerback;
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'!='netcoreapp3.1'">
|
||||
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Skippers\a7800.xml" />
|
||||
<None Remove="Skippers\fds.xml" />
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'!='netcoreapp3.1'">
|
||||
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SabreTools.Library\SabreTools.Library.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user