XML comments added Builds cleanly.

oddly a ignore in the gitignore went missing.
restored.
This commit is contained in:
Stan44 2025-05-11 21:50:25 -05:00
parent 8a6f9144c4
commit 0ae815cf2c
6 changed files with 266 additions and 182 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
# Ignore Build
.vscode/
/docfx_project
/src/AdvChkSys/bin
/src/AdvChkSys/obj

View File

@ -14,9 +14,24 @@ namespace AdvChkSys.Dependencies
/// </summary>
public enum DependencyType
{
/// <summary>
/// Indicates a neighboring chunk relationship.
/// </summary>
Neighbor,
/// <summary>
/// Indicates a reference relationship between chunks.
/// </summary>
Reference,
/// <summary>
/// Indicates an update relationship between chunks.
/// </summary>
Update,
/// <summary>
/// Indicates a custom dependency relationship.
/// </summary>
Custom
}

View File

@ -18,10 +18,29 @@ namespace AdvChkSys.Loading
/// </summary>
public enum Priority
{
/// <summary>
/// Immediate priority - process as soon as possible
/// </summary>
Immediate,
/// <summary>
/// High priority - process after immediate requests
/// </summary>
High,
/// <summary>
/// Normal priority - standard processing order
/// </summary>
Normal,
/// <summary>
/// Low priority - process after normal requests
/// </summary>
Low,
/// <summary>
/// Background priority - process when system is idle
/// </summary>
Background
}

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace AdvChkSys.Threading
{
@ -244,6 +244,14 @@ namespace AdvChkSys.Threading
/// </summary>
public double[] History { get; }
/// <summary>
///
/// </summary>
/// <param name="current"></param>
/// <param name="average"></param>
/// <param name="min"></param>
/// <param name="max"></param>
/// <param name="history"></param>
public PerformanceReport(double current, double average, double min, double max, double[] history)
{
Current = current;

View File

@ -35,8 +35,10 @@ namespace AdvChkSys.Util
private static ulong GetAvailableMemoryWindows()
{
var memStatus = new MEMORYSTATUSEX();
memStatus.dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX));
var memStatus = new MEMORYSTATUSEX
{
dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX))
};
if (GlobalMemoryStatusEx(ref memStatus))
{
return memStatus.ullAvailPhys;
@ -81,21 +83,61 @@ namespace AdvChkSys.Util
return 0;
}
/// <summary>
/// Structure containing memory status information for Windows systems.
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct MEMORYSTATUSEX
{
/// <summary>
/// The size of the structure, in bytes. You must set this member before calling GlobalMemoryStatusEx.
/// </summary>
public uint dwLength;
/// <summary>
/// A number between 0 and 100 that specifies the approximate percentage of physical memory
/// that is in use (0 indicates no memory use and 100 indicates full memory use).
/// </summary>
public uint dwMemoryLoad;
/// <summary>
/// The total size of physical memory, in bytes.
/// </summary>
public ulong ullTotalPhys;
/// <summary>
/// The amount of physical memory currently available, in bytes.
/// This is the amount of physical memory that can be immediately reused without having to write its contents to disk first.
/// </summary>
public ulong ullAvailPhys;
/// <summary>
/// The current committed memory limit for the system or the current process, whichever is smaller, in bytes.
/// </summary>
public ulong ullTotalPageFile;
/// <summary>
/// The maximum amount of memory the current process can commit, in bytes.
/// This value is equal to or smaller than the system-wide available commit value.
/// </summary>
public ulong ullAvailPageFile;
/// <summary>
/// The size of the user-mode portion of the virtual address space of the calling process, in bytes.
/// </summary>
public ulong ullTotalVirtual;
/// <summary>
/// The amount of unreserved and uncommitted memory currently in the user-mode portion
/// of the virtual address space of the calling process, in bytes.
/// </summary>
public ulong ullAvailVirtual;
/// <summary>
/// Reserved. This value is always 0.
/// </summary>
public ulong ullAvailExtendedVirtual;
}
/// <summary>
/// Retrieves information about the system's current usage of both physical and virtual memory.
/// </summary>
/// <param name="lpBuffer">A pointer to a <see cref="MEMORYSTATUSEX"/> structure that receives the memory status information.</param>
/// <returns>If the function succeeds, the return value is <c>true</c>. If the function fails, the return value is <c>false</c>.</returns>
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool GlobalMemoryStatusEx(ref MEMORYSTATUSEX lpBuffer);
}
}