mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-05 23:41:28 +02:00
Reorganize project structure
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using RemSox.Kernel.Processes;
|
||||
|
||||
namespace RemSox.Kernel.Processing;
|
||||
|
||||
public static class ProcessManifest
|
||||
{
|
||||
[Flags]
|
||||
public enum ProcessManifestFlags
|
||||
{
|
||||
None = 0,
|
||||
Singleton = 1 << 0,
|
||||
System = 1 << 1
|
||||
}
|
||||
|
||||
private static readonly Dictionary<Type, ProcessManifestFlags> map = new()
|
||||
{
|
||||
{ typeof(DesktopProcess), ProcessManifestFlags.Singleton | ProcessManifestFlags.System },
|
||||
{ typeof(CliProcess), ProcessManifestFlags.Singleton | ProcessManifestFlags.System },
|
||||
{ typeof(RemoteDesktopProcess), ProcessManifestFlags.Singleton }
|
||||
};
|
||||
|
||||
public static bool HasFlag<T>(ProcessManifestFlags flag) where T : Process
|
||||
{
|
||||
return map.TryGetValue(typeof(T), out ProcessManifestFlags flags) && flags.HasFlag(flag);
|
||||
}
|
||||
|
||||
public static bool HasFlag(Type t, ProcessManifestFlags flag)
|
||||
{
|
||||
return map.TryGetValue(t, out ProcessManifestFlags flags) && flags.HasFlag(flag);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user