mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Windows - Fix crash when clicking on update notification
Meta - Code cleanup
This commit is contained in:
1 parent
cdd814d920
commit
3994b49f08
36 files changed
+201
-193
No files matched your search
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Artemis.Core.Services;
|
||||
|
||||
internal class ProcessComparer : IEqualityComparer<Process>
|
||||
{
|
||||
public bool Equals(Process? x, Process? y)
|
||||
{
|
||||
if (x == null && y == null) return true;
|
||||
if (x == null || y == null) return false;
|
||||
return x.Id == y.Id && x.ProcessName == y.ProcessName && x.SessionId == y.SessionId;
|
||||
}
|
||||
|
||||
public int GetHashCode(Process? obj)
|
||||
{
|
||||
if (obj == null) return 0;
|
||||
return obj.Id;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using Artemis.Core.Modules;
|
||||
using Serilog;
|
||||
|
||||
namespace Artemis.Core.Services;
|
||||
|
||||
@@ -42,20 +41,4 @@ internal class ProcessMonitorService : IProcessMonitorService
|
||||
{
|
||||
return _lastScannedProcesses;
|
||||
}
|
||||
}
|
||||
|
||||
internal class ProcessComparer : IEqualityComparer<Process>
|
||||
{
|
||||
public bool Equals(Process? x, Process? y)
|
||||
{
|
||||
if (x == null && y == null) return true;
|
||||
if (x == null || y == null) return false;
|
||||
return x.Id == y.Id && x.ProcessName == y.ProcessName && x.SessionId == y.SessionId;
|
||||
}
|
||||
|
||||
public int GetHashCode(Process? obj)
|
||||
{
|
||||
if (obj == null) return 0;
|
||||
return obj.Id;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user