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
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Drawing;
using Volian.Base.Library;
@@ -89,69 +84,26 @@ namespace Volian.Controls.Library
string strARGB = string.Format("[A={0}, R={1}, G={2}, B={3}]", clr.A, clr.R, clr.G, clr.B);
return strARGB;
}
public void SetColor(int row, int col, Color CellColor)
{
// Set the table cell to the ARGB representation of the passed in color
string cellShadeColor = GetARGBstring(CellColor);
TableShadingInfo[row, col] = cellShadeColor;
return;
}
#endregion
#region Insert and Remove Rows and Columns
public void InsertRow(int row)
{
TableShadingInfo.InsertRow(row);
}
public void InsertRows(int row, int count)
{
TableShadingInfo.InsertRows(row, count);
}
public void DeleteRow(int row)
{
TableShadingInfo.DeleteRow(row);
}
public void DeleteRows(int row, int count)
{
TableShadingInfo.DeleteRows(row, count);
}
public void InsertColumn(int column)
{
TableShadingInfo.InsertColumn(column);
}
public void InsertColumns(int column, int count)
{
TableShadingInfo.InsertColumns(column, count);
}
public void DeleteColumn(int column)
{
TableShadingInfo.DeleteColumn(column);
}
public void DeleteColumns(int column, int count)
{
TableShadingInfo.DeleteColumns(column, count);
}
#endregion
#region Serialize
public string ConvertToString()
#endregion
#region Insert and Remove Rows and Columns
public void InsertRow(int row) => TableShadingInfo.InsertRow(row);
public void InsertRows(int row, int count) => TableShadingInfo.InsertRows(row, count);
public void DeleteRow(int row) => TableShadingInfo.DeleteRow(row);
public void DeleteRows(int row, int count) => TableShadingInfo.DeleteRows(row, count);
public void InsertColumn(int column) => TableShadingInfo.InsertColumn(column);
public void InsertColumns(int column, int count) => TableShadingInfo.InsertColumns(column, count);
public void DeleteColumns(int column, int count) => TableShadingInfo.DeleteColumns(column, count);
#endregion
#region Serialize
public string ConvertToString()
{
return GenericSerializer<VlnGridCellShading>.StringSerialize(this);
}
public override string ToString()
{
return "Volian Custom Cell Shading";
}
public static VlnGridCellShading Get(string xml)
{
return GenericSerializer<VlnGridCellShading>.StringDeserialize(xml);
}
#endregion
// Adjust the cell shading array if needed
public void CheckAndFixShadingArraySize(int grdRows, int grdCols, Color defaultCellShading)
{
if (TableShadingInfo.Columns != grdCols || TableShadingInfo.Rows != grdRows)
TableShadingInfo = new CellShadingArray(defaultCellShading, grdRows, grdCols, TableShadingInfo.CellShadingColor);
}
}
[Serializable]
public class CellShadingArray
@@ -200,22 +152,6 @@ namespace Volian.Controls.Library
for (int c = 0; c < Columns; c++)
CellShadingColor[r * Columns + c] = defaultShadingColorARGB;
}
// Used to automatically adjust the cell shading color array
public CellShadingArray(Color defaultShadingColor, int rows, int columns, string[] shadeAry)
{
Rows = rows;
Columns = columns;
CellShadingColor = new string[rows * columns];
for (int r = 0; r < Rows; r++)
for (int c = 0; c < Columns; c++)
{
int idx = r * Columns + c;
if (idx < shadeAry.Length)
CellShadingColor[idx] = shadeAry[idx];
else
CellShadingColor[idx] = defaultShadingColor.ToString();
}
}
#endregion
#region Array Access
public string this[int r, int c]
@@ -232,13 +168,10 @@ namespace Volian.Controls.Library
CellShadingColor[r * Columns + c] = value;
}
}
#endregion
#region Insert and Delete Rows and Columns
public void InsertRow(int row)
{
InsertRows(row, 1);
}
public void InsertRows(int row, int count)
#endregion
#region Insert and Delete Rows and Columns
public void InsertRow(int row) => InsertRows(row, 1);
public void InsertRows(int row, int count)
{
// Create a new Array of the correct size
string[] newLines = new string[(Rows + count) * Columns];
@@ -255,11 +188,8 @@ namespace Volian.Controls.Library
CellShadingColor = newLines;
Rows = newRows;
}
public void DeleteRow(int row)
{
DeleteRows(row, 1);
}
public void DeleteRows(int row, int count)
public void DeleteRow(int row) => DeleteRows(row, 1);
public void DeleteRows(int row, int count)
{
string[] newLines = new string[(Rows - count) * Columns];
int newRows = Rows - count;
@@ -274,11 +204,8 @@ namespace Volian.Controls.Library
CellShadingColor = newLines;
Rows = newRows;
}
public void InsertColumn(int column)
{
InsertColumns(column, 1);
}
public void InsertColumns(int column, int count)
public void InsertColumn(int column) => InsertColumns(column, 1);
public void InsertColumns(int column, int count)
{
// Create a new Array of the correct size
string[] newLines = new string[Rows * (Columns + count)];
@@ -294,11 +221,8 @@ namespace Volian.Controls.Library
CellShadingColor = newLines;
Columns = newColumns;
}
public void DeleteColumn(int column)
{
DeleteColumns(column, 1);
}
public void DeleteColumns(int column, int count)
public void DeleteColumn(int column) => DeleteColumns(column, 1);
public void DeleteColumns(int column, int count)
{
string[] newLines = new string[Rows * (Columns - count)];
int newColumns = Columns - count;