C2026-043-Tech-Debt_v1 - Stash 1

This commit is contained in:
2026-07-21 06:49:28 -04:00
parent 0fed1acfd8
commit 9486b37300
70 changed files with 4222 additions and 10191 deletions
+18 -58
View File
@@ -1,33 +1,24 @@
using C1.Win.C1FlexGrid;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
using VEPROMS.CSLA.Library;
using Volian.Controls.Library;
namespace Volian.Controls.Library
{
public partial class frmImportWordContents : Form
{
private static string GetTableText()
{
return TblFlexGrid.GetSearchableText();
}
private static VlnFlexGrid _TblFlexGrid = null;
{
private static VlnFlexGrid _TblFlexGrid = null;
public static VlnFlexGrid TblFlexGrid
{
get {
if (_TblFlexGrid == null) _TblFlexGrid = new VlnFlexGrid();
return frmImportWordContents._TblFlexGrid;
return _TblFlexGrid;
}
set { frmImportWordContents._TblFlexGrid = value; }
set { _TblFlexGrid = value; }
}
private static void LoadTable2(XmlNode xn)
@@ -54,15 +45,7 @@ namespace Volian.Controls.Library
fg.BringToFront();
fg.Invalidate();
Application.DoEvents();
//ShowColumnWidths(fg);
fg.MakeRTFcells(false);
//ShowMergedCells(fg);
//ShowColumnWidths(fg);
//Well, Can I save the table
//using (Step step = MakeCSLAStep(mySteps, mySteps.Count, null, {TableContent}, 20008, E_FromType.Table))
//{
// Grid.MakeGrid(step.MyContent, fg.GetXMLData(), "");
//}
}
public static VlnFlexGrid _MyFlexGrid = null;
private static void AddTableRow(XmlNode xr, VlnFlexGrid fg, int rows)
@@ -73,14 +56,7 @@ namespace Volian.Controls.Library
foreach (XmlNode xc in xr.ChildNodes)
{
++cols;
//if (xc.InnerText.Contains("RC-V200"))
// Console.WriteLine(xc.InnerText);
//if (xc.InnerText.Contains("RC-V121"))
// Console.WriteLine(xc.InnerText);
//if (xc.InnerXml.Contains("AB 137") || xc.InnerXml.Contains("3013N01"))
// Console.WriteLine("here");
CellRange cr2 = GetMyMergedRange(fg, rows - 1, cols - 1);
//Console.WriteLine("Check {0}", cr2);
while (cr2.c1 != cols - 1 || cr2.r1 != rows - 1)
{
cols++;
@@ -123,7 +99,6 @@ namespace Volian.Controls.Library
break;
}
}
//ShowMergedCells(fg);
if (xc.Name == "td")
{
AddTableColumn(xc, fg, rows, cols);
@@ -131,26 +106,9 @@ namespace Volian.Controls.Library
}
}
//private static void ShowColumnWidths(VlnFlexGrid fg)
//{
// foreach (Column c in fg.Cols)
// Console.WriteLine("Width[{0}]={1}", c.Index, c.Width);
//}
private static void ShowMergedCells(VlnFlexGrid fg)
private static int GetSpan(string span)
{
for (int r = 0; r < fg.Rows.Count; r++)
{
for (int c = 0; c < fg.Cols.Count; c++)
{
CellRange cr3 = GetMyMergedRange(fg, r, c);
if (fg.MergedRanges.Contains(cr3))
Console.WriteLine("cr3 r={0},c={1},rng={2}", r, c, cr3);
}
}
}
private static int GetSpan(string span)
{
int retval = int.Parse("0" + (span ?? ""));
int retval = int.Parse($"0{span ?? ""}");
if (retval == 0) return 0;
return retval - 1;
}
@@ -175,12 +133,14 @@ namespace Volian.Controls.Library
if (r2 > fg.Rows.Count) fg.Rows.Count = r2;
int c2 = c1 + GetSpan(colspan);
if (c2 > fg.Cols.Count) fg.Cols.Count = c2;
CellRange cr = new CellRange();
cr.r1 = r1 - 1;
cr.r2 = r2 - 1;
cr.c1 = c1 - 1;
cr.c2 = c2 - 1;
fg.MergedRanges.Add(cr);
CellRange cr = new CellRange
{
r1 = r1 - 1,
r2 = r2 - 1,
c1 = c1 - 1,
c2 = c2 - 1
};
fg.MergedRanges.Add(cr);
//Console.WriteLine("Merged {0}", cr);
}
}
@@ -194,7 +154,7 @@ namespace Volian.Controls.Library
}
return fg.GetMergedRange(r, c);
}
private static Regex regNumber = new Regex("^[0-9]+$", RegexOptions.Compiled);
private static readonly Regex regNumber = new Regex("^[0-9]+$", RegexOptions.Compiled);
private static void AddTableColumn(XmlNode xc, VlnFlexGrid fg, int rows, int cols)
{
//Console.WriteLine("Rows {0}, Cols {1}", rows, cols);
@@ -218,7 +178,7 @@ namespace Volian.Controls.Library
{
if (xn.Name == "p")
{
sb.Append(prefix + xn.InnerText);
sb.Append($"{prefix}{xn.InnerText}");
}
if (xn.Name == "ul")
{
@@ -226,11 +186,11 @@ namespace Volian.Controls.Library
{
if (xn2.Name == "li")
{
sb.Append(prefix + "*" + xn.InnerText);
sb.Append($"{prefix}*{xn.InnerText}");
}
if (xn2.Name == "p")
{
sb.Append(prefix + xn.InnerText);
sb.Append($"{prefix}{xn.InnerText}");
}
}
}