winmr-api/Models/ProcessInfo.cs

39 lines
1.3 KiB
C#
Raw Normal View History

2025-07-04 00:04:51 +03:00
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright <20> 2024-2025 Gregory Lirent */
2025-07-02 16:06:50 +03:00
using System.Runtime.Versioning;
using System.Text.Json.Serialization;
2025-07-03 15:22:40 +03:00
using WebmrAPI.Utils;
2025-06-30 18:15:07 +03:00
namespace WebmrAPI.Models
{
2025-07-02 16:06:50 +03:00
[SupportedOSPlatform("windows")]
public class ProcessInfo : ProcessBaseInfo
2025-06-30 18:15:07 +03:00
{
2025-07-02 16:06:50 +03:00
[JsonIgnore]
2025-07-03 15:22:40 +03:00
public LazyConcurrentContainer<MemoryRegionInfo> MemoryRegionsContainer { get; set; } = new();
[JsonIgnore]
public LazyConcurrentContainer<ProcessModuleInfo> ModulesContainer { get; set; } = new();
[JsonIgnore]
public LazyConcurrentContainer<ProcessThreadInfo> ThreadsContainer { get; set; } = new();
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IEnumerable<MemoryRegionInfo>? MemoryRegions
2025-07-02 16:06:50 +03:00
{
2025-07-03 15:22:40 +03:00
get => MemoryRegionsContainer.Values;
2025-07-02 16:06:50 +03:00
}
2025-07-03 15:22:40 +03:00
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IEnumerable<ProcessModuleInfo>? Modules
{
get => ModulesContainer.Values;
}
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IEnumerable<ProcessThreadInfo>? Threads
2025-07-02 16:06:50 +03:00
{
2025-07-03 15:22:40 +03:00
get => ThreadsContainer.Values;
2025-07-02 16:06:50 +03:00
}
2025-06-30 18:15:07 +03:00
}
2025-07-02 16:06:50 +03:00
}