VEPROMS_UI / remove BouncyCastle

This commit is contained in:
2026-08-21 06:11:06 -04:00
parent 23a296df86
commit 0c3e4bb3e9
41 changed files with 2298 additions and 4704 deletions
+38 -39
View File
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
@@ -13,10 +11,13 @@ namespace VEPROMS
public partial class frmPSI : Form
{
private ProcedureInfo _MyProcedureInfo;
private StepTabRibbon _MyStepTabRibbon;
private Dictionary<string, StepRTB> _DicStepRtb;
private Dictionary<string, CheckBox> _DicCheckBox;
private Dictionary<string, ComboBox> _DicComboBox;
private readonly StepTabRibbon _MyStepTabRibbon;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<string, StepRTB> _DicStepRtb;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<string, CheckBox> _DicCheckBox;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<string, ComboBox> _DicComboBox;
public frmPSI(ProcedureInfo pi)
{
InitializeComponent();
@@ -31,22 +32,23 @@ namespace VEPROMS
{
_MyProcedureInfo = pi;
PSI psiDialogDef = pi.ActiveFormat.PlantFormat.FormatData.ProcData.PSI;
this.Text = psiDialogDef.Caption;
this.Location = new Point((int)psiDialogDef.x * 2, (int)psiDialogDef.y * 2);
Text = psiDialogDef.Caption;
Location = new Point((int)psiDialogDef.x * 2, (int)psiDialogDef.y * 2);
int maxx = 0;
int maxy = 0;
int xB4Scroll = 900;
int yB4Scroll = 630;
this.panelPSI.AutoScroll = false;
panelPSI.AutoScroll = false;
foreach (SILabel lbl in psiDialogDef.LabelList)
{
Label wlbl = new Label();
wlbl.Text = lbl.text;
wlbl.Location = new Point((int)lbl.x * 2, (int)lbl.y * 2);
wlbl.AutoSize = true;
//wlbl.Size = new Size((int)lbl.width * 2, (int)lbl.height * 2);
wlbl.Visible = true;
this.panelPSI.Controls.Add(wlbl);
Label wlbl = new Label
{
Text = lbl.text,
Location = new Point((int)lbl.x * 2, (int)lbl.y * 2),
AutoSize = true,
Visible = true
};
panelPSI.Controls.Add(wlbl);
maxx = ((int)lbl.x * 2 + (int)lbl.width * 2) > maxx ? ((int)lbl.x * 2 + (int)lbl.width * 2) : maxx;
maxy = ((int)lbl.y * 2 + (int)lbl.height * 2) > maxy ? ((int)lbl.y * 2 + (int)lbl.height * 2) : maxy;
}
@@ -62,7 +64,7 @@ namespace VEPROMS
tb.MyItemInfo = pi as ItemInfo;
tb.FieldToEdit = E_FieldToEdit.PSI;
tb.BorderStyle = BorderStyle.FixedSingle;
tb.Enter += new System.EventHandler(this.FieldStepRTB_Enter);
tb.Enter += new System.EventHandler(FieldStepRTB_Enter);
// see if config has data for this field, i.e. search for the 'name'
// B2018-057 Replace non-breaking hyphen with hyphen.
string val = procConfig.GetValue("PSI", fld.name).Replace("\\u8209?", "-");
@@ -70,13 +72,13 @@ namespace VEPROMS
StringBuilder sb = new StringBuilder();
sb.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 Arial;}");
sb.Append(@"{\f1\fnil\fcharset0 Arial;}}{\colortbl ;\red255\green0\blue0;}"); //C2017-036 changed to just Arial because Microsoft removed Arial Unicode MS with Word16
sb.Append(@"\viewkind4\uc1\pard\sl-240\slmult0\fs" + (int)(this.Font.SizeInPoints*2) + " " + dt.StartText + @"}");
sb.Append(@"\viewkind4\uc1\pard\sl-240\slmult0\fs" + (int)(Font.SizeInPoints*2) + " " + dt.StartText + @"}");
tb.Rtf = sb.ToString();
tb.Location = new Point((int)fld.x * 2, (int)fld.y * 2);
tb.Size = new Size((int)fld.width * 2, (int)fld.height * 2);
tb.MinimumSize = new Size((int)fld.width * 2, (int)fld.height * 2);
tb.Visible = true;
this.panelPSI.Controls.Add(tb);
panelPSI.Controls.Add(tb);
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
}
@@ -89,8 +91,8 @@ namespace VEPROMS
cb.Visible = true;
cb.Width = (int)fld.width * 2;
string val = procConfig.GetValue("PSI", fld.name);
cb.Checked = val!=null && val!="" && val.ToUpper()[0] == 'Y' ? true : false;
this.panelPSI.Controls.Add(cb);
cb.Checked = val !=null && val!="" && val.ToUpper()[0] == 'Y';
panelPSI.Controls.Add(cb);
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
}
@@ -107,7 +109,7 @@ namespace VEPROMS
foreach (string t in tmps) cmb.Items.Add(t);
string val = procConfig.GetValue("PSI", fld.name);
if (val != null && val != "") cmb.SelectedItem = val;
this.panelPSI.Controls.Add(cmb);
panelPSI.Controls.Add(cmb);
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
}
@@ -115,19 +117,19 @@ namespace VEPROMS
if (maxx > xB4Scroll)
{
maxx = xB4Scroll;
this.panelPSI.Width = xB4Scroll;
this.panelPSI.AutoScroll = true;
panelPSI.Width = xB4Scroll;
panelPSI.AutoScroll = true;
}
else
this.panelPSI.Width = maxx + 50;
panelPSI.Width = maxx + 50;
if (maxy > yB4Scroll)
{
maxy = yB4Scroll;
this.panelPSI.Height = yB4Scroll;
this.panelPSI.AutoScroll = true;
panelPSI.Height = yB4Scroll;
panelPSI.AutoScroll = true;
}
else
this.panelPSI.Height = maxy; // B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined.
panelPSI.Height = maxy; // B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined.
if (psiDialogDef.ButtonsOnBottom == null || psiDialogDef.ButtonsOnBottom.ToUpper() == "NO")
{
btnOk.Location = new Point(maxx+70, 30);
@@ -138,17 +140,14 @@ namespace VEPROMS
// B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined:
// Adjust location of buttons so that they have a larger Y than the panel that holds the labels/fields
// and adjust the dialog size if it's height is not enough.
btnOk.Location = new Point(btnOk.Location.X, panelPSI.Location.Y + this.panelPSI.Height + 10);
btnCancel.Location = new Point(btnCancel.Location.X, panelPSI.Location.Y + this.panelPSI.Height + 10);
if (this.Height < btnOk.Location.Y + btnOk.Size.Height + 10)
this.Height = btnOk.Location.Y + btnOk.Size.Height + 30;
btnOk.Location = new Point(btnOk.Location.X, panelPSI.Location.Y + panelPSI.Height + 10);
btnCancel.Location = new Point(btnCancel.Location.X, panelPSI.Location.Y + panelPSI.Height + 10);
if (Height < btnOk.Location.Y + btnOk.Size.Height + 10)
Height = btnOk.Location.Y + btnOk.Size.Height + 30;
}
}
private void FieldStepRTB_Enter(object sender, EventArgs e)
{
_MyStepTabRibbon.MyStepRTB = (StepRTB)sender;
}
private void btnOk_Click(object sender, EventArgs e)
private void FieldStepRTB_Enter(object sender, EventArgs e) => _MyStepTabRibbon.MyStepRTB = (StepRTB)sender;
private void btnOk_Click(object sender, EventArgs e)
{
ProcedureConfig procConfig = _MyProcedureInfo.MyConfig as ProcedureConfig;
PSI psiDialogDef = _MyProcedureInfo.ActiveFormat.PlantFormat.FormatData.ProcData.PSI;
@@ -204,13 +203,13 @@ namespace VEPROMS
}
}
DialogResult = DialogResult.OK;
this.Close();
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
this.Close();
Close();
}
}
}