winmr-api/Models/ProcessInfo.cs

38 lines
1.2 KiB
C#
Raw Normal View History

2025-07-02 16:06:50 +03:00
// File: Models/ProcessInfo.cs
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
}