Copytrading-UI: ein Fenster mit TabControl statt drei Launcher-Buttons
Statt je Ansicht ein eigenes Fenster (3 Launcher-Buttons) gibt es jetzt EIN Modul-Fenster mit Tabs – wie im alten PolyTrader. Skaliert sauber, wenn weitere Module dazukommen (ein Button je Modul). - MasterTradersView/ClosedTradesView/AccountSettingsView: von Form -> UserControl (Tab-Inhalte); Designer-Root auf Size statt ClientSize/Text/MinimumSize. - Neu: CopyTradingMainForm (Designer) mit TabControl + 3 TabPages, hostet die drei UserControls; Initialize(IServiceProvider) versorgt jeden Tab per DI. - CopyTradingModule.RegisterUi registriert nur noch EINE View "Copytrading". Verifiziert: Build grün, --smoke-ui grün (eine View copytrading.main + Launcher konstruieren fehlerfrei, 3 Accounts / 32 Trader hydriert). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
76007db93f
commit
c3d7e41e62
@@ -56,54 +56,20 @@ namespace PolyTrader.Modules.CopyTrading
|
||||
|
||||
public void RegisterUi(IModuleUiHost host, IServiceProvider services)
|
||||
{
|
||||
// EIN Fenster fürs ganze Modul: die einzelnen Ansichten sind Tabs im
|
||||
// CopyTradingMainForm (Master-Trader / geschlossene Trades / Account-Einstellungen).
|
||||
// So bleibt der Launcher schlank – ein Button je Modul statt je View.
|
||||
host.RegisterView(new ModuleView
|
||||
{
|
||||
Id = "copytrading.masters",
|
||||
Title = "Master-Trader",
|
||||
Id = "copytrading.main",
|
||||
Title = "Copytrading",
|
||||
Group = "CopyTrading",
|
||||
Order = 100,
|
||||
CreateForm = () =>
|
||||
{
|
||||
var view = new MasterTradersView();
|
||||
view.Initialize(
|
||||
services.GetRequiredService<ITrackedTraderRepository>(),
|
||||
services.GetRequiredService<TradingState>(),
|
||||
services.GetRequiredService<CopyTradingState>());
|
||||
return view;
|
||||
}
|
||||
});
|
||||
|
||||
host.RegisterView(new ModuleView
|
||||
{
|
||||
Id = "copytrading.closedtrades",
|
||||
Title = "Geschlossene Copytrades",
|
||||
Group = "CopyTrading",
|
||||
Order = 110,
|
||||
CreateForm = () =>
|
||||
{
|
||||
var view = new ClosedTradesView();
|
||||
view.Initialize(
|
||||
services.GetRequiredService<ICopyTradeLogRepository>(),
|
||||
services.GetRequiredService<TradingState>(),
|
||||
services.GetRequiredService<CopyTradingState>());
|
||||
return view;
|
||||
}
|
||||
});
|
||||
|
||||
host.RegisterView(new ModuleView
|
||||
{
|
||||
Id = "copytrading.accountsettings",
|
||||
Title = "Copytrading-Account-Einstellungen",
|
||||
Group = "CopyTrading",
|
||||
Order = 120,
|
||||
CreateForm = () =>
|
||||
{
|
||||
var view = new AccountSettingsView();
|
||||
view.Initialize(
|
||||
services.GetRequiredService<ICopyTradingAccountSettingsRepository>(),
|
||||
services.GetRequiredService<TradingState>(),
|
||||
services.GetRequiredService<CopyTradingState>());
|
||||
return view;
|
||||
var form = new CopyTradingMainForm();
|
||||
form.Initialize(services);
|
||||
return form;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,102 +17,108 @@ namespace PolyTrader.Modules.CopyTrading.Ui
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pnlTop = new System.Windows.Forms.Panel();
|
||||
this.cmbAccounts = new System.Windows.Forms.ComboBox();
|
||||
this.lblAccount = new System.Windows.Forms.Label();
|
||||
this.pgSettings = new System.Windows.Forms.PropertyGrid();
|
||||
this.pnlBottom = new System.Windows.Forms.Panel();
|
||||
this.lblHint = new System.Windows.Forms.Label();
|
||||
this.btnSave = new System.Windows.Forms.Button();
|
||||
this.pnlTop.SuspendLayout();
|
||||
this.pnlBottom.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
pnlTop = new Panel();
|
||||
cmbAccounts = new ComboBox();
|
||||
lblAccount = new Label();
|
||||
pgSettings = new PropertyGrid();
|
||||
pnlBottom = new Panel();
|
||||
lblHint = new Label();
|
||||
btnSave = new Button();
|
||||
pnlTop.SuspendLayout();
|
||||
pnlBottom.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// pnlTop
|
||||
//
|
||||
this.pnlTop.Controls.Add(this.cmbAccounts);
|
||||
this.pnlTop.Controls.Add(this.lblAccount);
|
||||
this.pnlTop.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.pnlTop.Location = new System.Drawing.Point(0, 0);
|
||||
this.pnlTop.Name = "pnlTop";
|
||||
this.pnlTop.Padding = new System.Windows.Forms.Padding(8, 8, 8, 6);
|
||||
this.pnlTop.Size = new System.Drawing.Size(560, 44);
|
||||
this.pnlTop.TabIndex = 0;
|
||||
//
|
||||
//
|
||||
pnlTop.Controls.Add(cmbAccounts);
|
||||
pnlTop.Controls.Add(lblAccount);
|
||||
pnlTop.Dock = DockStyle.Top;
|
||||
pnlTop.Location = new Point(0, 0);
|
||||
pnlTop.Margin = new Padding(4, 5, 4, 5);
|
||||
pnlTop.Name = "pnlTop";
|
||||
pnlTop.Padding = new Padding(11, 13, 11, 10);
|
||||
pnlTop.Size = new Size(800, 73);
|
||||
pnlTop.TabIndex = 0;
|
||||
//
|
||||
// cmbAccounts
|
||||
//
|
||||
this.cmbAccounts.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.cmbAccounts.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbAccounts.Location = new System.Drawing.Point(68, 8);
|
||||
this.cmbAccounts.Name = "cmbAccounts";
|
||||
this.cmbAccounts.Size = new System.Drawing.Size(484, 23);
|
||||
this.cmbAccounts.TabIndex = 1;
|
||||
//
|
||||
//
|
||||
cmbAccounts.Dock = DockStyle.Fill;
|
||||
cmbAccounts.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cmbAccounts.Location = new Point(97, 13);
|
||||
cmbAccounts.Margin = new Padding(4, 5, 4, 5);
|
||||
cmbAccounts.Name = "cmbAccounts";
|
||||
cmbAccounts.Size = new Size(692, 33);
|
||||
cmbAccounts.TabIndex = 1;
|
||||
//
|
||||
// lblAccount
|
||||
//
|
||||
this.lblAccount.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.lblAccount.Location = new System.Drawing.Point(8, 8);
|
||||
this.lblAccount.Name = "lblAccount";
|
||||
this.lblAccount.Size = new System.Drawing.Size(60, 30);
|
||||
this.lblAccount.TabIndex = 0;
|
||||
this.lblAccount.Text = "Account:";
|
||||
this.lblAccount.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
//
|
||||
lblAccount.Dock = DockStyle.Left;
|
||||
lblAccount.Location = new Point(11, 13);
|
||||
lblAccount.Margin = new Padding(4, 0, 4, 0);
|
||||
lblAccount.Name = "lblAccount";
|
||||
lblAccount.Size = new Size(86, 50);
|
||||
lblAccount.TabIndex = 0;
|
||||
lblAccount.Text = "Account:";
|
||||
lblAccount.TextAlign = ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// pgSettings
|
||||
//
|
||||
this.pgSettings.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pgSettings.Location = new System.Drawing.Point(0, 44);
|
||||
this.pgSettings.Name = "pgSettings";
|
||||
this.pgSettings.PropertySort = System.Windows.Forms.PropertySort.Categorized;
|
||||
this.pgSettings.Size = new System.Drawing.Size(560, 508);
|
||||
this.pgSettings.TabIndex = 1;
|
||||
this.pgSettings.ToolbarVisible = false;
|
||||
//
|
||||
//
|
||||
pgSettings.Dock = DockStyle.Fill;
|
||||
pgSettings.Location = new Point(0, 73);
|
||||
pgSettings.Margin = new Padding(4, 5, 4, 5);
|
||||
pgSettings.Name = "pgSettings";
|
||||
pgSettings.PropertySort = PropertySort.Categorized;
|
||||
pgSettings.Size = new Size(800, 847);
|
||||
pgSettings.TabIndex = 1;
|
||||
pgSettings.ToolbarVisible = false;
|
||||
//
|
||||
// pnlBottom
|
||||
//
|
||||
this.pnlBottom.Controls.Add(this.lblHint);
|
||||
this.pnlBottom.Controls.Add(this.btnSave);
|
||||
this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pnlBottom.Location = new System.Drawing.Point(0, 552);
|
||||
this.pnlBottom.Name = "pnlBottom";
|
||||
this.pnlBottom.Padding = new System.Windows.Forms.Padding(8);
|
||||
this.pnlBottom.Size = new System.Drawing.Size(560, 48);
|
||||
this.pnlBottom.TabIndex = 2;
|
||||
//
|
||||
//
|
||||
pnlBottom.Controls.Add(lblHint);
|
||||
pnlBottom.Controls.Add(btnSave);
|
||||
pnlBottom.Dock = DockStyle.Bottom;
|
||||
pnlBottom.Location = new Point(0, 920);
|
||||
pnlBottom.Margin = new Padding(4, 5, 4, 5);
|
||||
pnlBottom.Name = "pnlBottom";
|
||||
pnlBottom.Padding = new Padding(11, 13, 11, 13);
|
||||
pnlBottom.Size = new Size(800, 80);
|
||||
pnlBottom.TabIndex = 2;
|
||||
//
|
||||
// lblHint
|
||||
//
|
||||
this.lblHint.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblHint.ForeColor = System.Drawing.Color.DimGray;
|
||||
this.lblHint.Location = new System.Drawing.Point(8, 8);
|
||||
this.lblHint.Name = "lblHint";
|
||||
this.lblHint.Size = new System.Drawing.Size(424, 32);
|
||||
this.lblHint.TabIndex = 1;
|
||||
this.lblHint.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
//
|
||||
lblHint.Dock = DockStyle.Fill;
|
||||
lblHint.ForeColor = Color.DimGray;
|
||||
lblHint.Location = new Point(11, 13);
|
||||
lblHint.Margin = new Padding(4, 0, 4, 0);
|
||||
lblHint.Name = "lblHint";
|
||||
lblHint.Size = new Size(607, 54);
|
||||
lblHint.TabIndex = 1;
|
||||
lblHint.TextAlign = ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
this.btnSave.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btnSave.Location = new System.Drawing.Point(432, 8);
|
||||
this.btnSave.Name = "btnSave";
|
||||
this.btnSave.Size = new System.Drawing.Size(120, 32);
|
||||
this.btnSave.TabIndex = 0;
|
||||
this.btnSave.Text = "Speichern";
|
||||
this.btnSave.UseVisualStyleBackColor = true;
|
||||
//
|
||||
//
|
||||
btnSave.Dock = DockStyle.Right;
|
||||
btnSave.Location = new Point(618, 13);
|
||||
btnSave.Margin = new Padding(4, 5, 4, 5);
|
||||
btnSave.Name = "btnSave";
|
||||
btnSave.Size = new Size(171, 54);
|
||||
btnSave.TabIndex = 0;
|
||||
btnSave.Text = "Speichern";
|
||||
btnSave.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// AccountSettingsView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(560, 600);
|
||||
this.Controls.Add(this.pgSettings);
|
||||
this.Controls.Add(this.pnlBottom);
|
||||
this.Controls.Add(this.pnlTop);
|
||||
this.MinimumSize = new System.Drawing.Size(420, 400);
|
||||
this.Name = "AccountSettingsView";
|
||||
this.Text = "Copytrading-Account-Einstellungen";
|
||||
this.pnlTop.ResumeLayout(false);
|
||||
this.pnlBottom.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(10F, 25F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Controls.Add(pgSettings);
|
||||
Controls.Add(pnlBottom);
|
||||
Controls.Add(pnlTop);
|
||||
Margin = new Padding(4, 5, 4, 5);
|
||||
Name = "AccountSettingsView";
|
||||
Size = new Size(800, 1000);
|
||||
pnlTop.ResumeLayout(false);
|
||||
pnlBottom.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PolyTrader.Modules.CopyTrading.Ui
|
||||
/// das Repo und aktualisiert den Hot-Path-State (<see cref="CopyTradingState.AccountSettings"/>).
|
||||
/// Layout im Designer (AccountSettingsView.Designer.cs), Daten/Logik hier.
|
||||
/// </summary>
|
||||
public partial class AccountSettingsView : Form
|
||||
public partial class AccountSettingsView : UserControl
|
||||
{
|
||||
private ICopyTradingAccountSettingsRepository? _repo;
|
||||
private TradingState? _state;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
@@ -203,12 +203,10 @@ namespace PolyTrader.Modules.CopyTrading.Ui
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1100, 600);
|
||||
this.Controls.Add(this.dgvTrades);
|
||||
this.Controls.Add(this.pnlTop);
|
||||
this.MinimumSize = new System.Drawing.Size(700, 400);
|
||||
this.Name = "ClosedTradesView";
|
||||
this.Text = "Geschlossene Copytrades";
|
||||
this.Size = new System.Drawing.Size(1100, 600);
|
||||
this.pnlTop.ResumeLayout(false);
|
||||
this.pnlTop.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvTrades)).EndInit();
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PolyTrader.Modules.CopyTrading.Ui
|
||||
/// aufgelösten Account-/Master-Trader-Namen und einer Kurzauswertung.
|
||||
/// Layout im Designer (ClosedTradesView.Designer.cs), Daten/Logik hier.
|
||||
/// </summary>
|
||||
public partial class ClosedTradesView : Form
|
||||
public partial class ClosedTradesView : UserControl
|
||||
{
|
||||
private ICopyTradeLogRepository? _tradeLog;
|
||||
private TradingState? _state;
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
namespace PolyTrader.Modules.CopyTrading.Ui
|
||||
{
|
||||
partial class CopyTradingMainForm
|
||||
{
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Vom Komponenten-Designer generierter Code
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tabControl = new System.Windows.Forms.TabControl();
|
||||
this.tabMasters = new System.Windows.Forms.TabPage();
|
||||
this.tabClosed = new System.Windows.Forms.TabPage();
|
||||
this.tabSettings = new System.Windows.Forms.TabPage();
|
||||
this.masterTradersView = new PolyTrader.Modules.CopyTrading.Ui.MasterTradersView();
|
||||
this.closedTradesView = new PolyTrader.Modules.CopyTrading.Ui.ClosedTradesView();
|
||||
this.accountSettingsView = new PolyTrader.Modules.CopyTrading.Ui.AccountSettingsView();
|
||||
this.tabControl.SuspendLayout();
|
||||
this.tabMasters.SuspendLayout();
|
||||
this.tabClosed.SuspendLayout();
|
||||
this.tabSettings.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabControl
|
||||
//
|
||||
this.tabControl.Controls.Add(this.tabMasters);
|
||||
this.tabControl.Controls.Add(this.tabClosed);
|
||||
this.tabControl.Controls.Add(this.tabSettings);
|
||||
this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabControl.Name = "tabControl";
|
||||
this.tabControl.SelectedIndex = 0;
|
||||
this.tabControl.Size = new System.Drawing.Size(1200, 700);
|
||||
this.tabControl.TabIndex = 0;
|
||||
//
|
||||
// tabMasters
|
||||
//
|
||||
this.tabMasters.Controls.Add(this.masterTradersView);
|
||||
this.tabMasters.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabMasters.Name = "tabMasters";
|
||||
this.tabMasters.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabMasters.Size = new System.Drawing.Size(1192, 672);
|
||||
this.tabMasters.TabIndex = 0;
|
||||
this.tabMasters.Text = "Master-Trader";
|
||||
this.tabMasters.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabClosed
|
||||
//
|
||||
this.tabClosed.Controls.Add(this.closedTradesView);
|
||||
this.tabClosed.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabClosed.Name = "tabClosed";
|
||||
this.tabClosed.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabClosed.Size = new System.Drawing.Size(1192, 672);
|
||||
this.tabClosed.TabIndex = 1;
|
||||
this.tabClosed.Text = "Geschlossene Trades";
|
||||
this.tabClosed.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabSettings
|
||||
//
|
||||
this.tabSettings.Controls.Add(this.accountSettingsView);
|
||||
this.tabSettings.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabSettings.Name = "tabSettings";
|
||||
this.tabSettings.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabSettings.Size = new System.Drawing.Size(1192, 672);
|
||||
this.tabSettings.TabIndex = 2;
|
||||
this.tabSettings.Text = "Account-Einstellungen";
|
||||
this.tabSettings.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// masterTradersView
|
||||
//
|
||||
this.masterTradersView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.masterTradersView.Location = new System.Drawing.Point(3, 3);
|
||||
this.masterTradersView.Name = "masterTradersView";
|
||||
this.masterTradersView.Size = new System.Drawing.Size(1186, 666);
|
||||
this.masterTradersView.TabIndex = 0;
|
||||
//
|
||||
// closedTradesView
|
||||
//
|
||||
this.closedTradesView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.closedTradesView.Location = new System.Drawing.Point(3, 3);
|
||||
this.closedTradesView.Name = "closedTradesView";
|
||||
this.closedTradesView.Size = new System.Drawing.Size(1186, 666);
|
||||
this.closedTradesView.TabIndex = 0;
|
||||
//
|
||||
// accountSettingsView
|
||||
//
|
||||
this.accountSettingsView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.accountSettingsView.Location = new System.Drawing.Point(3, 3);
|
||||
this.accountSettingsView.Name = "accountSettingsView";
|
||||
this.accountSettingsView.Size = new System.Drawing.Size(1186, 666);
|
||||
this.accountSettingsView.TabIndex = 0;
|
||||
//
|
||||
// CopyTradingMainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1200, 700);
|
||||
this.Controls.Add(this.tabControl);
|
||||
this.MinimumSize = new System.Drawing.Size(820, 480);
|
||||
this.Name = "CopyTradingMainForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Copytrading";
|
||||
this.tabControl.ResumeLayout(false);
|
||||
this.tabMasters.ResumeLayout(false);
|
||||
this.tabClosed.ResumeLayout(false);
|
||||
this.tabSettings.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TabControl tabControl;
|
||||
private System.Windows.Forms.TabPage tabMasters;
|
||||
private System.Windows.Forms.TabPage tabClosed;
|
||||
private System.Windows.Forms.TabPage tabSettings;
|
||||
private MasterTradersView masterTradersView;
|
||||
private ClosedTradesView closedTradesView;
|
||||
private AccountSettingsView accountSettingsView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PolyTrader.Modules.CopyTrading.Persistence;
|
||||
using PolyTraderSharp;
|
||||
|
||||
namespace PolyTrader.Modules.CopyTrading.Ui
|
||||
{
|
||||
/// <summary>
|
||||
/// Das Hauptfenster des Copytrading-Moduls. Bündelt alle Modul-Ansichten in einem
|
||||
/// TabControl (Master-Trader, geschlossene Trades, Account-Einstellungen), sodass der
|
||||
/// Launcher nur EINEN "Copytrading"-Button braucht und nicht je View ein eigenes Fenster
|
||||
/// öffnet. Layout im Designer (CopyTradingMainForm.Designer.cs).
|
||||
/// </summary>
|
||||
public partial class CopyTradingMainForm : Form
|
||||
{
|
||||
// Parameterloser Konstruktor für den WinForms-Designer.
|
||||
public CopyTradingMainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>Versorgt die einzelnen Tab-Ansichten mit ihren Abhängigkeiten (aus dem DI-Container).</summary>
|
||||
public void Initialize(IServiceProvider services)
|
||||
{
|
||||
var state = services.GetRequiredService<TradingState>();
|
||||
var copyState = services.GetRequiredService<CopyTradingState>();
|
||||
|
||||
masterTradersView.Initialize(
|
||||
services.GetRequiredService<ITrackedTraderRepository>(), state, copyState);
|
||||
|
||||
closedTradesView.Initialize(
|
||||
services.GetRequiredService<ICopyTradeLogRepository>(), state, copyState);
|
||||
|
||||
accountSettingsView.Initialize(
|
||||
services.GetRequiredService<ICopyTradingAccountSettingsRepository>(), state, copyState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,15 +258,13 @@ namespace PolyTrader.Modules.CopyTrading.Ui
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1180, 640);
|
||||
this.Controls.Add(this.grid);
|
||||
this.Controls.Add(this.splitter);
|
||||
this.Controls.Add(this.rightPanel);
|
||||
this.Controls.Add(this.statusPanel);
|
||||
this.Controls.Add(this.toolbar);
|
||||
this.MinimumSize = new System.Drawing.Size(820, 460);
|
||||
this.Name = "MasterTradersView";
|
||||
this.Text = "Master-Trader";
|
||||
this.Size = new System.Drawing.Size(1180, 640);
|
||||
this.toolbar.ResumeLayout(false);
|
||||
this.toolbar.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit();
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace PolyTrader.Modules.CopyTrading.Ui
|
||||
/// (<see cref="CopyTradingState.Traders"/>) synchron.
|
||||
/// Layout im Designer (MasterTradersView.Designer.cs), Daten/Logik hier.
|
||||
/// </summary>
|
||||
public partial class MasterTradersView : Form
|
||||
public partial class MasterTradersView : UserControl
|
||||
{
|
||||
private ITrackedTraderRepository? _repo;
|
||||
private TradingState? _state;
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user