Remove support for SystemEvents.TimeChanged

This causes excessive delay during ASF shutdown on Windows, and because it's completely optional for irrelevant feature, it's not worth the burden
This commit is contained in:
Archi 2021-09-02 13:45:56 +02:00
parent ca03d68eb5
commit 4935ec3187
No known key found for this signature in database
GPG key ID: 6B138B4C64555AEA
4 changed files with 0 additions and 22 deletions

View file

@ -25,7 +25,6 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net48' AND ('$(TargetGeneric)' == 'true' OR '$(TargetWindows)' == 'true')">
<PackageReference Include="Microsoft.Win32.SystemEvents" />
<PackageReference Include="System.IO.FileSystem.AccessControl" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
</ItemGroup>

View file

@ -73,13 +73,5 @@ namespace ArchiSteamFarm.Core {
Timer.Change(dueTime, Timeout.Infinite);
}
}
#if TARGET_GENERIC || TARGET_WINDOWS
internal static void OnTimeChanged(object? sender, EventArgs e) {
lock (LockObject) {
Timer.Change(TimeSpan.Zero, Timeout.InfiniteTimeSpan);
}
}
#endif
}
}

View file

@ -19,12 +19,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#if NETFRAMEWORK
using OperatingSystem = JustArchiNET.Madness.OperatingSystemMadness.OperatingSystem;
#endif
#if TARGET_GENERIC || TARGET_WINDOWS
using Microsoft.Win32;
#endif
using System;
using System.Collections;
using System.Collections.Generic;
@ -275,12 +269,6 @@ namespace ArchiSteamFarm {
} else {
// April Fools easter egg logic
AprilFools.Init();
#if TARGET_GENERIC || TARGET_WINDOWS
if (OperatingSystem.IsWindows()) {
SystemEvents.TimeChanged += AprilFools.OnTimeChanged;
}
#endif
}
if (!string.IsNullOrEmpty(latestJson)) {

View file

@ -22,7 +22,6 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net48' AND ('$(TargetGeneric)' == 'true' OR '$(TargetWindows)' == 'true')">
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="5.0.0" />
<PackageVersion Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="5.0.0" />
</ItemGroup>