GUI桌面环境

This commit is contained in:
2026-03-01 17:03:49 +08:00
parent 545f40cf95
commit f0a9223520
162 changed files with 9170 additions and 135 deletions

37
Logger/Log.cs Normal file
View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
namespace CMLeonOS.Logger
{
public static class Log
{
private static List<LogEntry> logs = new List<LogEntry>();
private static List<Action<LogEntry>> logEmittedReceivers = new List<Action<LogEntry>>();
public static List<LogEntry> Logs
{
get { return logs; }
}
public static List<Action<LogEntry>> LogEmittedReceivers
{
get { return logEmittedReceivers; }
}
public static void AddReceiver(Action<LogEntry> receiver)
{
logEmittedReceivers.Add(receiver);
}
public static void Emit(LogLevel level, string source, string message)
{
var entry = new LogEntry(level, source, message);
logs.Add(entry);
foreach (var receiver in logEmittedReceivers)
{
receiver(entry);
}
}
}
}

View File

@@ -8,6 +8,16 @@ namespace CMLeonOS.Logger
public LogLevel Level;
public string Source;
public string Message;
public LogLevel Priority
{
get { return Level; }
}
public DateTime Date
{
get { return Timestamp; }
}
public LogEntry(LogLevel level, string source, string message)
{