diff --git a/.gitignore b/.gitignore
index d6920f3b9..5ccb5a940 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
-/Avalonia_Apps/AA21_Buttons/AA21_Buttons/*.user
.vs
+bin
+obj
+*.bak
+*.user
diff --git a/CSharpBible/CharGrid/CharGrid.csproj b/CSharpBible/CharGrid/CharGrid.csproj
index e4ab464f1..7e8c47fb8 100644
--- a/CSharpBible/CharGrid/CharGrid.csproj
+++ b/CSharpBible/CharGrid/CharGrid.csproj
@@ -1,92 +1,22 @@
-
-
-
- Debug
- AnyCPU
- {C9207149-1178-4D9E-818E-36C4DA31047C}
- WinExe
- CSharpBible.CharGrid
- CharGrid
- ..\..\bin\$(MSBuildProjectName)\
- ..\..\obj\$(MSBuildProjectName)\
- ..\..\obj\$(MSBuildProjectName)\
- v4.7.2
- 512
- true
- true
-
-
-
- AnyCPU
- true
- full
- false
- ..\..\bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- ..\..\bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Form
-
-
- FrmCharGridMain.cs
-
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
- True
-
-
- FrmCharGridMain.cs
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
-
-
-
-
-
+
+
+
+ WinExe
+ AnyCPU
+ {C9207149-1178-4D9E-818E-36C4DA31047C}
+ CSharpBible.CharGrid
+ net8.0-windows
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CSharpBible/CharGrid/Program.cs b/CSharpBible/CharGrid/Program.cs
index 78722a718..ec2f5c970 100644
--- a/CSharpBible/CharGrid/Program.cs
+++ b/CSharpBible/CharGrid/Program.cs
@@ -1,36 +1,37 @@
// ***********************************************************************
-// Assembly : CharGrid
-// Author : Mir
-// Created : 12-19-2021
+// Assembly : CharGrid
+// Author : Mir
+// Created :12-19-2021
//
-// Last Modified By : Mir
-// Last Modified On : 02-29-2020
-// ***********************************************************************
-//
-// Copyright © JC-Soft 2020
-//
-//
+// Last Modified By : GitHub Copilot
+// Last Modified On :2025-11-05
// ***********************************************************************
using System;
using System.Windows.Forms;
-using CSharpBible.CharGrid.Visual;
+using CSharpBible.CharGrid.Views;
+using CSharpBible.CharGrid.Services;
+using CSharpBible.CharGrid.ViewModels.Interfaces;
+using CSharpBible.CharGrid.ViewModels;
+using Microsoft.Extensions.DependencyInjection;
namespace CSharpBible.CharGrid
{
- ///
- /// Class Program.
- ///
static class Program
{
- ///
- /// Der Haupteinstiegspunkt für die Anwendung.
- ///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new FrmCharGridMain());
+
+ var services = new ServiceCollection()
+ .AddSingleton()
+ .AddSingleton()
+ .AddTransient()
+ .AddTransient()
+ .BuildServiceProvider();
+
+ Application.Run(services.GetRequiredService());
}
}
}
diff --git a/CSharpBible/CharGrid/Properties/AssemblyInfo.cs b/CSharpBible/CharGrid/Properties/AssemblyInfo.cs
index 2febf5445..0308a676b 100644
--- a/CSharpBible/CharGrid/Properties/AssemblyInfo.cs
+++ b/CSharpBible/CharGrid/Properties/AssemblyInfo.cs
@@ -17,12 +17,7 @@
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
-[assembly: AssemblyTitle("CharGrid")]
[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("JC-Soft")]
-[assembly: AssemblyProduct("CharGrid")]
-[assembly: AssemblyCopyright("Copyright © JC-Soft 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -44,5 +39,3 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/CSharpBible/CharGrid/Properties/Resources.Designer.cs b/CSharpBible/CharGrid/Properties/Resources.Designer.cs
index e150e90bb..8a45b64cf 100644
--- a/CSharpBible/CharGrid/Properties/Resources.Designer.cs
+++ b/CSharpBible/CharGrid/Properties/Resources.Designer.cs
@@ -20,7 +20,7 @@ namespace CSharpBible.CharGrid.Properties {
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
///
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
- // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
+ // -Klasse über ein Tool wie ResGen oder Views Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
diff --git a/CSharpBible/CharGrid/Services/ICharGridProvider.cs b/CSharpBible/CharGrid/Services/ICharGridProvider.cs
new file mode 100644
index 000000000..32d5789cd
--- /dev/null
+++ b/CSharpBible/CharGrid/Services/ICharGridProvider.cs
@@ -0,0 +1,9 @@
+namespace CSharpBible.CharGrid.Services;
+
+public interface ICharGridProvider
+{
+ int Rows { get; }
+ int Columns { get; }
+ char GetChar(int row, int column);
+ void SetChar(int row, int column, char value);
+}
diff --git a/CSharpBible/CharGrid/Services/IRandomCharService.cs b/CSharpBible/CharGrid/Services/IRandomCharService.cs
new file mode 100644
index 000000000..d65564e38
--- /dev/null
+++ b/CSharpBible/CharGrid/Services/IRandomCharService.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace CSharpBible.CharGrid.Services
+{
+ public interface IRandomCharService
+ {
+ char NextChar();
+ }
+}
diff --git a/CSharpBible/CharGrid/Services/InMemoryCharGridProvider.cs b/CSharpBible/CharGrid/Services/InMemoryCharGridProvider.cs
new file mode 100644
index 000000000..56c2b4f46
--- /dev/null
+++ b/CSharpBible/CharGrid/Services/InMemoryCharGridProvider.cs
@@ -0,0 +1,25 @@
+using System;
+
+namespace CSharpBible.CharGrid.Services
+{
+ public class InMemoryCharGridProvider : ICharGridProvider
+ {
+ private readonly char[,] _grid;
+ public int Rows { get; }
+ public int Columns { get; }
+
+ public InMemoryCharGridProvider(int rows = 16, int columns = 32, IRandomCharService random = null)
+ {
+ Rows = rows;
+ Columns = columns;
+ _grid = new char[rows, columns];
+ var rnd = random ?? new RandomCharService();
+ for (int r = 0; r < rows; r++)
+ for (int c = 0; c < columns; c++)
+ _grid[r, c] = rnd.NextChar();
+ }
+
+ public char GetChar(int row, int column) => _grid[row, column];
+ public void SetChar(int row, int column, char value) => _grid[row, column] = value;
+ }
+}
diff --git a/CSharpBible/CharGrid/Services/RandomCharService.cs b/CSharpBible/CharGrid/Services/RandomCharService.cs
new file mode 100644
index 000000000..f253335ae
--- /dev/null
+++ b/CSharpBible/CharGrid/Services/RandomCharService.cs
@@ -0,0 +1,14 @@
+using System;
+
+namespace CSharpBible.CharGrid.Services
+{
+ public class RandomCharService : IRandomCharService
+ {
+ private readonly Random _rnd = new Random();
+ public char NextChar()
+ {
+ // ASCII uppercase letters
+ return (char)('A' + _rnd.Next(0,26));
+ }
+ }
+}
diff --git a/CSharpBible/CharGrid/ViewModels/CharGridViewModel.cs b/CSharpBible/CharGrid/ViewModels/CharGridViewModel.cs
new file mode 100644
index 000000000..dcd111ae7
--- /dev/null
+++ b/CSharpBible/CharGrid/ViewModels/CharGridViewModel.cs
@@ -0,0 +1,52 @@
+using System.Collections.ObjectModel;
+using CSharpBible.CharGrid.Services;
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+using CSharpBible.CharGrid.ViewModels.Interfaces;
+using System.Windows.Forms;
+
+namespace CSharpBible.CharGrid.ViewModels;
+
+public partial class CharGridViewModel : ViewModelBase, ICharGridViewModel
+{
+ private readonly ICharGridProvider _provider;
+
+ [ObservableProperty]
+ private ObservableCollection> rows = new();
+
+ public int RowCount => _provider.Rows;
+ public int ColumnCount => _provider.Columns;
+
+ public CharGridViewModel(ICharGridProvider provider)
+ {
+ _provider = provider;
+ for (int r = 0; r < _provider.Rows; r++)
+ {
+ var row = new ObservableCollection();
+ for (int c = 0; c < _provider.Columns; c++)
+ row.Add(_provider.GetChar(r, c));
+ rows.Add(row);
+ }
+ }
+
+ [RelayCommand]
+ private void UpdateCell((int r, int c, char value) args)
+ {
+ var (r, c, value) = args;
+ _provider.SetChar(r, c, value);
+ rows[r][c] = value;
+ // ObservableProperty will raise PropertyChanged for Rows when set; direct item change triggers collection notifications
+ }
+
+ [RelayCommand]
+ private void Exit()
+ {
+ Application.Exit();
+ }
+
+ [RelayCommand]
+ private void About()
+ {
+
+ }
+}
diff --git a/CSharpBible/CharGrid/ViewModels/Interfaces/ICharGridViewModel.cs b/CSharpBible/CharGrid/ViewModels/Interfaces/ICharGridViewModel.cs
new file mode 100644
index 000000000..654bfe1c6
--- /dev/null
+++ b/CSharpBible/CharGrid/ViewModels/Interfaces/ICharGridViewModel.cs
@@ -0,0 +1,15 @@
+using CommunityToolkit.Mvvm.Input;
+using System.Collections.ObjectModel;
+
+namespace CSharpBible.CharGrid.ViewModels.Interfaces;
+
+public interface ICharGridViewModel
+{
+ ObservableCollection> Rows { get; }
+
+ IRelayCommand ExitCommand { get; }
+ IRelayCommand AboutCommand { get; }
+ IRelayCommand<(int r, int c, char value)> UpdateCellCommand { get; }
+ int ColumnCount { get; }
+ int RowCount { get; }
+}
\ No newline at end of file
diff --git a/CSharpBible/CharGrid/ViewModels/ViewModelBase.cs b/CSharpBible/CharGrid/ViewModels/ViewModelBase.cs
new file mode 100644
index 000000000..165973b62
--- /dev/null
+++ b/CSharpBible/CharGrid/ViewModels/ViewModelBase.cs
@@ -0,0 +1,9 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+
+namespace CSharpBible.CharGrid.ViewModels
+{
+ // Replaced manual INotifyPropertyChanged with ObservableObject from CommunityToolkit
+ public abstract partial class ViewModelBase : ObservableObject
+ {
+ }
+}
diff --git a/CSharpBible/CharGrid/Visual/FrmCharGridMain.Designer.cs b/CSharpBible/CharGrid/Views/FrmCharGridMain.Designer.cs
similarity index 97%
rename from CSharpBible/CharGrid/Visual/FrmCharGridMain.Designer.cs
rename to CSharpBible/CharGrid/Views/FrmCharGridMain.Designer.cs
index a52cb383c..bffb0f28a 100644
--- a/CSharpBible/CharGrid/Visual/FrmCharGridMain.Designer.cs
+++ b/CSharpBible/CharGrid/Views/FrmCharGridMain.Designer.cs
@@ -1,393 +1,399 @@
-// ***********************************************************************
-// Assembly : CharGrid
-// Author : Mir
-// Created : 12-19-2021
-//
-// Last Modified By : Mir
-// Last Modified On : 12-24-2021
-// ***********************************************************************
-//
-// Copyright © JC-Soft 2020
-//
-//
-// ***********************************************************************
-namespace CSharpBible.CharGrid.Visual
-{
- ///
- /// Class FrmCharGridMain.
- /// Implements the
- ///
- ///
- partial class FrmCharGridMain
- {
- ///
- /// Erforderliche Designervariable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Verwendete Ressourcen bereinigen.
- ///
- /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Vom Windows Form-Designer generierter Code
-
- ///
- /// Erforderliche Methode für die Designerunterstützung.
- /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
- ///
- private void InitializeComponent()
- {
- this.menuStrip1 = new System.Windows.Forms.MenuStrip();
- this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.pnlTop = new System.Windows.Forms.Panel();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.label1 = new System.Windows.Forms.Label();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.lblFont = new System.Windows.Forms.Label();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.pnlBottom = new System.Windows.Forms.Panel();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.button1 = new System.Windows.Forms.Button();
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- this.textBox3 = new System.Windows.Forms.TextBox();
- this.menuStrip1.SuspendLayout();
- this.pnlTop.SuspendLayout();
- this.pnlBottom.SuspendLayout();
- this.tableLayoutPanel1.SuspendLayout();
- this.SuspendLayout();
- //
- // menuStrip1
- //
- this.menuStrip1.GripMargin = new System.Windows.Forms.Padding(2, 2, 0, 2);
- this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
- this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.fileToolStripMenuItem,
- this.helpToolStripMenuItem});
- this.menuStrip1.Location = new System.Drawing.Point(0, 0);
- this.menuStrip1.Name = "menuStrip1";
- this.menuStrip1.Size = new System.Drawing.Size(1183, 36);
- this.menuStrip1.TabIndex = 0;
- this.menuStrip1.Text = "menuStrip1";
- //
- // fileToolStripMenuItem
- //
- this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.exitToolStripMenuItem});
- this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
- this.fileToolStripMenuItem.Size = new System.Drawing.Size(54, 29);
- this.fileToolStripMenuItem.Text = "&File";
- //
- // exitToolStripMenuItem
- //
- this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
- this.exitToolStripMenuItem.Size = new System.Drawing.Size(141, 34);
- this.exitToolStripMenuItem.Text = "E&xit";
- //
- // helpToolStripMenuItem
- //
- this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.aboutToolStripMenuItem});
- this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
- this.helpToolStripMenuItem.Size = new System.Drawing.Size(65, 29);
- this.helpToolStripMenuItem.Text = "&Help";
- //
- // aboutToolStripMenuItem
- //
- this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
- this.aboutToolStripMenuItem.Size = new System.Drawing.Size(181, 34);
- this.aboutToolStripMenuItem.Text = "&About ...";
- //
- // pnlTop
- //
- this.pnlTop.Controls.Add(this.textBox1);
- this.pnlTop.Controls.Add(this.label1);
- this.pnlTop.Controls.Add(this.checkBox1);
- this.pnlTop.Controls.Add(this.lblFont);
- this.pnlTop.Controls.Add(this.comboBox1);
- this.pnlTop.Dock = System.Windows.Forms.DockStyle.Top;
- this.pnlTop.Location = new System.Drawing.Point(0, 36);
- this.pnlTop.Name = "pnlTop";
- this.pnlTop.Size = new System.Drawing.Size(1183, 45);
- this.pnlTop.TabIndex = 1;
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(480, 8);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(285, 26);
- this.textBox1.TabIndex = 4;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(410, 10);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(51, 20);
- this.label1.TabIndex = 3;
- this.label1.Text = "label1";
- //
- // checkBox1
- //
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(265, 10);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(113, 24);
- this.checkBox1.TabIndex = 2;
- this.checkBox1.Text = "checkBox1";
- this.checkBox1.UseVisualStyleBackColor = true;
- //
- // lblFont
- //
- this.lblFont.AutoSize = true;
- this.lblFont.Location = new System.Drawing.Point(10, 10);
- this.lblFont.Name = "lblFont";
- this.lblFont.Size = new System.Drawing.Size(46, 20);
- this.lblFont.TabIndex = 1;
- this.lblFont.Text = "Font:";
- //
- // comboBox1
- //
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Location = new System.Drawing.Point(65, 8);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(183, 28);
- this.comboBox1.TabIndex = 0;
- //
- // pnlBottom
- //
- this.pnlBottom.Controls.Add(this.button4);
- this.pnlBottom.Controls.Add(this.button3);
- this.pnlBottom.Controls.Add(this.button2);
- this.pnlBottom.Controls.Add(this.textBox2);
- this.pnlBottom.Controls.Add(this.button1);
- this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.pnlBottom.Location = new System.Drawing.Point(0, 553);
- this.pnlBottom.Name = "pnlBottom";
- this.pnlBottom.Size = new System.Drawing.Size(1183, 79);
- this.pnlBottom.TabIndex = 2;
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(589, 10);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(110, 60);
- this.button4.TabIndex = 4;
- this.button4.Text = "button4";
- this.button4.UseVisualStyleBackColor = true;
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(398, 10);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(110, 60);
- this.button3.TabIndex = 3;
- this.button3.Text = "button3";
- this.button3.UseVisualStyleBackColor = true;
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(263, 10);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(110, 60);
- this.button2.TabIndex = 2;
- this.button2.Text = "button2";
- this.button2.UseVisualStyleBackColor = true;
- //
- // textBox2
- //
- this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.textBox2.Location = new System.Drawing.Point(10, 10);
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(80, 53);
- this.textBox2.TabIndex = 1;
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(110, 10);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(110, 60);
- this.button1.TabIndex = 0;
- this.button1.Text = "button1";
- this.button1.UseVisualStyleBackColor = true;
- //
- // tableLayoutPanel1
- //
- this.tableLayoutPanel1.ColumnCount = 32;
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F));
- this.tableLayoutPanel1.Controls.Add(this.textBox3, 0, 0);
- this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 81);
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- this.tableLayoutPanel1.RowCount = 8;
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
- this.tableLayoutPanel1.Size = new System.Drawing.Size(1183, 472);
- this.tableLayoutPanel1.TabIndex = 3;
- //
- // textBox3
- //
- this.textBox3.Cursor = System.Windows.Forms.Cursors.Hand;
- this.textBox3.Location = new System.Drawing.Point(3, 3);
- this.textBox3.Name = "textBox3";
- this.textBox3.ReadOnly = true;
- this.textBox3.Size = new System.Drawing.Size(47, 26);
- this.textBox3.TabIndex = 0;
- //
- // FrmCharGridMain
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1183, 632);
- this.Controls.Add(this.tableLayoutPanel1);
- this.Controls.Add(this.pnlBottom);
- this.Controls.Add(this.pnlTop);
- this.Controls.Add(this.menuStrip1);
- this.MainMenuStrip = this.menuStrip1;
- this.Name = "FrmCharGridMain";
- this.Text = "CharGrid";
- this.menuStrip1.ResumeLayout(false);
- this.menuStrip1.PerformLayout();
- this.pnlTop.ResumeLayout(false);
- this.pnlTop.PerformLayout();
- this.pnlBottom.ResumeLayout(false);
- this.pnlBottom.PerformLayout();
- this.tableLayoutPanel1.ResumeLayout(false);
- this.tableLayoutPanel1.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- ///
- /// The menu strip1
- ///
- private System.Windows.Forms.MenuStrip menuStrip1;
- ///
- /// The file tool strip menu item
- ///
- private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
- ///
- /// The exit tool strip menu item
- ///
- private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
- ///
- /// The help tool strip menu item
- ///
- private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
- ///
- /// The about tool strip menu item
- ///
- private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
- ///
- /// The PNL top
- ///
- private System.Windows.Forms.Panel pnlTop;
- ///
- /// The text box1
- ///
- private System.Windows.Forms.TextBox textBox1;
- ///
- /// The label1
- ///
- private System.Windows.Forms.Label label1;
- ///
- /// The check box1
- ///
- private System.Windows.Forms.CheckBox checkBox1;
- ///
- /// The label font
- ///
- private System.Windows.Forms.Label lblFont;
- ///
- /// The combo box1
- ///
- private System.Windows.Forms.ComboBox comboBox1;
- ///
- /// The PNL bottom
- ///
- private System.Windows.Forms.Panel pnlBottom;
- ///
- /// The button4
- ///
- private System.Windows.Forms.Button button4;
- ///
- /// The button3
- ///
- private System.Windows.Forms.Button button3;
- ///
- /// The button2
- ///
- private System.Windows.Forms.Button button2;
- ///
- /// The text box2
- ///
- private System.Windows.Forms.TextBox textBox2;
- ///
- /// The button1
- ///
- private System.Windows.Forms.Button button1;
- ///
- /// The table layout panel1
- ///
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
- ///
- /// The text box3
- ///
- private System.Windows.Forms.TextBox textBox3;
- }
-}
-
+// ***********************************************************************
+// Assembly : CharGrid
+// Author : Mir
+// Created : 12-19-2021
+//
+// Last Modified By : Mir
+// Last Modified On : 12-24-2021
+// ***********************************************************************
+//
+// Copyright © JC-Soft 2020
+//
+//
+// ***********************************************************************
+using CSharpBible.CharGrid.ViewModels.Interfaces;
+using Views;
+
+namespace CSharpBible.CharGrid.Views
+{
+ ///
+ /// Class FrmCharGridMain.
+ /// Implements the
+ ///
+ ///
+ partial class FrmCharGridMain
+ {
+ ///
+ /// Erforderliche Designervariable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Verwendete Ressourcen bereinigen.
+ ///
+ /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Vom Windows Form-Designer generierter Code
+
+ ///
+ /// Erforderliche Methode für die Designerunterstützung.
+ /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
+ ///
+ private void InitializeComponent()
+ {
+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+ this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.pnlTop = new System.Windows.Forms.Panel();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.checkBox1 = new System.Windows.Forms.CheckBox();
+ this.lblFont = new System.Windows.Forms.Label();
+ this.comboBox1 = new System.Windows.Forms.ComboBox();
+ this.pnlBottom = new System.Windows.Forms.Panel();
+ this.button4 = new System.Windows.Forms.Button();
+ this.button3 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.textBox3 = new System.Windows.Forms.TextBox();
+ this.menuStrip1.SuspendLayout();
+ this.pnlTop.SuspendLayout();
+ this.pnlBottom.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // menuStrip1
+ //
+ this.menuStrip1.GripMargin = new System.Windows.Forms.Padding(2, 2, 0, 2);
+ this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.fileToolStripMenuItem,
+ this.helpToolStripMenuItem});
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip1.Name = "menuStrip1";
+ this.menuStrip1.Size = new System.Drawing.Size(1183, 36);
+ this.menuStrip1.TabIndex = 0;
+ this.menuStrip1.Text = "menuStrip1";
+ //
+ // fileToolStripMenuItem
+ //
+ this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.exitToolStripMenuItem});
+ this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
+ this.fileToolStripMenuItem.Size = new System.Drawing.Size(54, 29);
+ this.fileToolStripMenuItem.Text = "&File";
+ //
+ // exitToolStripMenuItem
+ //
+ this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
+ this.exitToolStripMenuItem.Size = new System.Drawing.Size(141, 34);
+ this.exitToolStripMenuItem.Text = "E&xit";
+ //
+ // helpToolStripMenuItem
+ //
+ this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.aboutToolStripMenuItem});
+ this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
+ this.helpToolStripMenuItem.Size = new System.Drawing.Size(65, 29);
+ this.helpToolStripMenuItem.Text = "&Help";
+ //
+ // aboutToolStripMenuItem
+ //
+ this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
+ this.aboutToolStripMenuItem.Size = new System.Drawing.Size(181, 34);
+ this.aboutToolStripMenuItem.Text = "&About ...";
+ //
+ // pnlTop
+ //
+ this.pnlTop.Controls.Add(this.textBox1);
+ this.pnlTop.Controls.Add(this.label1);
+ this.pnlTop.Controls.Add(this.checkBox1);
+ this.pnlTop.Controls.Add(this.lblFont);
+ this.pnlTop.Controls.Add(this.comboBox1);
+ this.pnlTop.Dock = System.Windows.Forms.DockStyle.Top;
+ this.pnlTop.Location = new System.Drawing.Point(0, 36);
+ this.pnlTop.Name = "pnlTop";
+ this.pnlTop.Size = new System.Drawing.Size(1183, 45);
+ this.pnlTop.TabIndex = 1;
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(480, 8);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(285, 26);
+ this.textBox1.TabIndex = 4;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(410, 10);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(51, 20);
+ this.label1.TabIndex = 3;
+ this.label1.Text = "label1";
+ //
+ // checkBox1
+ //
+ this.checkBox1.AutoSize = true;
+ this.checkBox1.Location = new System.Drawing.Point(265, 10);
+ this.checkBox1.Name = "checkBox1";
+ this.checkBox1.Size = new System.Drawing.Size(113, 24);
+ this.checkBox1.TabIndex = 2;
+ this.checkBox1.Text = "checkBox1";
+ this.checkBox1.UseVisualStyleBackColor = true;
+ //
+ // lblFont
+ //
+ this.lblFont.AutoSize = true;
+ this.lblFont.Location = new System.Drawing.Point(10, 10);
+ this.lblFont.Name = "lblFont";
+ this.lblFont.Size = new System.Drawing.Size(46, 20);
+ this.lblFont.TabIndex = 1;
+ this.lblFont.Text = "Font:";
+ //
+ // comboBox1
+ //
+ this.comboBox1.FormattingEnabled = true;
+ this.comboBox1.Location = new System.Drawing.Point(65, 8);
+ this.comboBox1.Name = "comboBox1";
+ this.comboBox1.Size = new System.Drawing.Size(183, 28);
+ this.comboBox1.TabIndex = 0;
+ //
+ // pnlBottom
+ //
+ this.pnlBottom.Controls.Add(this.button4);
+ this.pnlBottom.Controls.Add(this.button3);
+ this.pnlBottom.Controls.Add(this.button2);
+ this.pnlBottom.Controls.Add(this.textBox2);
+ this.pnlBottom.Controls.Add(this.button1);
+ this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.pnlBottom.Location = new System.Drawing.Point(0, 553);
+ this.pnlBottom.Name = "pnlBottom";
+ this.pnlBottom.Size = new System.Drawing.Size(1183, 79);
+ this.pnlBottom.TabIndex = 2;
+ //
+ // button4
+ //
+ this.button4.Location = new System.Drawing.Point(589, 10);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(110, 60);
+ this.button4.TabIndex = 4;
+ this.button4.Text = "button4";
+ this.button4.UseVisualStyleBackColor = true;
+ //
+ // button3
+ //
+ this.button3.Location = new System.Drawing.Point(398, 10);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(110, 60);
+ this.button3.TabIndex = 3;
+ this.button3.Text = "button3";
+ this.button3.UseVisualStyleBackColor = true;
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(263, 10);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(110, 60);
+ this.button2.TabIndex = 2;
+ this.button2.Text = "button2";
+ this.button2.UseVisualStyleBackColor = true;
+ //
+ // textBox2
+ //
+ this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.textBox2.Location = new System.Drawing.Point(10, 10);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(80, 53);
+ this.textBox2.TabIndex = 1;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(110, 10);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(110, 60);
+ this.button1.TabIndex = 0;
+ this.button1.Text = "button1";
+ this.button1.UseVisualStyleBackColor = true;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 32;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.125F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F));
+ this.tableLayoutPanel1.Controls.Add(this.textBox3, 0, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 81);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 8;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(1183, 472);
+ this.tableLayoutPanel1.TabIndex = 3;
+ //
+ // textBox3
+ //
+ this.textBox3.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.textBox3.Location = new System.Drawing.Point(3, 3);
+ this.textBox3.Name = "textBox3";
+ this.textBox3.ReadOnly = true;
+ this.textBox3.Size = new System.Drawing.Size(47, 26);
+ this.textBox3.TabIndex = 0;
+ //
+ // FrmCharGridMain
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(1183, 632);
+ this.Controls.Add(this.tableLayoutPanel1);
+ this.Controls.Add(this.pnlBottom);
+ this.Controls.Add(this.pnlTop);
+ this.Controls.Add(this.menuStrip1);
+ this.MainMenuStrip = this.menuStrip1;
+ this.Name = "FrmCharGridMain";
+ this.Text = "CharGrid";
+ this.menuStrip1.ResumeLayout(false);
+ this.menuStrip1.PerformLayout();
+ this.pnlTop.ResumeLayout(false);
+ this.pnlTop.PerformLayout();
+ this.pnlBottom.ResumeLayout(false);
+ this.pnlBottom.PerformLayout();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ ///
+ /// The menu strip1
+ ///
+ private System.Windows.Forms.MenuStrip menuStrip1;
+ ///
+ /// The file tool strip menu item
+ ///
+ private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
+ ///
+ /// The exit tool strip menu item
+ ///
+ [CommandBinding(nameof(ICharGridViewModel.ExitCommand))]
+ private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
+ ///
+ /// The help tool strip menu item
+ ///
+ private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
+ ///
+ /// The about tool strip menu item
+ ///
+ [CommandBinding(nameof(ICharGridViewModel.AboutCommand))]
+ private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
+ ///
+ /// The PNL top
+ ///
+ private System.Windows.Forms.Panel pnlTop;
+ ///
+ /// The text box1
+ ///
+ private System.Windows.Forms.TextBox textBox1;
+ ///
+ /// The label1
+ ///
+ private System.Windows.Forms.Label label1;
+ ///
+ /// The check box1
+ ///
+ private System.Windows.Forms.CheckBox checkBox1;
+ ///
+ /// The label font
+ ///
+ private System.Windows.Forms.Label lblFont;
+ ///
+ /// The combo box1
+ ///
+ private System.Windows.Forms.ComboBox comboBox1;
+ ///
+ /// The PNL bottom
+ ///
+ private System.Windows.Forms.Panel pnlBottom;
+ ///
+ /// The button4
+ ///
+ private System.Windows.Forms.Button button4;
+ ///
+ /// The button3
+ ///
+ private System.Windows.Forms.Button button3;
+ ///
+ /// The button2
+ ///
+ private System.Windows.Forms.Button button2;
+ ///
+ /// The text box2
+ ///
+ private System.Windows.Forms.TextBox textBox2;
+ ///
+ /// The button1
+ ///
+ [CommandBinding(nameof(ICharGridViewModel.ExitCommand))]
+ private System.Windows.Forms.Button button1;
+ ///
+ /// The table layout panel1
+ ///
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ ///
+ /// The text box3
+ ///
+ private System.Windows.Forms.TextBox textBox3;
+ }
+}
+
diff --git a/CSharpBible/CharGrid/Views/FrmCharGridMain.cs b/CSharpBible/CharGrid/Views/FrmCharGridMain.cs
new file mode 100644
index 000000000..dadd26391
--- /dev/null
+++ b/CSharpBible/CharGrid/Views/FrmCharGridMain.cs
@@ -0,0 +1,55 @@
+// ***********************************************************************
+// Assembly : CharGrid
+// Author : Mir
+// Created :12-19-2021
+//
+// Last Modified By : GitHub Copilot
+// Last Modified On :11-05-2025
+// ***********************************************************************
+using CSharpBible.CharGrid.ViewModels.Interfaces;
+using System;
+using System.Windows.Forms;
+using Views;
+
+namespace CSharpBible.CharGrid.Views
+{
+ ///
+ /// Class FrmCharGridMain.
+ /// Implements the
+ ///
+ ///
+ public partial class FrmCharGridMain : Form
+ {
+ private readonly ICharGridViewModel _vm;
+
+ // Inject ViewModel
+ public FrmCharGridMain(ICharGridViewModel vm)
+ {
+ _vm = vm;
+ InitializeComponent();
+ Load += FrmCharGridMain_Load;
+ CommandBindingAttribute.Commit(this, vm);
+ }
+
+ private void FrmCharGridMain_Load(object sender, EventArgs e)
+ {
+ var dgv = Controls["dgvChars"] as DataGridView; // expects a DataGridView named dgvChars
+ if (dgv == null) return;
+
+ dgv.ReadOnly = true;
+ dgv.AllowUserToAddRows = false;
+ dgv.AllowUserToDeleteRows = false;
+
+ dgv.ColumnCount = _vm.ColumnCount;
+ dgv.RowCount = _vm.RowCount;
+
+ for (int r = 0; r < _vm.RowCount; r++)
+ {
+ for (int c = 0; c < _vm.ColumnCount; c++)
+ {
+ dgv[c, r].Value = _vm.Rows[r][c];
+ }
+ }
+ }
+ }
+}
diff --git a/CSharpBible/CharGrid/Visual/FrmCharGridMain.resx b/CSharpBible/CharGrid/Views/FrmCharGridMain.resx
similarity index 97%
rename from CSharpBible/CharGrid/Visual/FrmCharGridMain.resx
rename to CSharpBible/CharGrid/Views/FrmCharGridMain.resx
index 0f6d8eb42..d5494e305 100644
--- a/CSharpBible/CharGrid/Visual/FrmCharGridMain.resx
+++ b/CSharpBible/CharGrid/Views/FrmCharGridMain.resx
@@ -1,123 +1,123 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 17, 17
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
\ No newline at end of file
diff --git a/CSharpBible/CharGrid/Visual/FrmCharGridMain.cs b/CSharpBible/CharGrid/Visual/FrmCharGridMain.cs
deleted file mode 100644
index d6e14c74d..000000000
--- a/CSharpBible/CharGrid/Visual/FrmCharGridMain.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// ***********************************************************************
-// Assembly : CharGrid
-// Author : Mir
-// Created : 12-19-2021
-//
-// Last Modified By : Mir
-// Last Modified On : 12-24-2021
-// ***********************************************************************
-//
-// Copyright © JC-Soft 2020
-//
-//
-// ***********************************************************************
-using System.Windows.Forms;
-
-namespace CSharpBible.CharGrid.Visual
-{
- ///
- /// Class FrmCharGridMain.
- /// Implements the
- ///
- ///
- public partial class FrmCharGridMain : Form
- {
- ///
- /// Initializes a new instance of the class.
- ///
- public FrmCharGridMain()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/CSharpBible/DB/DBTest1/DBTest1.csproj b/CSharpBible/DB/DBTest1/DBTest1.csproj
index f9912103f..94eed5f05 100644
--- a/CSharpBible/DB/DBTest1/DBTest1.csproj
+++ b/CSharpBible/DB/DBTest1/DBTest1.csproj
@@ -12,7 +12,7 @@
-->
-
+
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/DataAnalysis.Core.csproj b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/DataAnalysis.Core.csproj
index 997818578..8307629de 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/DataAnalysis.Core.csproj
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/DataAnalysis.Core.csproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net9.0;net8.0
enable
enable
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/ISyslogAnalysisExporter.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/Interfaces/ISyslogAnalysisExporter.cs
similarity index 91%
rename from CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/ISyslogAnalysisExporter.cs
rename to CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/Interfaces/ISyslogAnalysisExporter.cs
index 3c777e497..aea3e1fac 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/ISyslogAnalysisExporter.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/Interfaces/ISyslogAnalysisExporter.cs
@@ -2,7 +2,7 @@
using System.Threading.Tasks;
using DataAnalysis.Core.Models;
-namespace DataAnalysis.Core.Export;
+namespace DataAnalysis.Core.Export.Interfaces;
///
/// Abstraktion für den Export von Analyseergebnissen in beliebige Zielformate.
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/Interfaces/ITableExporter.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/Interfaces/ITableExporter.cs
new file mode 100644
index 000000000..12f30de78
--- /dev/null
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/Interfaces/ITableExporter.cs
@@ -0,0 +1,10 @@
+using System.Data;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace DataAnalysis.Core.Export.Interfaces;
+
+public interface ITableExporter
+{
+ Task ExportAsync(DataTable table, string inputPath, string? outputPath, CancellationToken cancellationToken = default);
+}
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/SyslogExcelExporter.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/SyslogExcelExporter.cs
index 93d732e85..e9ee19979 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/SyslogExcelExporter.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/SyslogExcelExporter.cs
@@ -1,9 +1,11 @@
using System;
using System.IO;
using System.Linq;
+using System.Numerics;
using System.Threading;
using System.Threading.Tasks;
using ClosedXML.Excel;
+using DataAnalysis.Core.Export.Interfaces;
using DataAnalysis.Core.Models;
namespace DataAnalysis.Core.Export;
@@ -13,97 +15,132 @@ namespace DataAnalysis.Core.Export;
///
public sealed class SyslogExcelExporter : ISyslogAnalysisExporter
{
- public Task ExportAsync(AnalysisResult result, string inputPath, string? outputPath, CancellationToken cancellationToken)
- {
- outputPath ??= BuildDefaultOutputPath(inputPath);
- Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!);
+ public Task ExportAsync(AnalysisResult result, string inputPath, string? outputPath, CancellationToken cancellationToken)
+ {
+ outputPath ??= BuildDefaultOutputPath(inputPath);
+ Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!);
- using var wb = new XLWorkbook();
+ using var wb = new XLWorkbook();
- var wsInfo = wb.AddWorksheet("Übersicht");
- wsInfo.Cell(1, 1).Value = "Datei";
- wsInfo.Cell(1, 2).Value = Path.GetFileName(inputPath);
- wsInfo.Cell(2, 1).Value = "Zeilen gesamt";
- wsInfo.Cell(2, 2).Value = result.TotalLines;
- wsInfo.Cell(3, 1).Value = "Zeilen geparst";
- wsInfo.Cell(3, 2).Value = result.ParsedLines;
- wsInfo.Cell(4, 1).Value = "Zeilen übersprungen";
- wsInfo.Cell(4, 2).Value = result.SkippedLines;
- wsInfo.Cell(5, 1).Value = "Erster Zeitstempel";
- wsInfo.Cell(5, 2).Value = result.FirstTimestamp?.LocalDateTime;
- wsInfo.Cell(6, 1).Value = "Letzter Zeitstempel";
- wsInfo.Cell(6, 2).Value = result.LastTimestamp?.LocalDateTime;
- wsInfo.Columns().AdjustToContents();
+ var wsInfo = wb.AddWorksheet("Übersicht");
+ wsInfo.Cell(1,1).Value = "Datei";
+ wsInfo.Cell(1,2).Value = Path.GetFileName(inputPath);
+ wsInfo.Cell(2,1).Value = "Zeilen gesamt";
+ wsInfo.Cell(2,2).Value = result.TotalLines;
+ wsInfo.Cell(3,1).Value = "Zeilen geparst";
+ wsInfo.Cell(3,2).Value = result.ParsedLines;
+ wsInfo.Cell(4,1).Value = "Zeilen übersprungen";
+ wsInfo.Cell(4,2).Value = result.SkippedLines;
+ wsInfo.Cell(5,1).Value = "Erster Zeitstempel";
+ wsInfo.Cell(5,2).Value = result.FirstTimestamp?.LocalDateTime;
+ wsInfo.Cell(6,1).Value = "Letzter Zeitstempel";
+ wsInfo.Cell(6,2).Value = result.LastTimestamp?.LocalDateTime;
+ if (!string.IsNullOrWhiteSpace(result.GlobalFilterText))
+ {
+ wsInfo.Cell(7,1).Value = "Globaler Filter";
+ wsInfo.Cell(7,2).Value = result.GlobalFilterText;
+ wsInfo.Cell(7,2).Style.Font.Italic = true;
+ }
+ wsInfo.Columns().AdjustToContents();
- // Aggregationen exportieren
- foreach (var agg in result.Aggregations)
- {
- var ws = wb.AddWorksheet(TrimSheetName(agg.Title));
- if (agg.Matrix is not null)
- {
- //2D Matrix: write headers from agg.Columns exactly as provided to preserve mapping
- ws.Cell(1, 1).Value = "Schlüssel";
- var columns = agg.Columns ?? Array.Empty();
- for (int i = 0; i < columns.Count; i++)
- ws.Cell(1, 2 + i).Value = columns[i];
+ // Aggregationen exportieren
+ foreach (var agg in result.Aggregations)
+ {
+ var ws = wb.AddWorksheet(TrimSheetName(agg.Title));
+ var hasLocalFilter = !string.IsNullOrWhiteSpace(agg.FilterText);
+ int headerRow = hasLocalFilter ?2 :1;
- // Rotate column header text90° and center
- if (columns.Count > 0)
- {
- var headerRange = ws.Range(1, 2, 1, 1 + columns.Count);
- headerRange.Style.Alignment.TextRotation = 90;
- headerRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
- headerRange.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
- headerRange.Style.Font.Bold = true;
- }
+ // Falls lokaler Filter vorhanden, Kommentarzeile oben einfügen
+ if (hasLocalFilter)
+ {
+ ws.Cell(1,1).Value = $"# Filter: {agg.FilterText}";
+ ws.Cell(1,1).Style.Font.Italic = true;
+ ws.Cell(1,1).Style.Font.FontColor = XLColor.Gray;
+ }
- int r = 2;
- var keys = agg.Matrix.Keys.ToList();
- // Keep Summe as last row if present
- keys.Sort((a, b) => string.Equals(a, "Summe", StringComparison.OrdinalIgnoreCase) ? 1 : string.Equals(b, "Summe", StringComparison.OrdinalIgnoreCase) ? -1 : string.Compare(a, b, StringComparison.OrdinalIgnoreCase));
- foreach (var rowKey in keys)
- {
- var row = agg.Matrix[rowKey];
- ws.Cell(r, 1).Value = rowKey;
- for (int i = 0; i < columns.Count; i++)
- {
- var colKey = columns[i];
- ws.Cell(r, 2 + i).Value = row.TryGetValue(colKey, out var v) ? v : 0;
- }
- r++;
- }
- }
- else if (agg.Series is not null)
- {
- //1D
- ws.Cell(1, 1).Value = "Schlüssel";
- ws.Cell(1, 2).Value = "Anzahl";
- // Bold headers
- ws.Range(1, 1, 1, 2).Style.Font.Bold = true;
- int r = 2;
- foreach (var kv in agg.Series.OrderByDescending(kv => kv.Value).ThenBy(kv => kv.Key))
- { ws.Cell(r, 1).Value = kv.Key; ws.Cell(r, 2).Value = kv.Value; r++; }
- }
- ws.Columns().AdjustToContents();
- }
+ if (agg.Matrix is not null)
+ {
+ //2D Matrix: write headers from agg.Columns exactly as provided to preserve mapping
+ ws.Cell(headerRow,1).Value = "Schlüssel";
+ var cols = agg.Columns ?? Array.Empty();
+ for (int i =0; i < cols.Count; i++)
+ ws.Cell(headerRow,2 + i).Value = cols[i];
- wb.SaveAs(outputPath);
- return Task.FromResult(outputPath);
- }
+ // Rotate column header text90° and center
+ if (cols.Count >0)
+ {
+ var headerRange = ws.Range(headerRow,2, headerRow,1 + cols.Count);
+ headerRange.Style.Alignment.TextRotation =90;
+ headerRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
+ headerRange.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
+ headerRange.Style.Font.Bold = true;
+ }
- private static string BuildDefaultOutputPath(string inputPath)
- {
- var dir = Path.GetDirectoryName(inputPath)!;
- var name = Path.GetFileNameWithoutExtension(inputPath);
- if (!name.EndsWith("_Auswertung", StringComparison.OrdinalIgnoreCase))
- name += "_Auswertung";
- return Path.Combine(dir, name + ".xlsx");
- }
+ int r = headerRow +1;
+ var keys = agg.Matrix.Keys.ToList();
+ // Keep Summe as last row if present
+ keys.Sort((a, b) => string.Equals(a, "Summe", StringComparison.OrdinalIgnoreCase) ?1 : string.Equals(b, "Summe", StringComparison.OrdinalIgnoreCase) ? -1 : string.Compare(a, b, StringComparison.OrdinalIgnoreCase));
+ foreach (var rowKey in keys)
+ {
+ var row = agg.Matrix[rowKey];
+ ws.Cell(r,1).Value = rowKey;
+ for (int i =0; i < cols.Count; i++)
+ {
+ var colKey = cols[i];
+ ws.Cell(r,2 + i).Value = row.TryGetValue(colKey, out var v) ? v :0;
+ }
+ r++;
+ }
+ }
+ else if (agg.Series is not null && agg.Dimensions.Count ==2)
+ {
+ //2D Punkte (Cluster)
+ ws.Cell(headerRow,1).Value = "X";
+ ws.Cell(headerRow,2).Value = "Y";
+ ws.Cell(headerRow,3).Value = "Anzahl";
+ // Bold headers
+ ws.Range(headerRow,1, headerRow,3).Style.Font.Bold = true;
+ int r = headerRow +1;
+ foreach (var kv in agg.Series.OrderByDescending(kv => kv.Value))
+ if (kv.Key is Vector2 p)
+ {
+ ws.Cell(r,1).Value = p.X;
+ ws.Cell(r,2).Value = p.Y;
+ ws.Cell(r,3).Value = kv.Value;
+ r++;
+ }
+ }
+ else if (agg.Series is not null)
+ {
+ //1D
+ ws.Cell(headerRow,1).Value = "Schlüssel";
+ ws.Cell(headerRow,2).Value = "Anzahl";
+ // Bold headers
+ ws.Range(headerRow,1, headerRow,2).Style.Font.Bold = true;
+ int r = headerRow +1;
+ foreach (var kv in agg.Series.OrderByDescending(kv => kv.Value).ThenBy(kv => kv.Key))
+ { ws.Cell(r,1).Value = kv.Key.ToString(); ws.Cell(r,2).Value = kv.Value; r++; }
+ }
+ ws.Columns().AdjustToContents();
+ }
- private static string TrimSheetName(string name)
- {
- var invalid = Path.GetInvalidFileNameChars();
- var n = new string(name.Select(c => invalid.Contains(c) ? '_' : c).ToArray());
- return n.Length > 31 ? n[..31] : n;
- }
+ wb.SaveAs(outputPath);
+ return Task.FromResult(outputPath);
+ }
+
+ private static string BuildDefaultOutputPath(string inputPath)
+ {
+ var dir = Path.GetDirectoryName(inputPath)!;
+ var name = Path.GetFileNameWithoutExtension(inputPath);
+ if (!name.EndsWith("_Auswertung", StringComparison.OrdinalIgnoreCase))
+ name += "_Auswertung";
+ return Path.Combine(dir, name + ".xlsx");
+ }
+
+ private static string TrimSheetName(string name)
+ {
+ var invalid = Path.GetInvalidFileNameChars();
+ var n = new string(name.Select(c => invalid.Contains(c) ? '_' : c).ToArray());
+ return n.Length >31 ? n[..31] : n;
+ }
}
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/TableExcelExporter.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/TableExcelExporter.cs
new file mode 100644
index 000000000..54f405517
--- /dev/null
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Export/TableExcelExporter.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using ClosedXML.Excel;
+using DataAnalysis.Core.Export.Interfaces;
+
+namespace DataAnalysis.Core.Export;
+
+public sealed class TableExcelExporter : ITableExporter
+{
+ public Task ExportAsync(DataTable table, string inputPath, string? outputPath, CancellationToken cancellationToken = default)
+ {
+ outputPath ??= BuildDefaultOutputPath(inputPath);
+ Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!);
+
+ using var wb = new XLWorkbook();
+ var ws = wb.AddWorksheet(string.IsNullOrWhiteSpace(table.TableName) ? "Tabelle" : TrimSheetName(table.TableName));
+
+ // Header
+ for (int c = 0; c < table.Columns.Count; c++)
+ ws.Cell(1, c + 1).Value = table.Columns[c].ColumnName;
+ ws.Range(1, 1, 1, Math.Max(1, table.Columns.Count)).Style.Font.Bold = true;
+
+ // Rows
+ int r = 2;
+ foreach (DataRow row in table.Rows)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ for (int c = 0; c < table.Columns.Count; c++)
+ if (table.Columns[c].DataType == typeof(DateTime) && row[c] is DateTime dt)
+ {
+ ws.Cell(r, c + 1).Value = dt;
+ ws.Cell(r, c + 1).Style.DateFormat.Format = "yyyy-mm-dd hh:mm:ss.ms";
+ }
+ else
+ ws.Cell(r, c + 1).Value = row[c]?.ToString() ?? string.Empty;
+ r++;
+ }
+
+ ws.Columns().AdjustToContents();
+ wb.SaveAs(outputPath);
+ return Task.FromResult(outputPath);
+ }
+
+ private static string BuildDefaultOutputPath(string inputPath)
+ {
+ var dir = Path.GetDirectoryName(inputPath)!;
+ var name = Path.GetFileNameWithoutExtension(inputPath);
+ if (!name.EndsWith("_Export", StringComparison.OrdinalIgnoreCase))
+ name += "_Export";
+ return Path.Combine(dir, name + ".xlsx");
+ }
+
+ private static string TrimSheetName(string name)
+ {
+ var invalid = Path.GetInvalidFileNameChars();
+ var n = new string(name.Select(c => invalid.Contains(c) ? '_' : c).ToArray());
+ return n.Length > 31 ? n[..31] : n;
+ }
+}
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/DelimitedTableParsingProfile.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/DelimitedTableParsingProfile.cs
index 047961151..ba1847dde 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/DelimitedTableParsingProfile.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/DelimitedTableParsingProfile.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using DataAnalysis.Core.Import.Interfaces;
using DataAnalysis.Core.Models;
namespace DataAnalysis.Core.Import;
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/DelimitedTableReader.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/DelimitedTableReader.cs
index 6ca8d29dc..fa3b3d76c 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/DelimitedTableReader.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/DelimitedTableReader.cs
@@ -1,3 +1,7 @@
+using DataAnalysis.Core.Import.Interfaces;
+using DataAnalysis.Core.Models;
+using DocumentFormat.OpenXml.Drawing;
+using DocumentFormat.OpenXml.Spreadsheet;
using System;
using System.Collections.Generic;
using System.Data;
@@ -9,7 +13,7 @@
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
-using DataAnalysis.Core.Models;
+using System.Xml.Linq;
namespace DataAnalysis.Core.Import;
@@ -28,38 +32,57 @@ public DelimitedTableReader(IDelimitedTableParsingProfile profile)
public async Task ReadTableAsync(string inputPath, CancellationToken cancellationToken = default)
{
- if (string.IsNullOrWhiteSpace(inputPath)) throw new ArgumentException(ErrorPathEmpty, nameof(inputPath));
- if (!File.Exists(inputPath)) throw new FileNotFoundException(ErrorInputNotFound, inputPath);
+ if (string.IsNullOrWhiteSpace(inputPath))
+ throw new ArgumentException(ErrorPathEmpty, nameof(inputPath));
+ if (!File.Exists(inputPath))
+ throw new FileNotFoundException(ErrorInputNotFound, inputPath);
var dt = new DataTable(_profile.TableName);
using var fs = new FileStream(inputPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
using var reader = new StreamReader(fs, DetectEncoding(fs) ?? Encoding.UTF8, detectEncodingFromByteOrderMarks: true);
// Header
- Dictionary? headerMap = null;
+ Dictionary? headerMap = null;
+ var inclFields = new List();
+
if (_profile.HasHeaderRow)
{
var headerLine = await reader.ReadLineAsync().ConfigureAwait(false);
if (headerLine is not null)
{
var headers = SplitLine(headerLine, _profile.Delimiter, _profile.Quote, _profile.TrimWhitespace);
- headerMap = headers.Select((h,i)=> new { Name = (h ?? string.Empty).Trim(), i})
- .GroupBy(x=>x.Name, StringComparer.OrdinalIgnoreCase)
- .ToDictionary(g=>g.Key, g=>g.First().i, StringComparer.OrdinalIgnoreCase);
+ headerMap = headers.Select((h, i) => new { Name = (h ?? string.Empty).Trim(), i })
+ .GroupBy(x => x.Name, StringComparer.OrdinalIgnoreCase)
+ .ToDictionary(g => g.Key, g => g.First().i, StringComparer.OrdinalIgnoreCase);
+ inclFields.AddRange(headerMap.Select((h, i) => i));
+ foreach (var h in headerMap)
+ {
+ if (_profile.FixedColumns.Any((f) => f.Source == h.Key))
+ inclFields.Remove(h.Value);
+ if (_profile.ExtractionRules.Any((r) => r.SourceColumn == h.Key))
+ inclFields.Remove(h.Value);
+ }
+
}
}
// Ensure core columns exist
foreach (var mapping in _profile.FixedColumns)
{
- EnsureColumn(dt, mapping.Target);
+ EnsureColumn(dt, mapping.Target, mapping.IsDateTime);
+ }
+ foreach (var i in inclFields)
+ {
+ var hmi = headerMap.Values.FirstOrDefault((v) => (v == i));
+ EnsureColumn(dt, headerMap.Keys.ToArray()[hmi]);
}
string? line;
while ((line = await reader.ReadLineAsync().ConfigureAwait(false)) is not null)
{
cancellationToken.ThrowIfCancellationRequested();
- if (string.IsNullOrWhiteSpace(line)) continue;
+ if (string.IsNullOrWhiteSpace(line))
+ continue;
var fields = SplitLine(line, _profile.Delimiter, _profile.Quote, _profile.TrimWhitespace);
// extraction rules
@@ -77,19 +100,27 @@ public async Task ReadTableAsync(string inputPath, CancellationToken
foreach (var mapping in _profile.FixedColumns)
row[mapping.Target] = Extract(mapping, fields, headerMap, attributes);
-
+
+ foreach (var i in inclFields)
+ {
+ var hmi = headerMap.Values.FirstOrDefault((v) => (v == i));
+ if (fields.Count>i)
+ row[headerMap.Keys.ToArray()[hmi]] = fields[i];
+ }
+
foreach (var kv in attributes)
- if (!_profile.FixedColumns.Any((f)=> f.Source == kv.Key))
- row[kv.Key] = kv.Value ?? string.Empty;
+ if (!_profile.FixedColumns.Any((f) => f.Source == kv.Key))
+ row[kv.Key] = kv.Value ?? string.Empty;
dt.Rows.Add(row);
}
return dt;
}
- private void ApplyExtractionRules(IReadOnlyList fields, Dictionary? headerMap, Dictionary attributes)
+ private void ApplyExtractionRules(IReadOnlyList fields, Dictionary? headerMap, Dictionary attributes)
{
- if (_profile.ExtractionRules.Count ==0) return;
+ if (_profile.ExtractionRules.Count == 0)
+ return;
foreach (var rule in _profile.ExtractionRules)
{
var xFlag = true;
@@ -115,13 +146,13 @@ private void ApplyExtractionRules(IReadOnlyList fields, Dictionary fields, Dictionary fields,
Dictionary? headerMap,
IReadOnlyDictionary? attributes = null)
-{
- // Hilfsfunktionen
- int? ResolveFieldIndex(string? selector)
{
- if (string.IsNullOrWhiteSpace(selector)) return null;
- if (int.TryParse(selector, out var idx)) return idx;
- if (headerMap is null) return null;
- return headerMap.TryGetValue(selector, out var col) ? col : null;
- }
-
- string? GetByIndex(int? idx) => idx is >= 0 && idx < fields.Count ? fields[idx.Value] : null;
+ // Hilfsfunktionen
+ int? ResolveFieldIndex(string? selector)
+ {
+ if (string.IsNullOrWhiteSpace(selector))
+ return null;
+ if (int.TryParse(selector, out var idx))
+ return idx;
+ if (headerMap is null)
+ return null;
+ return headerMap.TryGetValue(selector, out var col) ? col : null;
+ }
- string? GetBySelector(string? selector, out int? usedIndex)
- {
- usedIndex = ResolveFieldIndex(selector);
- if (usedIndex is not null)
- return GetByIndex(usedIndex);
+ string? GetByIndex(int? idx) => idx is >= 0 && idx < fields.Count ? fields[idx.Value] : null;
- if (!string.IsNullOrWhiteSpace(selector) && attributes is not null && attributes.TryGetValue(selector, out var value))
- return value;
+ string? GetBySelector(string? selector, out int? usedIndex)
+ {
+ usedIndex = ResolveFieldIndex(selector);
+ if (usedIndex is not null)
+ return GetByIndex(usedIndex);
- return null;
- }
+ if (!string.IsNullOrWhiteSpace(selector) && attributes is not null && attributes.TryGetValue(selector, out var value))
+ return value;
- // Werte über fields (Index/Header) ODER attributes extrahieren
- var tsRaw = GetBySelector(mapping.Source, out var _);
+ return null;
+ }
- // Normalisierung/Parsing
- if (mapping.IsDateTime)
- tsRaw = ParseTimestamp(tsRaw)?.ToString(TimestampFormatRoundTrip) ?? "";
-
+ // Werte über fields (Index/Header) ODER attributes extrahieren
+ var tsRaw = GetBySelector(mapping.Source, out var _);
- return tsRaw;
-}
+ return tsRaw;
+ }
private DateTimeOffset? ParseTimestamp(string? raw)
{
- if (string.IsNullOrWhiteSpace(raw)) return null;
+ if (string.IsNullOrWhiteSpace(raw))
+ return null;
raw = raw.Trim().Trim('"').Trim('[', ']');
foreach (var cultureName in _profile.Cultures)
{
var culture = string.IsNullOrEmpty(cultureName) ? CultureInfo.InvariantCulture : CultureInfo.GetCultureInfo(cultureName);
- if (_profile.TimestampFormats.Count >0 && DateTimeOffset.TryParseExact(raw, _profile.TimestampFormats.ToArray(), culture, DateTimeStyles.AssumeLocal, out var dto))
+ if (_profile.TimestampFormats.Count > 0 && DateTimeOffset.TryParseExact(raw, _profile.TimestampFormats.ToArray(), culture, DateTimeStyles.AssumeLocal, out var dto))
+ return dto;
+ if (DateTimeOffset.TryParse(raw, culture, DateTimeStyles.AssumeLocal, out dto))
return dto;
- if (DateTimeOffset.TryParse(raw, culture, DateTimeStyles.AssumeLocal, out dto)) return dto;
}
return null;
}
@@ -195,14 +227,15 @@ private string Extract(
var sb = new StringBuilder();
bool inQuotes = false;
char q = quote ?? '\0';
- for (int i=0; i bom = stackalloc byte[4];
- fs.Position =0;
+ fs.Position = 0;
int read = fs.Read(bom);
fs.Position = original;
- if (read >=3 && bom[0] ==0xEF && bom[1] ==0xBB && bom[2] ==0xBF) return Encoding.UTF8;
- if (read >=2 && bom[0] ==0xFF && bom[1] ==0xFE) return Encoding.Unicode;
- if (read >=2 && bom[0] ==0xFE && bom[1] ==0xFF) return Encoding.BigEndianUnicode;
- if (read >=4 && bom[0] ==0xFF && bom[1] ==0xFE && bom[2] ==0x00 && bom[3] ==0x00) return Encoding.UTF32;
- if (read >=4 && bom[0] ==0x00 && bom[1] ==0x00 && bom[2] ==0xFE && bom[3] ==0xFF) return new UTF32Encoding(bigEndian: true, byteOrderMark: true);
+ if (read >= 3 && bom[0] == 0xEF && bom[1] == 0xBB && bom[2] == 0xBF)
+ return Encoding.UTF8;
+ if (read >= 2 && bom[0] == 0xFF && bom[1] == 0xFE)
+ return Encoding.Unicode;
+ if (read >= 2 && bom[0] == 0xFE && bom[1] == 0xFF)
+ return Encoding.BigEndianUnicode;
+ if (read >= 4 && bom[0] == 0xFF && bom[1] == 0xFE && bom[2] == 0x00 && bom[3] == 0x00)
+ return Encoding.UTF32;
+ if (read >= 4 && bom[0] == 0x00 && bom[1] == 0x00 && bom[2] == 0xFE && bom[3] == 0xFF)
+ return new UTF32Encoding(bigEndian: true, byteOrderMark: true);
return null;
}
}
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/FieldExtractionRule.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/FieldExtractionRule.cs
index d8b24580b..c762ef4a8 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/FieldExtractionRule.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/FieldExtractionRule.cs
@@ -1,3 +1,4 @@
+using DataAnalysis.Core.Import.Interfaces;
using System.Collections.Generic;
using System.Text.RegularExpressions;
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/IDelimitedTableParsingProfile.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/IDelimitedTableParsingProfile.cs
similarity index 92%
rename from CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/IDelimitedTableParsingProfile.cs
rename to CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/IDelimitedTableParsingProfile.cs
index b89fd4ed4..45cd98a85 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/IDelimitedTableParsingProfile.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/IDelimitedTableParsingProfile.cs
@@ -1,4 +1,4 @@
-namespace DataAnalysis.Core.Import;
+namespace DataAnalysis.Core.Import.Interfaces;
public interface IDelimitedTableParsingProfile
{
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/IFieldExtractionRule.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/IFieldExtractionRule.cs
similarity index 73%
rename from CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/IFieldExtractionRule.cs
rename to CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/IFieldExtractionRule.cs
index 4bd7c2c55..16b09e518 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/IFieldExtractionRule.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/IFieldExtractionRule.cs
@@ -1,7 +1,6 @@
-
-using System.Text.RegularExpressions;
+using System.Text.RegularExpressions;
-namespace DataAnalysis.Core.Import;
+namespace DataAnalysis.Core.Import.Interfaces;
public interface IFieldExtractionRule
{
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/ITableReader.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/ITableReader.cs
similarity index 77%
rename from CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/ITableReader.cs
rename to CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/ITableReader.cs
index d064739dc..19ee41d88 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/ITableReader.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Import/Interfaces/ITableReader.cs
@@ -1,6 +1,6 @@
using System.Data;
-namespace DataAnalysis.Core.Import;
+namespace DataAnalysis.Core.Import.Interfaces;
public interface ITableReader
{
diff --git a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Models/AggregationResult.cs b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Models/AggregationResult.cs
index 8305362f4..cc4d97766 100644
--- a/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Models/AggregationResult.cs
+++ b/CSharpBible/Data/DataAnalysis/DataAnalysis.Core/Models/AggregationResult.cs
@@ -7,8 +7,11 @@ public sealed class AggregationResult
public required string Title { get; init; }
public required IReadOnlyList Dimensions { get; init; }
+ // Optional: Textuelle Beschreibung des lokalen Filters
+ public string? FilterText { get; init; }
+
// For1D aggregations
- public IReadOnlyDictionary? Series { get; init; }
+ public IReadOnlyDictionary
diff --git a/Transpiler_pp/Analyzer1/Analyzer1.Test/Analyzer1.Test.csproj b/Transpiler_pp/Analyzer1/Analyzer1.Test/Analyzer1.Test.csproj
index 9ebdca58b..adae87d80 100644
--- a/Transpiler_pp/Analyzer1/Analyzer1.Test/Analyzer1.Test.csproj
+++ b/Transpiler_pp/Analyzer1/Analyzer1.Test/Analyzer1.Test.csproj
@@ -1,4 +1,4 @@
-
+
net8.0
diff --git a/Transpiler_pp/Transpiler.sln b/Transpiler_pp/Transpiler.sln
index a4c10e722..64a695415 100644
--- a/Transpiler_pp/Transpiler.sln
+++ b/Transpiler_pp/Transpiler.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.2.32616.157
+# Visual Studio Version 18
+VisualStudioVersion = 18.0.11201.2 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projektmappenelemente", "Projektmappenelemente", "{FB9836CD-815C-4901-B10D-8CCF99B18E30}"
ProjectSection(SolutionItems) = preProject
@@ -44,6 +44,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseLib", "..\CSharpBible\L
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseLibTests", "..\CSharpBible\Libraries\BaseLibTests\BaseLibTests.csproj", "{893755DA-9A1A-4DCB-8B7D-CD5C61790B76}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranspilerLib.Pascal", "TranspilerLib.Pascal\TranspilerLib.Pascal.csproj", "{D87F3521-E414-4F1C-895D-7CDA16483DFF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranspilerLib.IEC", "TranspilerLib.IEC\TranspilerLib.IEC.csproj", "{07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranspilerLib.CSharp", "TranspilerLib.CSharp\TranspilerLib.CSharp.csproj", "{1CCC7458-4422-4370-8540-3BE92F479BEA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranspilerLib.Pascal.Tests", "TranspilerLib.Pascal.Tests\TranspilerLib.Pascal.Tests.csproj", "{DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -222,6 +230,54 @@ Global
{893755DA-9A1A-4DCB-8B7D-CD5C61790B76}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{893755DA-9A1A-4DCB-8B7D-CD5C61790B76}.Release|x86.ActiveCfg = Release|Any CPU
{893755DA-9A1A-4DCB-8B7D-CD5C61790B76}.Release|x86.Build.0 = Release|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Debug|x86.Build.0 = Debug|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Release|x86.ActiveCfg = Release|Any CPU
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF}.Release|x86.Build.0 = Release|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Debug|x86.Build.0 = Debug|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Release|x86.ActiveCfg = Release|Any CPU
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0}.Release|x86.Build.0 = Release|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Debug|x86.Build.0 = Debug|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Release|x86.ActiveCfg = Release|Any CPU
+ {1CCC7458-4422-4370-8540-3BE92F479BEA}.Release|x86.Build.0 = Release|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Debug|x86.Build.0 = Debug|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Release|x86.ActiveCfg = Release|Any CPU
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -241,6 +297,10 @@ Global
{C87BEC24-2C21-4DEF-BB8D-B9503105A086} = {5481B009-5D62-45A8-9DD3-B9E6792B0C0E}
{8608004D-250B-461E-BD95-D288414A9C01} = {8655F273-B5AF-4D9A-B635-7F9168703579}
{893755DA-9A1A-4DCB-8B7D-CD5C61790B76} = {8655F273-B5AF-4D9A-B635-7F9168703579}
+ {D87F3521-E414-4F1C-895D-7CDA16483DFF} = {5481B009-5D62-45A8-9DD3-B9E6792B0C0E}
+ {07C23DC0-BB5F-4E3F-A85E-2F4ACB66ECC0} = {5481B009-5D62-45A8-9DD3-B9E6792B0C0E}
+ {1CCC7458-4422-4370-8540-3BE92F479BEA} = {5481B009-5D62-45A8-9DD3-B9E6792B0C0E}
+ {DD21FC5F-2FFF-4BD6-847B-7B5006DB3389} = {5481B009-5D62-45A8-9DD3-B9E6792B0C0E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {44374C4A-6FF4-4900-8BB8-964A6A2E0338}
diff --git a/Transpiler_pp/TranspilerConsTest/TranspilerConsTest.csproj b/Transpiler_pp/TranspilerConsTest/TranspilerConsTest.csproj
index 1ff218b6c..f825a37ea 100644
--- a/Transpiler_pp/TranspilerConsTest/TranspilerConsTest.csproj
+++ b/Transpiler_pp/TranspilerConsTest/TranspilerConsTest.csproj
@@ -15,6 +15,7 @@
+
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/CSCode.cs b/Transpiler_pp/TranspilerLib.CSharp/Models/Scanner/CSCode.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/CSCode.cs
rename to Transpiler_pp/TranspilerLib.CSharp/Models/Scanner/CSCode.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/CSCodeBuilder.cs b/Transpiler_pp/TranspilerLib.CSharp/Models/Scanner/CSCodeBuilder.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/CSCodeBuilder.cs
rename to Transpiler_pp/TranspilerLib.CSharp/Models/Scanner/CSCodeBuilder.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/CSTokenHandler.cs b/Transpiler_pp/TranspilerLib.CSharp/Models/Scanner/CSTokenHandler.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/CSTokenHandler.cs
rename to Transpiler_pp/TranspilerLib.CSharp/Models/Scanner/CSTokenHandler.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/CodeOptimizer.cs b/Transpiler_pp/TranspilerLib.CSharp/Models/Scanner/CodeOptimizer.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/CodeOptimizer.cs
rename to Transpiler_pp/TranspilerLib.CSharp/Models/Scanner/CodeOptimizer.cs
diff --git a/Transpiler_pp/TranspilerLib.CSharp/TranspilerLib.CSharp.csproj b/Transpiler_pp/TranspilerLib.CSharp/TranspilerLib.CSharp.csproj
new file mode 100644
index 000000000..e0d715e5a
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.CSharp/TranspilerLib.CSharp.csproj
@@ -0,0 +1,12 @@
+
+
+
+ net8.0;net9.0;net10.0
+ enable
+
+
+
+
+
+
+
diff --git a/Transpiler_pp/TranspilerLib/Models/Interpreter/IECInterpreter.cs b/Transpiler_pp/TranspilerLib.IEC/Interpreter/IECInterpreter.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Interpreter/IECInterpreter.cs
rename to Transpiler_pp/TranspilerLib.IEC/Interpreter/IECInterpreter.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/ExtOutput.cs b/Transpiler_pp/TranspilerLib.IEC/Models/ExtOutput.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/ExtOutput.cs
rename to Transpiler_pp/TranspilerLib.IEC/Models/ExtOutput.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/IECReader.cs b/Transpiler_pp/TranspilerLib.IEC/Models/IECReader.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/IECReader.cs
rename to Transpiler_pp/TranspilerLib.IEC/Models/IECReader.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/IECCode.cs b/Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECCode.cs
similarity index 97%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/IECCode.cs
rename to Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECCode.cs
index 1574304ff..ae290e4e8 100644
--- a/Transpiler_pp/TranspilerLib/Models/Scanner/IECCode.cs
+++ b/Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECCode.cs
@@ -80,11 +80,11 @@ public partial class IECCode : CodeBase, IIECCode
{IECResWords.rw_WSTRING, TypeCode.String},
};
- public bool DoWhile { get => !codeOptimizer._noWhile; set => codeOptimizer._noWhile = !value; }
+ // public bool DoWhile { get => !codeOptimizer._noWhile; set => codeOptimizer._noWhile = !value; }
private ITokenHandler tokenHandler = new IECTokenHandler() { reservedWords = ReservedWords2, blockWords = IECBlocksWords, sysTypes = IECSysTypes };
private ICodeBuilder codeBuilder = new IECCodeBuilder() { };
- private ICodeOptimizer codeOptimizer = new CodeOptimizer();
+ // private ICodeOptimizer codeOptimizer = new CodeOptimizer();
// public string Code { get; set; }
private static string GetDebug(TokenizeData data, string code) => $"{code.Substring(Math.Max(0, data.Pos - 20), data.Pos - Math.Max(0, data.Pos - 20))}" +
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/IECCodeBlock.cs b/Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECCodeBlock.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/IECCodeBlock.cs
rename to Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECCodeBlock.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/IECCodeBuilder.cs b/Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECCodeBuilder.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/IECCodeBuilder.cs
rename to Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECCodeBuilder.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/IECResWords.cs b/Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECResWords.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/IECResWords.cs
rename to Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECResWords.cs
diff --git a/Transpiler_pp/TranspilerLib/Models/Scanner/IECTokenHandler.cs b/Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECTokenHandler.cs
similarity index 100%
rename from Transpiler_pp/TranspilerLib/Models/Scanner/IECTokenHandler.cs
rename to Transpiler_pp/TranspilerLib.IEC/Models/Scanner/IECTokenHandler.cs
diff --git a/Transpiler_pp/TranspilerLib.IEC/TranspilerLib.IEC.csproj b/Transpiler_pp/TranspilerLib.IEC/TranspilerLib.IEC.csproj
new file mode 100644
index 000000000..4abf8347e
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.IEC/TranspilerLib.IEC.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net8.0;net9.0;net10.0
+ enable
+
+
+
+
+
+
+
+
diff --git a/Transpiler_pp/TranspilerLib.Pascal.Tests/Models/Scanner/PasCodeTests.cs b/Transpiler_pp/TranspilerLib.Pascal.Tests/Models/Scanner/PasCodeTests.cs
new file mode 100644
index 000000000..a55af0774
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.Pascal.Tests/Models/Scanner/PasCodeTests.cs
@@ -0,0 +1,66 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using TranspilerLib.Pascal.Models.Scanner;
+using TranspilerLib.Data;
+using System.Collections.Generic;
+using static TranspilerLib.Helper.TestHelper;
+
+#pragma warning disable IDE0130
+namespace TranspilerLib.Pascal.Models.Scanner.Tests;
+#pragma warning restore IDE0130
+
+[TestClass]
+public class PasCodeTests : TranspilerLib.Models.Tests.TestBase
+{
+ private PasCode _testClass = null!;
+
+ [TestInitialize]
+ public void Init() => _testClass = new PasCode();
+
+ [TestMethod]
+ public void Tokenize_Empty_NoTokens()
+ {
+ _testClass.OriginalCode = string.Empty;
+ var list = new List();
+ _testClass.Tokenize(t => list.Add(t));
+ Assert.AreEqual(0, list.Count);
+ }
+
+ [TestMethod]
+ public void Tokenize_SimpleBeginEnd()
+ {
+ _testClass.OriginalCode = "begin end;";
+ var list = new List();
+ _testClass.Tokenize(t => list.Add(t));
+ Assert.IsTrue(list.Exists(t => t.Code.ToLower()=="begin"));
+ Assert.IsTrue(list.Exists(t => t.Code.ToLower().StartsWith("end")));
+ }
+
+ [TestMethod]
+ public void Parse_SimpleBeginEnd()
+ {
+ _testClass.OriginalCode = "begin end;";
+ var root = _testClass.Parse();
+ var code = root.ToCode();
+ Assert.IsTrue(code.ToLower().Contains("begin"));
+ Assert.IsTrue(code.ToLower().Contains("end"));
+ }
+
+ [TestMethod]
+ public void Tokenize_Strings_Concatenate()
+ {
+ _testClass.OriginalCode = "begin 'a''b'; end;";
+ var list = new List();
+ _testClass.Tokenize(t => list.Add(t));
+ Assert.IsTrue(list.Exists(t => t.type==CodeBlockType.String));
+ }
+
+ [TestMethod]
+ public void Comments_BlockAndLine()
+ {
+ _testClass.OriginalCode = "begin //x\n(* abc *) {def} end;";
+ var list = new List();
+ _testClass.Tokenize(t => list.Add(t));
+ Assert.IsTrue(list.Exists(t => t.type==CodeBlockType.LComment));
+ Assert.IsTrue(list.Exists(t => t.type==CodeBlockType.Comment));
+ }
+}
diff --git a/Transpiler_pp/TranspilerLib.Pascal.Tests/TranspilerLib.Pascal.Tests.csproj b/Transpiler_pp/TranspilerLib.Pascal.Tests/TranspilerLib.Pascal.Tests.csproj
new file mode 100644
index 000000000..e2b7add10
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.Pascal.Tests/TranspilerLib.Pascal.Tests.csproj
@@ -0,0 +1,27 @@
+
+
+
+ net8.0;net9.0;net10.0
+ enable
+ false
+ true
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
diff --git a/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasCode.cs b/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasCode.cs
new file mode 100644
index 000000000..704758381
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasCode.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using TranspilerLib.Data;
+using TranspilerLib.Interfaces.Code;
+using TranspilerLib.Models;
+using TranspilerLib.Models.Scanner;
+using static TranspilerLib.Interfaces.Code.ICodeBase;
+
+namespace TranspilerLib.Pascal.Models.Scanner;
+
+public class PasCode : CodeBase
+{
+ private static readonly string[] _reserved = PasReservedWords.Words;
+
+ private readonly ITokenHandler _tokenHandler = new PasTokenHandler() { reservedWords = _reserved };
+ private readonly ICodeBuilder _codeBuilder = new PasCodeBuilder();
+ // private readonly ICodeOptimizer _optimizer = new CodeOptimizer();
+
+ private static string GetDebug(TokenizeData data, string code) => $"{code.Substring(Math.Max(0, data.Pos - 20), data.Pos - Math.Max(0, data.Pos - 20))}>" + code[data.Pos] + "<" +
+ $"{code.Substring(Math.Min(data.Pos + 1, code.Length - 1), Math.Min(40, code.Length - data.Pos - 1))}";
+
+ public override IEnumerable Tokenize()
+ {
+ List list = new();
+ Tokenize(t => list.Add(t));
+ foreach (var t in list)
+ yield return t;
+ }
+
+ public override void Tokenize(TokenDelegate? doToken)
+ {
+ TokenizeData data = new();
+ while (data.Pos < OriginalCode.Length && _tokenHandler.TryGetValue(data.State, out var handler))
+ {
+ var dbg = GetDebug(data, OriginalCode);
+ handler(doToken, OriginalCode, data);
+ data.Pos++;
+ }
+ }
+
+ public override ICodeBlock Parse(IEnumerable? values = null)
+ {
+ ICodeBlock root = new CodeBlock() { Name = "PascalRoot", Code = string.Empty, Parent = null };
+ var data = _codeBuilder.NewData(root);
+
+ if (values == null)
+ Tokenize(td => _codeBuilder.OnToken(td, data));
+ else
+ foreach (var v in values)
+ _codeBuilder.OnToken(v, data);
+
+ return root;
+ }
+}
diff --git a/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasCodeBuilder.cs b/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasCodeBuilder.cs
new file mode 100644
index 000000000..59c67e335
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasCodeBuilder.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Linq;
+using TranspilerLib.Data;
+using TranspilerLib.Interfaces.Code;
+using TranspilerLib.Models.Scanner;
+
+namespace TranspilerLib.Pascal.Models.Scanner;
+
+///
+/// Pascal-specific builder. Interprets BEGIN/END and statement boundaries to form blocks.
+///
+public class PasCodeBuilder : CodeBuilder
+{
+ public PasCodeBuilder()
+ {
+ NewCodeBlock = (name, type, code, parent, pos) => new CodeBlock() { Name = name, Type = type, Code = code, Parent = parent, SourcePos = pos };
+ }
+
+ public override void OnToken(TokenData tokenData, ICodeBuilderData data)
+ {
+ switch (tokenData.type)
+ {
+ default:
+ base.OnToken(tokenData, data);
+ break;
+ case CodeBlockType.Operation when !string.IsNullOrEmpty(tokenData.Code):
+ BuildOperation(tokenData, data);
+ break;
+ case CodeBlockType.Label:
+ BuildLabel(tokenData, data);
+ break;
+ case CodeBlockType.Block:
+ base.OnToken(tokenData, data);
+ break;
+ }
+ data.cbtLast = tokenData.type;
+ }
+
+ private void BuildLabel(TokenData tokenData, ICodeBuilderData data)
+ {
+ // treat labels as own blocks at parent level
+ var parent = data.actualBlock.Parent ?? data.actualBlock;
+ data.actualBlock = NewCodeBlock("Label", CodeBlockType.Label, tokenData.Code, parent, tokenData.Pos);
+ }
+
+ private void BuildOperation(TokenData tokenData, ICodeBuilderData data)
+ {
+ var text = tokenData.Code.Trim();
+ switch (text.ToUpper())
+ {
+ case "BEGIN":
+ tokenData.type = CodeBlockType.Block;
+ tokenData.Level = Math.Max(data.actualBlock.Level - 1, 0);
+ base.OnToken(tokenData, data);
+ break;
+ case "END":
+ case "END;":
+ // Emit block end as block token to step up
+ var td = tokenData; td.type = CodeBlockType.Block; td.Level = Math.Max(data.actualBlock.Level - 2, 0);
+ base.OnToken(td, data);
+ // climb up until statement level
+ if (data.actualBlock?.Parent != null)
+ data.actualBlock = data.actualBlock.Parent;
+ break;
+ default:
+ // generic statement accumulation similar to CS builder
+ if (data.actualBlock.Type is not CodeBlockType.Operation and not CodeBlockType.MainBlock
+ || (!string.IsNullOrEmpty(data.actualBlock.Code) && data.actualBlock.Code.EndsWith(";")))
+ {
+ data.actualBlock = NewCodeBlock("Operation", CodeBlockType.Operation, text, data.actualBlock.Parent, tokenData.Pos);
+ }
+ else
+ {
+ var pad = (data.actualBlock.Code.EndsWith("\"") && text.StartsWith("+")) || text.StartsWith("(")
+ ? " " : string.Empty;
+ data.actualBlock.Code += pad + tokenData.Code;
+ }
+ if (text.EndsWith(";"))
+ {
+ var b = new TokenData(";", CodeBlockType.Block, Math.Max(data.actualBlock.Level - 1, 0), tokenData.Pos);
+ base.OnToken(b, data);
+ }
+ break;
+ }
+ }
+}
diff --git a/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasReservedWords.cs b/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasReservedWords.cs
new file mode 100644
index 000000000..59d06f391
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasReservedWords.cs
@@ -0,0 +1,12 @@
+namespace TranspilerLib.Pascal.Models.Scanner;
+
+///
+/// Pascal / Delphi reserved words subset. Extend list as needed.
+///
+public static class PasReservedWords
+{
+ public static readonly string[] Words = new[]
+ {
+ "PROGRAM","UNIT","INTERFACE","IMPLEMENTATION","USES","BEGIN","END","VAR","CONST","TYPE","FUNCTION","PROCEDURE","IF","THEN","ELSE","FOR","TO","DOWNTO","DO","WHILE","REPEAT","UNTIL","CASE","OF","WITH","TRY","EXCEPT","FINALLY","CLASS","PRIVATE","PUBLIC","PROTECTED","PUBLISHED"
+ };
+}
diff --git a/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasTokenHandler.cs b/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasTokenHandler.cs
new file mode 100644
index 000000000..1981422ca
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.Pascal/Models/Scanner/PasTokenHandler.cs
@@ -0,0 +1,143 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using TranspilerLib.Data;
+using TranspilerLib.Interfaces.Code;
+using TranspilerLib.Models;
+using TranspilerLib.Models.Scanner;
+using static TranspilerLib.Interfaces.Code.ICodeBase;
+
+namespace TranspilerLib.Pascal.Models.Scanner;
+
+///
+/// Very small initial Pascal/Delphi token handler. Supports
+/// - line comments (//)
+/// - block comments (* .. *) and { .. }
+/// - strings using single quotes with doubled quote escape
+/// - basic block delimiters (BEGIN/END) are emitted as operations then interpreted by builder.
+/// This is intentionally lightweight; extend as needed.
+///
+public class PasTokenHandler : TokenHandlerBase, ITokenHandler
+{
+ private static readonly Dictionary> _tokenStateHandler = new()
+ {
+ {0, HandleDefault},
+ {1, HandleString},
+ {2, HandleLineComment},
+ {3, HandleBlockCommentStar},
+ {4, HandleBlockCommentBrace},
+ };
+
+ private static string[] _reservedWords = Array.Empty();
+ public string[] reservedWords { set => _reservedWords = value.Select(s=>s.ToUpper()).ToArray(); }
+
+ private static void HandleString(TokenDelegate? token,string code, TokenizeData data)
+ {
+ if (code[data.Pos]=='\'' && GetNxtChar(data.Pos,code)=='\'') // doubled quote -> skip next
+ {
+ data.Pos++; // stay in string
+ return;
+ }
+ if (code[data.Pos]=='\'')
+ {
+ EmitToken(token,data,CodeBlockType.String,code,1);
+ data.Pos2 = data.Pos+1;
+ data.State=0;
+ }
+ }
+
+ private static void HandleLineComment(TokenDelegate? token,string code, TokenizeData data)
+ {
+ if (code[data.Pos]=='\n' || data.Pos==code.Length-1)
+ {
+ EmitToken(token,data,CodeBlockType.LComment,code);
+ data.Pos2 = data.Pos+1;
+ data.State=0;
+ }
+ }
+
+ private static void HandleBlockCommentStar(TokenDelegate? token,string code, TokenizeData data)
+ {
+ if (code[data.Pos]=='*' && GetNxtChar(data.Pos,code)==')')
+ {
+ EmitToken(token,data,CodeBlockType.Comment,code,2);
+ data.Pos2 = data.Pos+2;
+ data.State=0;
+ data.Pos++; // skip )
+ }
+ }
+ private static void HandleBlockCommentBrace(TokenDelegate? token,string code, TokenizeData data)
+ {
+ if (code[data.Pos]=='}')
+ {
+ EmitToken(token,data,CodeBlockType.Comment,code,1);
+ data.Pos2 = data.Pos+1;
+ data.State=0;
+ }
+ }
+
+ private static void HandleDefault(TokenDelegate? token,string code, TokenizeData data)
+ {
+ switch(code[data.Pos])
+ {
+ case '\'': // string start
+ EmitToken(token,data,CodeBlockType.Operation,code);
+ data.Pos2 = data.Pos;
+ data.State=1;
+ break;
+ case '/' when GetNxtChar(data.Pos,code)=='/':
+ EmitToken(token,data,CodeBlockType.Operation,code);
+ data.Pos2=data.Pos;
+ data.State=2; data.Pos++; // consume second /
+ break;
+ case '(' when GetNxtChar(data.Pos,code)=='*': // (* comment *)
+ EmitToken(token,data,CodeBlockType.Operation,code);
+ data.Pos2=data.Pos;
+ data.State=3; data.Pos++; // skip *
+ break;
+ case '{': // { comment }
+ EmitToken(token,data,CodeBlockType.Operation,code);
+ data.Pos2=data.Pos;
+ data.State=4;
+ break;
+ case ';':
+ EmitToken(token,data,CodeBlockType.Operation,code,1);
+ data.Pos2=data.Pos+1;
+ break;
+ case ':':
+ // label (identifier before colon)
+ var text = GetText(data,code);
+ if (!string.IsNullOrWhiteSpace(text) && text.Trim().All(ch=>char.IsLetterOrDigit(ch)||ch=='_'))
+ {
+ EmitToken(token,data,CodeBlockType.Label,code,1);
+ data.Pos2 = data.Pos+1;
+ }
+ break;
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\n':
+ // boundary between identifiers and operations
+ if (data.flag)
+ {
+ data.flag=false;
+ var t = GetText(data,code).Trim();
+ if (_reservedWords.Contains(t.ToUpper()))
+ {
+ EmitToken(token,data,CodeBlockType.Operation,code);
+ data.Pos2 = data.Pos;
+ }
+ }
+ break;
+ default:
+ if (char.IsLetter(code[data.Pos]) || code[data.Pos]=='_')
+ {
+ data.flag=true;
+ }
+ break;
+ }
+ }
+
+ public bool TryGetValue(int state, out Action handler)
+ => _tokenStateHandler.TryGetValue(state,out handler);
+}
diff --git a/Transpiler_pp/TranspilerLib.Pascal/TranspilerLib.Pascal.csproj b/Transpiler_pp/TranspilerLib.Pascal/TranspilerLib.Pascal.csproj
new file mode 100644
index 000000000..2643e0b91
--- /dev/null
+++ b/Transpiler_pp/TranspilerLib.Pascal/TranspilerLib.Pascal.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net8.0;net9.0;net10.0
+ enable
+
+
+
+
+
+
+
+
diff --git a/Transpiler_pp/TranspilerLib/Models/Interpreter/InterpData.cs b/Transpiler_pp/TranspilerLib/Models/Interpreter/InterpData.cs
index 090a912f7..fd259dd1e 100644
--- a/Transpiler_pp/TranspilerLib/Models/Interpreter/InterpData.cs
+++ b/Transpiler_pp/TranspilerLib/Models/Interpreter/InterpData.cs
@@ -5,7 +5,7 @@ namespace TranspilerLib.Models.Interpreter;
///
/// Laufzeitdaten für den Interpreter (Program Counter und ggf. weitere Statusinformationen in Zukunft).
///
-internal class InterpData
+public class InterpData
{
///
/// Erstellt eine neue Instanz und setzt den Program Counter auf .
diff --git a/Transpiler_pp/TranspilerLib/TranspilerLib.csproj b/Transpiler_pp/TranspilerLib/TranspilerLib.csproj
index 9b1b4d507..5e473fef6 100644
--- a/Transpiler_pp/TranspilerLib/TranspilerLib.csproj
+++ b/Transpiler_pp/TranspilerLib/TranspilerLib.csproj
@@ -1,31 +1,32 @@

- net8.0;net9.0
+ net8.0;net9.0;net10.0
enable
true
$(OutputPath)Docs\$(MSBuildProjectName).xml
-
+
+
-
- True
- True
- Resources.resx
-
+
+ True
+ True
+ Resources.resx
+
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
diff --git a/Transpiler_pp/TranspilerLibTests/TranspilerLibTests.csproj b/Transpiler_pp/TranspilerLibTests/TranspilerLibTests.csproj
index 5b4a76442..8d3511904 100644
--- a/Transpiler_pp/TranspilerLibTests/TranspilerLibTests.csproj
+++ b/Transpiler_pp/TranspilerLibTests/TranspilerLibTests.csproj
@@ -1,7 +1,7 @@

- net8.0;net9.0
+ net8.0;net9.0;net10.0
disable
enable
@@ -35,7 +35,10 @@
+
+
+
diff --git a/WinAhnenNew/BaseGenClassesTests/BaseGenClassesTests.csproj b/WinAhnenNew/BaseGenClassesTests/BaseGenClassesTests.csproj
index 740bfe414..eb6ec6103 100644
--- a/WinAhnenNew/BaseGenClassesTests/BaseGenClassesTests.csproj
+++ b/WinAhnenNew/BaseGenClassesTests/BaseGenClassesTests.csproj
@@ -9,7 +9,7 @@
-
+
all
diff --git a/WinAhnenNew/WinAhnenClsTests/WinAhnenClsTests.csproj b/WinAhnenNew/WinAhnenClsTests/WinAhnenClsTests.csproj
index 1249ac425..fa54a78ba 100644
--- a/WinAhnenNew/WinAhnenClsTests/WinAhnenClsTests.csproj
+++ b/WinAhnenNew/WinAhnenClsTests/WinAhnenClsTests.csproj
@@ -12,12 +12,12 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+