Das Suffix ".Avalonia" gab es nur, weil daneben ein WinForms-IBKRTrader.App
stand. Das ist seit L5 weg, also faellt auch das Suffix. Git erkennt alle
Dateien als Umbenennung; Assembly, Wurzel-Namensraum und die
avares://-Ressourcen-URI sind mitgezogen.
Nebeneffekt der Umbenennung: die global::Avalonia-Qualifizierungen entfallen.
Sie waren noetig, weil der Namensraum IBKRTrader.App.Avalonia das
Avalonia-Paket verdeckt hat - ein Ueberbleibsel genau der Namensgebung, die
jetzt weg ist.
Inhaltlich falsch gewordene Aussagen berichtigt - das waren die eigentlichen
Ueberbleibsel, nicht die Kommentare:
- .agents/rules/grundregeln.md schrieb weiterhin "C# .NET 10 WinForms",
RichTextBox-Logging, LauncherForm und PropertyGrid vor. Das ist die Regel,
nach der kuenftig gearbeitet wird - sie haette die Portierung Stueck fuer
Stueck rueckgaengig gemacht. Jetzt: Avalonia, keine Plattform-Suffixe, die
11er-Pinnung mit Begruendung, dazu die beiden Regeln, die uns in L1b am
meisten gekostet haben (UTC persistieren + AppTimeZone statt DateTime.Now;
jede Formatierung mit ausdruecklichem IFormatProvider).
- Core: LogEntry ("wird in RichTextBox geschrieben"), IWorker/WorkerEngine/
WorkerInfo ("DataGridView-Zeile"/"-Binding"), ModuleView ("die
WinForms-Shell castet auf Form").
- Doku: ARCHITECTURE (Modul-Ui-Ordner, "designbare Forms mit Initialize"),
KONZEPT-Modul-Accounting ("UI (WinForms, ein Fenster mit Tabs)").
BEWUSST STEHEN GEBLIEBEN sind die Kommentare, die WinForms nur als
Begruendung nennen - warum LoggingService ein Ereignis hat statt einer
RichTextBox, warum ModuleView Func<object> liefert, warum es benannte
Record-Zeilentypen gibt, warum die Einstellungsmaske aus Attributen entsteht.
Das ist die Herleitung des heutigen Entwurfs; ohne sie sieht spaeter jede
dieser Stellen nach Umstaendlichkeit ohne Grund aus.
KONZEPT-Linux-Portierung.md bekommt einen Statusvermerk: umgesetzt, die
Pfadangaben im Fundstellenverzeichnis beziehen sich auf den alten Aufbau.
Zwei Abweichungen von der Schaetzung sind dort festgehalten - der geringere
Aufwand dank der PolytraderSharp-Vorlage, und dass die dort empfohlene
InvariantGlobalization ein Fehler gewesen waere.
Verifiziert: Build 0 Fehler/0 Warnungen, 193 Tests gruen, Smoke-UI
konstruiert alle 7 Ansichten + Launcher + Dialog, Daemon-Prueflauf OK,
publish -r linux-x64 fuer beide Einstiegspunkte fehlerfrei.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
58 lines
2.6 KiB
C#
58 lines
2.6 KiB
C#
using System.ComponentModel;
|
||
using System.Runtime.CompilerServices;
|
||
|
||
namespace IBKRTrader.Core.Workers;
|
||
|
||
/// <summary>
|
||
/// ViewModel-Objekt für eine Zeile der Workers-Ansicht.
|
||
/// Implementiert INotifyPropertyChanged, damit die Oberfläche Änderungen ohne Zutun übernimmt.
|
||
/// </summary>
|
||
public class WorkerInfo : INotifyPropertyChanged
|
||
{
|
||
public event PropertyChangedEventHandler? PropertyChanged;
|
||
|
||
private bool _active;
|
||
private string _type = "";
|
||
private string _module = "";
|
||
private string _workerName = "";
|
||
private DateTime? _lastRuntime;
|
||
private DateTime? _nextRuntime;
|
||
private string _runEvery = "";
|
||
private string _info = "";
|
||
private WorkerStatus _status = WorkerStatus.Idle;
|
||
|
||
// ─── Properties ───────────────────────────────────────────────────────────
|
||
|
||
public bool Active { get => _active; set => Set(ref _active, value); }
|
||
public string Type { get => _type; set => Set(ref _type, value); }
|
||
public string Module { get => _module; set => Set(ref _module, value); }
|
||
public string WorkerName { get => _workerName; set => Set(ref _workerName, value); }
|
||
public DateTime? LastRuntime { get => _lastRuntime; set => Set(ref _lastRuntime, value); }
|
||
public DateTime? NextRuntime { get => _nextRuntime; set => Set(ref _nextRuntime, value); }
|
||
public string RunEvery { get => _runEvery; set => Set(ref _runEvery, value); }
|
||
public string Info { get => _info; set => Set(ref _info, value); }
|
||
|
||
/// <summary>Interner Status – keine eigene Spalte, steuert aber den Info-Text.</summary>
|
||
public WorkerStatus Status
|
||
{
|
||
get => _status;
|
||
set
|
||
{
|
||
if (!Set(ref _status, value)) return;
|
||
// Info-Text automatisch synchronisieren
|
||
if (value == WorkerStatus.Idle && string.IsNullOrWhiteSpace(_info))
|
||
Info = "Bereit";
|
||
}
|
||
}
|
||
|
||
// ─── Hilfsmethode ─────────────────────────────────────────────────────────
|
||
|
||
private bool Set<T>(ref T field, T value, [CallerMemberName] string? prop = null)
|
||
{
|
||
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
|
||
field = value;
|
||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
|
||
return true;
|
||
}
|
||
}
|