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>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(TargetFramework)'!='netcoreapp3.1'">
|
||||||
|
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Mono.Data.Sqlite.Portable" Version="1.0.3.5" />
|
<PackageReference Include="Mono.Data.Sqlite.Portable" Version="1.0.3.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -8,11 +8,18 @@ namespace SabreTools.Library.Data
|
|||||||
public static class Build
|
public static class Build
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if running in a Mono environment
|
/// Returns true if running in a Mono or .NET Core environment
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
@@ -33,7 +40,7 @@ namespace SabreTools.Library.Data
|
|||||||
// Set the console to ready state
|
// Set the console to ready state
|
||||||
ConsoleColor formertext = ConsoleColor.White;
|
ConsoleColor formertext = ConsoleColor.White;
|
||||||
ConsoleColor formerback = ConsoleColor.Black;
|
ConsoleColor formerback = ConsoleColor.Black;
|
||||||
if (!MonoEnvironment)
|
if (!MonoOrCoreEnvironment)
|
||||||
{
|
{
|
||||||
Console.SetBufferSize(Console.BufferWidth, 999);
|
Console.SetBufferSize(Console.BufferWidth, 999);
|
||||||
formertext = Console.ForegroundColor;
|
formertext = Console.ForegroundColor;
|
||||||
@@ -51,7 +58,7 @@ namespace SabreTools.Library.Data
|
|||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
|
|
||||||
// Return the console to the original text and background colors
|
// Return the console to the original text and background colors
|
||||||
if (!MonoEnvironment)
|
if (!MonoOrCoreEnvironment)
|
||||||
{
|
{
|
||||||
Console.ForegroundColor = formertext;
|
Console.ForegroundColor = formertext;
|
||||||
Console.BackgroundColor = formerback;
|
Console.BackgroundColor = formerback;
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(TargetFramework)'!='netcoreapp3.1'">
|
||||||
|
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Skippers\a7800.xml" />
|
<None Remove="Skippers\a7800.xml" />
|
||||||
<None Remove="Skippers\fds.xml" />
|
<None Remove="Skippers\fds.xml" />
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(TargetFramework)'!='netcoreapp3.1'">
|
||||||
|
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SabreTools.Library\SabreTools.Library.csproj" />
|
<ProjectReference Include="..\SabreTools.Library\SabreTools.Library.csproj" />
|
||||||
|
|||||||
Reference in New Issue
Block a user