mirror of
https://github.com/Novetus/Novetus_src.git
synced 2025-01-31 09:41:33 +02:00
add NET4 constant. Use Task.Delay in Utils.Delay
This commit is contained in:
parent
19f64afaee
commit
619708b815
@ -27,7 +27,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;BASICLAUNCHER;NOVETUS_APPS</DefineConstants>
|
||||
<DefineConstants>TRACE;BASICLAUNCHER;NOVETUS_APPS;NET4</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;TESTER;NOVETUS_APPS</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;TESTER;NOVETUS_APPS;NET4</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;PREPARER</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;PREPARER;NET4</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
@ -558,9 +558,13 @@ public static class Util
|
||||
//http://stevenhollidge.blogspot.com/2012/06/async-taskdelay.html
|
||||
public static Task Delay(int milliseconds)
|
||||
{
|
||||
#if NET4
|
||||
var tcs = new TaskCompletionSource<object>();
|
||||
new System.Threading.Timer(_ => tcs.SetResult(null)).Change(milliseconds, -1);
|
||||
return tcs.Task;
|
||||
#elif NET6_0_OR_GREATER
|
||||
return Task.Delay(milliseconds);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void LogPrint(string text, int type = 1)
|
||||
|
@ -74,6 +74,7 @@
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineConstants>TRACE;LAUNCHER;NOVETUS_APPS;NET4</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
|
@ -32,7 +32,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;URI;NOVETUS_APPS</DefineConstants>
|
||||
<DefineConstants>TRACE;URI;NOVETUS_APPS;NET4</DefineConstants>
|
||||
<ErrorReport>none</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
|
Loading…
Reference in New Issue
Block a user