Initial commit: IBKRTrader

.NET WinForms-Anwendung (Core, Modules/CongressTrading, UI).
Enthaelt .gitignore und settings.example.json als Konfigurationsvorlage.
Echte settings.json mit Zugangsdaten ist bewusst ausgeschlossen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-07-26 18:19:47 +02:00
co-authored by Claude Opus 4.8
commit ebeb035e92
47 changed files with 4527 additions and 0 deletions
+77
View File
@@ -0,0 +1,77 @@
using System.ComponentModel;
using IBKRTrader.Core.Workers;
namespace IBKRTrader.UI;
/// <summary>
/// Richtet dgv_workerlist vollständig ein:
/// Spalten, Binding, Formatierung, Kontext-Menü.
/// </summary>
public static class WorkerListBindingSource
{
public static void Setup(DataGridView dgv, BindingList<WorkerInfo> source)
{
dgv.AutoGenerateColumns = false;
dgv.ReadOnly = false;
dgv.AllowUserToAddRows = false;
dgv.RowHeadersVisible = false;
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgv.MultiSelect = false;
// ── Spalten definieren ───────────────────────────────────────────────
dgv.Columns.Clear();
dgv.Columns.Add(new DataGridViewCheckBoxColumn
{
DataPropertyName = nameof(WorkerInfo.Active),
HeaderText = "Active",
Width = 65,
ReadOnly = false
});
dgv.Columns.Add(MakeTextColumn(nameof(WorkerInfo.Type), "Type", 80, false));
dgv.Columns.Add(MakeTextColumn(nameof(WorkerInfo.Module), "Module", 90, false));
dgv.Columns.Add(MakeTextColumn(nameof(WorkerInfo.WorkerName), "Worker Name", 180, false));
dgv.Columns.Add(new DataGridViewTextBoxColumn
{
DataPropertyName = nameof(WorkerInfo.LastRuntime),
HeaderText = "Last Runtime",
Width = 150,
ReadOnly = true,
DefaultCellStyle = { Format = "dd.MM.yyyy HH:mm:ss", NullValue = "" }
});
dgv.Columns.Add(new DataGridViewTextBoxColumn
{
DataPropertyName = nameof(WorkerInfo.NextRuntime),
HeaderText = "Next Runtime",
Width = 150,
ReadOnly = true,
DefaultCellStyle = { Format = "dd.MM.yyyy HH:mm:ss", NullValue = "" }
});
dgv.Columns.Add(MakeTextColumn(nameof(WorkerInfo.RunEvery), "Run Every", 90, false));
dgv.Columns.Add(MakeTextColumn(nameof(WorkerInfo.Info), "Info", 400, false));
// ── Binding ──────────────────────────────────────────────────────────
var bs = new BindingSource { DataSource = source };
dgv.DataSource = bs;
// ── Styling ──────────────────────────────────────────────────────────
dgv.EnableHeadersVisualStyles = false;
dgv.ColumnHeadersDefaultCellStyle.Font = new Font("Segoe UI", 9f, FontStyle.Bold);
dgv.DefaultCellStyle.Font = new Font("Segoe UI", 9f);
dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(240, 240, 255);
dgv.GridColor = Color.LightGray;
}
private static DataGridViewTextBoxColumn MakeTextColumn(
string prop, string header, int width, bool readOnly) => new()
{
DataPropertyName = prop,
HeaderText = header,
Width = width,
ReadOnly = readOnly
};
}