B2022-026 RO Memory reduction coding

This commit is contained in:
John Jenko 2022-05-26 19:55:07 +00:00
parent 61febac1a0
commit 27993553cb
21 changed files with 6827 additions and 5160 deletions

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,7 @@ namespace VEPROMS
setupProgessSteps1(); // C2017-030 - new Admin Tools user interface setupProgessSteps1(); // C2017-030 - new Admin Tools user interface
UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID); UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID);
IsAdministratorUser = ui.IsAdministrator(); IsAdministratorUser = ui.IsAdministrator();
if (!IsAdministratorUser) if (!IsAdministratorUser)
{ {
//C2020-035 if not full Admin disable repair tools //C2020-035 if not full Admin disable repair tools
@ -176,6 +177,15 @@ namespace VEPROMS
tnc = tmp; tnc = tmp;
} }
} }
else
{
if (tnc != null && tnc.Text != "VEPROMS") // B2020-114 - mad if statement removed: && !IsUsedPath(tnc.FullPath))
{
TreeNode tmp = tnc.Parent;
tnc.Remove();
tnc = tmp;
}
}
} }
return rtnval; return rtnval;
} }
@ -253,7 +263,7 @@ namespace VEPROMS
if (dvil.Count > 0) if (dvil.Count > 0)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.AppendLine("The batch update process was not usccessful for all working drafts selected."); sb.AppendLine("The batch update process was not successful for all working drafts selected.");
sb.AppendLine("The following working drafts were not able to be refreshed..."); sb.AppendLine("The following working drafts were not able to be refreshed...");
sb.AppendLine(); sb.AppendLine();
sb.AppendLine(sbDocVersions.ToString()); sb.AppendLine(sbDocVersions.ToString());
@ -536,8 +546,7 @@ namespace VEPROMS
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
} }
// C2017-030 - new Admin Tools user interface // C2017-030 - new Admin Tools user interface is one of two tools run from Remove Obsolete RO Data
// is one of two tools run from Remove Obsolete RO Data
private void RemoveUnusedRoFstsAndFigures() private void RemoveUnusedRoFstsAndFigures()
{ {
this.Cursor = Cursors.WaitCursor; this.Cursor = Cursors.WaitCursor;
@ -621,6 +630,21 @@ namespace VEPROMS
DateTime pEnd = DateTime.Now; DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm"))); txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
if (rowCount > 0)
{
txtResults.AppendText(string.Format("The database contains {0} unused RO Associations.", rowCount));
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
}
else
{
txtResults.AppendText("No unused RO Associations Found");// B2017-108 Always output results even if there isn't any
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
Application.DoEvents(); Application.DoEvents();
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
@ -744,6 +768,7 @@ namespace VEPROMS
txtResults.AppendText(statmsg); txtResults.AppendText(statmsg);
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
Application.DoEvents(); Application.DoEvents();
if (dq.DocVersionAssociationCount < 1) if (dq.DocVersionAssociationCount < 1)
{ {
ProgressBar.ColorTable = eProgressBarItemColor.Error; ProgressBar.ColorTable = eProgressBarItemColor.Error;
@ -758,8 +783,11 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
return; return;
} }
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst; ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst"; string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
//if (!pathExists(rofstPath))
if (!File.Exists(rofstPath)) if (!File.Exists(rofstPath))
{ {
ProgressBar.ColorTable = eProgressBarItemColor.Error; ProgressBar.ColorTable = eProgressBarItemColor.Error;
@ -774,14 +802,24 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
return; return;
} }
FileInfo fiRofst = new FileInfo(rofstPath);
//FileInfo fiRofst = new FileInfo(rofstPath);
Cursor = Cursors.WaitCursor; Cursor = Cursors.WaitCursor;
using (DocVersion dv = DocVersion.Get(dq.VersionID)) using (DocVersion dv = DocVersion.Get(dq.VersionID))
{ {
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
{
// only load the RO.fst
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.RefreshROFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo, DoProgressBarRefresh, txtProcess); ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
} }
Cursor = Cursors.Default; Cursor = Cursors.Default;
ProgressBar.ColorTable = eProgressBarItemColor.Normal; ProgressBar.ColorTable = eProgressBarItemColor.Normal;
FinalProgressBarMessage = "ROs values updated"; FinalProgressBarMessage = "ROs values updated";
@ -790,6 +828,7 @@ namespace VEPROMS
txtResults.AppendText("ROs values updated"); txtResults.AppendText("ROs values updated");
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
return; return;
} }
@ -890,6 +929,7 @@ namespace VEPROMS
sfd.FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm")); sfd.FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm"));
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"; sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
DialogResult dr = sfd.ShowDialog(); DialogResult dr = sfd.ShowDialog();
if (dr == DialogResult.OK) if (dr == DialogResult.OK)
{ {
System.IO.StreamWriter sw = new System.IO.StreamWriter(sfd.FileName); System.IO.StreamWriter sw = new System.IO.StreamWriter(sfd.FileName);
@ -901,8 +941,13 @@ namespace VEPROMS
private void myTV_AfterCheck(object sender, TreeViewEventArgs e) private void myTV_AfterCheck(object sender, TreeViewEventArgs e)
{ {
if (e.Action != TreeViewAction.Unknown) if (e.Action != TreeViewAction.Unknown)
if(e.Node.Nodes.Count > 0) {
if (e.Node.Nodes.Count > 0)
{
CheckChildNodes(e.Node, e.Node.Checked); CheckChildNodes(e.Node, e.Node.Checked);
}
}
btnFixLinks.Enabled = AtLeastOneNodeChecked(); // C2017-030 support for Refresh Transitions/Update RO Values btnFixLinks.Enabled = AtLeastOneNodeChecked(); // C2017-030 support for Refresh Transitions/Update RO Values
} }
@ -911,12 +956,16 @@ namespace VEPROMS
foreach (TreeNode tn in treeNode.Nodes) foreach (TreeNode tn in treeNode.Nodes)
{ {
tn.Checked = ischecked; tn.Checked = ischecked;
if (tn.Nodes.Count > 0) if (tn.Nodes.Count > 0)
{
CheckChildNodes(tn, ischecked); CheckChildNodes(tn, ischecked);
} }
} }
}
private ProgressBarItem _ProgressBar = null; private ProgressBarItem _ProgressBar = null;
public ProgressBarItem ProgressBar public ProgressBarItem ProgressBar
{ {
get { return _ProgressBar; } get { return _ProgressBar; }
@ -930,9 +979,11 @@ namespace VEPROMS
private void DoProgressBarRefresh(int value, int max, string text) private void DoProgressBarRefresh(int value, int max, string text)
{ {
if (ProgressBar == null) return; if (ProgressBar == null) return;
ProgressBar.Maximum = max; ProgressBar.Maximum = max;
ProgressBar.Value = value; ProgressBar.Value = value;
ProgressBar.Text = text; ProgressBar.Text = text;
Application.DoEvents(); Application.DoEvents();
} }
@ -941,12 +992,14 @@ namespace VEPROMS
set set
{ {
if (ProgressBar == null) return; if (ProgressBar == null) return;
ProgressBar.Maximum = 100; ProgressBar.Maximum = 100;
ProgressBar.Value = 0; ProgressBar.Value = 0;
ProgressBar.Text = value; ProgressBar.Text = value;
txtProcess.AppendText(value); txtProcess.AppendText(value);
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
Application.DoEvents(); Application.DoEvents();
} }
} }
@ -956,12 +1009,14 @@ namespace VEPROMS
set set
{ {
if (ProgressBar == null) return; if (ProgressBar == null) return;
ProgressBar.Value = 100; ProgressBar.Value = 100;
ProgressBar.Maximum = 100; ProgressBar.Maximum = 100;
ProgressBar.Text = value; ProgressBar.Text = value;
txtProcess.AppendText(value); txtProcess.AppendText(value);
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
Application.DoEvents(); Application.DoEvents();
} }
} }
@ -985,8 +1040,11 @@ namespace VEPROMS
AdminToolType = E_AdminToolType.Repair; AdminToolType = E_AdminToolType.Repair;
lblAdmToolProgressType.Text = "Repairing:"; lblAdmToolProgressType.Text = "Repairing:";
setupProgessSteps1(); setupProgessSteps1();
if (!IsAdministratorUser) // C2020-035 notify Set Amin user that only Full Admins can run repair tools if (!IsAdministratorUser) // C2020-035 notify Set Amin user that only Full Admins can run repair tools
MessageBox.Show("Only Full PROMS Administrator Users can run these data repair tools","Data Repair Tools",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); {
MessageBox.Show("Only Full PROMS Administrator Users can run these data repair tools", "Data Repair Tools", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
} }
// C2017-030 new Admin Tools user interface // C2017-030 new Admin Tools user interface
@ -994,6 +1052,7 @@ namespace VEPROMS
{ {
AdminToolType = E_AdminToolType.Links; AdminToolType = E_AdminToolType.Links;
setupProgessSteps1(); setupProgessSteps1();
if (swUpdateROVals.Value) if (swUpdateROVals.Value)
ResetTV(true); ResetTV(true);
else else
@ -1014,6 +1073,7 @@ namespace VEPROMS
} }
#region On/Off Swiches #region On/Off Swiches
// C2017-030 new Admin Tools user interface // C2017-030 new Admin Tools user interface
private enum E_AdminToolType : int private enum E_AdminToolType : int
{ {
@ -1035,6 +1095,7 @@ namespace VEPROMS
{ {
progressSteps1.Visible = false; progressSteps1.Visible = false;
progressSteps1.Items.Clear(); progressSteps1.Items.Clear();
switch (AdminToolType) switch (AdminToolType)
{ {
case E_AdminToolType.Check: case E_AdminToolType.Check:
@ -1048,6 +1109,7 @@ namespace VEPROMS
progressSteps1.Visible = true; progressSteps1.Visible = true;
progressSteps1.Refresh(); progressSteps1.Refresh();
break; break;
case E_AdminToolType.Repair: case E_AdminToolType.Repair:
if (swRmOrphanDataRecs.Value) if (swRmOrphanDataRecs.Value)
progressSteps1.Items.Add(siOrphDatRecs); progressSteps1.Items.Add(siOrphDatRecs);
@ -1061,6 +1123,7 @@ namespace VEPROMS
progressSteps1.Visible = true; progressSteps1.Visible = true;
progressSteps1.Refresh(); progressSteps1.Refresh();
break; break;
case E_AdminToolType.Links: case E_AdminToolType.Links:
case E_AdminToolType.Users: case E_AdminToolType.Users:
splitContainer3.Panel2Collapsed = true; splitContainer3.Panel2Collapsed = true;
@ -1068,6 +1131,7 @@ namespace VEPROMS
break; break;
} }
} }
// used for all of the Switch buttons (ON/OFF buttons) // used for all of the Switch buttons (ON/OFF buttons)
private void swCk_ValueChanged(object sender, EventArgs e) private void swCk_ValueChanged(object sender, EventArgs e)
{ {
@ -1091,6 +1155,7 @@ namespace VEPROMS
ResetTV(false); ResetTV(false);
} }
} }
#endregion #endregion
// C2017-030 New Admin Tools user interface // C2017-030 New Admin Tools user interface
@ -1100,15 +1165,17 @@ namespace VEPROMS
((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val; ((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
return; return;
} }
private void ClearStepProgress() private void ClearStepProgress()
{ {
for (int i = 0; i < progressSteps1.Items.Count; i++) for (int i = 0; i < progressSteps1.Items.Count; i++)
{
((DevComponents.DotNetBar.StepItem)progressSteps1.Items[i]).Value = 0; ((DevComponents.DotNetBar.StepItem)progressSteps1.Items[i]).Value = 0;
} }
}
// C2017-030 New Admin Tools user interface // C2017-030 New Admin Tools user interface
// button clicks for processing selected tools // button clicks for processing selected tools
//B2017-221 Allow the batch dialog to close when waiting to process. //B2017-221 Allow the batch dialog to close when waiting to process.
private bool CheckProcessLater() // see if we should delay processing until later private bool CheckProcessLater() // see if we should delay processing until later
{ {
@ -1116,6 +1183,7 @@ namespace VEPROMS
{ {
long later = long.Parse(dtpDate.Value.ToString("yyyyMMdd") + dtpTime.Value.ToString("HHmm")); long later = long.Parse(dtpDate.Value.ToString("yyyyMMdd") + dtpTime.Value.ToString("HHmm"));
long now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); long now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
while (now < later) while (now < later)
{ {
txtProcess.Clear(); txtProcess.Clear();
@ -1126,6 +1194,7 @@ namespace VEPROMS
now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
} }
} }
return true;// Close after complete return true;// Close after complete
} }
@ -1133,18 +1202,23 @@ namespace VEPROMS
private void btn_ShowUsers_Click(object sender, EventArgs e) private void btn_ShowUsers_Click(object sender, EventArgs e)
{ {
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process. if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
txtProcess.Clear(); txtProcess.Clear();
txtResults.Clear(); txtResults.Clear();
GetDatabaseSessions(); GetDatabaseSessions();
} }
private void btnFixLinks_Click(object sender, EventArgs e) private void btnFixLinks_Click(object sender, EventArgs e)
{ {
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process. if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
txtProcess.Clear(); txtProcess.Clear();
txtResults.Clear(); txtResults.Clear();
if (swRefreshTrans.Value) if (swRefreshTrans.Value)
RefreshTransitions(); RefreshTransitions();
if (swUpdateROVals.Value) if (swUpdateROVals.Value)
UpdateROValues(); UpdateROValues();
} }
@ -1152,21 +1226,25 @@ namespace VEPROMS
private void btnRunCheck_Click(object sender, EventArgs e) private void btnRunCheck_Click(object sender, EventArgs e)
{ {
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process. if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
int prgStpIdx = -1; int prgStpIdx = -1;
txtResults.Clear(); txtResults.Clear();
txtProcess.Clear(); txtProcess.Clear();
if (swCkOrphanDataRecs.Value) if (swCkOrphanDataRecs.Value)
{ {
StepProgress(++prgStpIdx, 50); StepProgress(++prgStpIdx, 50);
IdentifyDisconnectedItems(); // orphan items IdentifyDisconnectedItems(); // orphan items
StepProgress(prgStpIdx, 100); StepProgress(prgStpIdx, 100);
} }
if (swHiddenDataLocs.Value) if (swHiddenDataLocs.Value)
{ {
StepProgress(++prgStpIdx, 50); StepProgress(++prgStpIdx, 50);
IdentifyNonEditableItems(); // hidden items IdentifyNonEditableItems(); // hidden items
StepProgress(prgStpIdx, 100); StepProgress(prgStpIdx, 100);
} }
if (swCkObsoleteROData.Value) if (swCkObsoleteROData.Value)
{ {
StepProgress(++prgStpIdx, 25); StepProgress(++prgStpIdx, 25);
@ -1175,22 +1253,27 @@ namespace VEPROMS
IdentifyUnusedRoFstsAndFigures(); IdentifyUnusedRoFstsAndFigures();
StepProgress(prgStpIdx, 100); StepProgress(prgStpIdx, 100);
} }
MessageBox.Show("Check Functions Completed", "Check"); MessageBox.Show("Check Functions Completed", "Check");
ClearStepProgress(); ClearStepProgress();
} }
private void btnRunRepair_Click(object sender, EventArgs e) private void btnRunRepair_Click(object sender, EventArgs e)
{ {
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process. if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
int prgStpIdx = -1; int prgStpIdx = -1;
txtResults.Clear(); txtResults.Clear();
txtProcess.Clear(); txtProcess.Clear();
if (swRmOrphanDataRecs.Value) if (swRmOrphanDataRecs.Value)
{ {
StepProgress(++prgStpIdx, 50); StepProgress(++prgStpIdx, 50);
PurgeDisconnectedItems(); // Orphan Items PurgeDisconnectedItems(); // Orphan Items
StepProgress(prgStpIdx, 100); StepProgress(prgStpIdx, 100);
} }
if (swRmObsoleteROData.Value) if (swRmObsoleteROData.Value)
{ {
StepProgress(++prgStpIdx, 25); StepProgress(++prgStpIdx, 25);
@ -1199,12 +1282,14 @@ namespace VEPROMS
RemoveUnusedRoFstsAndFigures(); RemoveUnusedRoFstsAndFigures();
StepProgress(prgStpIdx, 100); StepProgress(prgStpIdx, 100);
} }
if (swStandardHypenChars.Value) if (swStandardHypenChars.Value)
{ {
StepProgress(++prgStpIdx, 50); StepProgress(++prgStpIdx, 50);
FixHyphens(); FixHyphens();
StepProgress(prgStpIdx, 100); StepProgress(prgStpIdx, 100);
} }
if (swRefreshWordAttmts.Value) if (swRefreshWordAttmts.Value)
{ {
StepProgress(++prgStpIdx, 50); StepProgress(++prgStpIdx, 50);
@ -1213,6 +1298,7 @@ namespace VEPROMS
} }
MessageBox.Show("Repair Functions Completed", "Repair"); MessageBox.Show("Repair Functions Completed", "Repair");
ClearStepProgress(); ClearStepProgress();
} }

View File

@ -86,28 +86,37 @@ namespace VEPROMS
{ {
// B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic // B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic
ProcedureInfo MyProcedure = myItem as ProcedureInfo; ProcedureInfo MyProcedure = myItem as ProcedureInfo;
if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier) if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier)
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
else else
MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID); MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID);
// B2021-102 moved the baseline meta file write here too - should have been done with B2021-088 fix // B2021-102 moved the baseline meta file write here too - should have been done with B2021-088 fix
// C2018-015 add the procedure tree path and the procedure number and title to the meta file // C2018-015 add the procedure tree path and the procedure number and title to the meta file
if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0}", MyProcedure.SearchDVPath.Replace("\a", " | ")); if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0}", MyProcedure.SearchDVPath.Replace("\a", " | "));
if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0} | {1}", MyProcedure.DisplayNumber, MyProcedure.DisplayText); if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0} | {1}", MyProcedure.DisplayNumber, MyProcedure.DisplayText);
myItem = MyProcedure; myItem = MyProcedure;
Prefix = prefix; Prefix = prefix;
OpenPDF = openPDF; OpenPDF = openPDF;
DidAll = didAll; DidAll = didAll;
InitializeComponent(); InitializeComponent();
// if the version number of PROMS is 1.0, then we are running a Demo version. // if the version number of PROMS is 1.0, then we are running a Demo version.
// When running a Demo version, force a "Sample" watermark when printing. // When running a Demo version, force a "Sample" watermark when printing.
// B2020-022 append a ".pdf" extension if the file name does on have one. // B2020-022 append a ".pdf" extension if the file name does on have one.
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF"))?pdfFile:pdfFile+".pdf", insertBlankPages, allOrAuto,Prefix,saveLinks,removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor); MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF"))?pdfFile:pdfFile+".pdf", insertBlankPages, allOrAuto,Prefix,saveLinks,removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor);
MyPromsPrinter.PromsVersion = (showPROMSVer) ? AboutVEPROMS.PROMSVersion : ""; //C2018-009 print PROMS version MyPromsPrinter.PromsVersion = (showPROMSVer) ? AboutVEPROMS.PROMSVersion : ""; //C2018-009 print PROMS version
PDFPath = pdfPath; PDFPath = pdfPath;
this.Text = "Creating PDF of " + myItem.DisplayNumber; this.Text = "Creating PDF of " + myItem.DisplayNumber;
_NewLocation = newLocation; _NewLocation = newLocation;
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
public static void SetUnitWatermark(ProcedureInfo procInfo, ref string waterMarkText, ref string watermarkColor) public static void SetUnitWatermark(ProcedureInfo procInfo, ref string waterMarkText, ref string watermarkColor)
@ -156,6 +165,7 @@ namespace VEPROMS
} }
void pp_StatusChanged(object sender, PromsPrintStatusArgs args) void pp_StatusChanged(object sender, PromsPrintStatusArgs args)
{ {
if (args.Type == PromsPrinterStatusType.ProgressSetup) if (args.Type == PromsPrinterStatusType.ProgressSetup)
pb.Maximum = args.Progress; pb.Maximum = args.Progress;
else if (args.Type == PromsPrinterStatusType.Progress) else if (args.Type == PromsPrinterStatusType.Progress)
@ -168,6 +178,7 @@ namespace VEPROMS
} }
MyStatus = args.MyStatus; MyStatus = args.MyStatus;
Application.DoEvents(); Application.DoEvents();
} }
public string MyStatus public string MyStatus
{ {
@ -210,13 +221,17 @@ namespace VEPROMS
tmrRun.Enabled = false; tmrRun.Enabled = false;
if (CancelStop) btnCancel.Visible = true; if (CancelStop) btnCancel.Visible = true;
Application.DoEvents(); Application.DoEvents();
MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged); MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
MyPromsPrinter.DocReplace = DocReplace; // used when approve generates an export with unlinked ROs and Transitions MyPromsPrinter.DocReplace = DocReplace; // used when approve generates an export with unlinked ROs and Transitions
DateTime tStart = DateTime.Now; DateTime tStart = DateTime.Now;
if (!CancelStop) PromsPrinter.ClearTransPageNumProblems(); if (!CancelStop) PromsPrinter.ClearTransPageNumProblems();
// B2018-029: delete any pdf files related to printing supplemental information facing pages: // B2018-029: delete any pdf files related to printing supplemental information facing pages:
// B2018-039 Delete only pdf files that begin with "SupInof" // B2018-039 Delete only pdf files that begin with "SupInof"
string[] filePaths = System.IO.Directory.GetFiles(Volian.Base.Library.VlnSettings.TemporaryFolder, "SupInfo*.pdf"); string[] filePaths = System.IO.Directory.GetFiles(Volian.Base.Library.VlnSettings.TemporaryFolder, "SupInfo*.pdf");
foreach (string filePath in filePaths) System.IO.File.Delete(filePath); foreach (string filePath in filePaths) System.IO.File.Delete(filePath);
do do
@ -224,46 +239,59 @@ namespace VEPROMS
int profileDepth = ProfileTimer.Push(">>>> MyPromsPrinter.Print"); int profileDepth = ProfileTimer.Push(">>>> MyPromsPrinter.Print");
// B2018-099: remove cache items for contents, items and parts to prevent out of memory errors when // B2018-099: remove cache items for contents, items and parts to prevent out of memory errors when
// doing print all or automated print testing or approval of some or all procedures, i.e. HashSet and use of them below. // doing print all or automated print testing or approval of some or all procedures, i.e. HashSet and use of them below.
HashSet<int> cacheContentInfo = null; HashSet<int> cacheContentInfo = null;
HashSet<int> cacheItemInfo = null; HashSet<int> cacheItemInfo = null;
HashSet<int> cachePartInfo = null; HashSet<int> cachePartInfo = null;
if (DidAll) if (DidAll)
{ {
cacheContentInfo = ContentInfo.CacheList; cacheContentInfo = ContentInfo.CacheList;
cacheItemInfo = ItemInfo.CacheList; cacheItemInfo = ItemInfo.CacheList;
cachePartInfo = PartInfo.CacheList; cachePartInfo = PartInfo.CacheList;
} }
_PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary); _PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary);
ProfileTimer.Pop(profileDepth); ProfileTimer.Pop(profileDepth);
if (DidAll) if (DidAll)
{ {
ContentInfo.RestoreCacheList(cacheContentInfo); ContentInfo.RestoreCacheList(cacheContentInfo);
ItemInfo.RestoreCacheList(cacheItemInfo); ItemInfo.RestoreCacheList(cacheItemInfo);
PartInfo.RestoreCacheList(cachePartInfo); PartInfo.RestoreCacheList(cachePartInfo);
} }
} }
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes); while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
if (_PdfFile == null) if (_PdfFile == null)
{ {
this.Close(); this.Close();
return; return;
} }
if (!CancelStop) if (!CancelStop)
{ {
if (PromsPrinter.ReportTransPageNumProblems() == DialogResult.Yes && MyPromsPrinter.BeforePageNumberPdf != null) if (PromsPrinter.ReportTransPageNumProblems() == DialogResult.Yes && MyPromsPrinter.BeforePageNumberPdf != null)
{ {
System.Diagnostics.Process.Start(MyPromsPrinter.BeforePageNumberPdf); System.Diagnostics.Process.Start(MyPromsPrinter.BeforePageNumberPdf);
// C2017-018 - Open Pass 2 output if it exists // C2017-018 - Open Pass 2 output if it exists
if (MyPromsPrinter.BeforePageNumber2Pdf != null) System.Diagnostics.Process.Start(MyPromsPrinter.BeforePageNumber2Pdf); if (MyPromsPrinter.BeforePageNumber2Pdf != null) System.Diagnostics.Process.Start(MyPromsPrinter.BeforePageNumber2Pdf);
} }
} }
DateTime tEnd = DateTime.Now; DateTime tEnd = DateTime.Now;
MyStatus = _PdfFile + " created."; MyStatus = _PdfFile + " created.";
MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds)); MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));
if (OpenPDF) if (OpenPDF)
{ {
OpenPDFandPlacekeeper(_PdfFile); OpenPDFandPlacekeeper(_PdfFile);
this.Close(); this.Close();
// C2021-010: Remove trailing returns/spaces & manual page breaks & allow save. Ask if user wants to save chanages // C2021-010: Remove trailing returns/spaces & manual page breaks & allow save. Ask if user wants to save chanages
// if they were found. // if they were found.
if ((MyPromsPrinter.RemoveManualPageBreaks != null && MyPromsPrinter.RemoveManualPageBreaks.Count > 0) if ((MyPromsPrinter.RemoveManualPageBreaks != null && MyPromsPrinter.RemoveManualPageBreaks.Count > 0)
@ -281,6 +309,7 @@ namespace VEPROMS
} }
return; return;
} }
btnOpenFolder.Visible = btnOpenPDF.Visible = true; btnOpenFolder.Visible = btnOpenPDF.Visible = true;
if (CloseWhenDone) if (CloseWhenDone)
@ -290,11 +319,13 @@ namespace VEPROMS
return; return;
} }
} }
private void btnOpenPDF_Click(object sender, EventArgs e) private void btnOpenPDF_Click(object sender, EventArgs e)
{ {
OpenPDFandPlacekeeper(_PdfFile); OpenPDFandPlacekeeper(_PdfFile);
this.Close(); this.Close();
} }
// set a delay so that the word document containing the newly generated placekeeper will appear on top of everything else. // set a delay so that the word document containing the newly generated placekeeper will appear on top of everything else.
// - requested by Calvert Cliffs // - requested by Calvert Cliffs
private void OpenPDFandPlacekeeper(string pdffile) private void OpenPDFandPlacekeeper(string pdffile)
@ -304,32 +335,41 @@ namespace VEPROMS
if ((pdffile ?? "") != "" && !OnlyShowContinuousActionSummary) if ((pdffile ?? "") != "" && !OnlyShowContinuousActionSummary)
{ {
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(pdffile); System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(pdffile);
if (sdp != null) if (sdp != null)
sdp.WaitForInputIdle(); sdp.WaitForInputIdle();
} }
if (OnlyShowContinuousActionSummary) if (OnlyShowContinuousActionSummary)
System.IO.File.Delete(pdffile); // remove the temporary PDF file used to create the Continuous Action Summary System.IO.File.Delete(pdffile); // remove the temporary PDF file used to create the Continuous Action Summary
if (MyPromsPrinter.MyPlacekeeper != null) if (MyPromsPrinter.MyPlacekeeper != null)
{ {
// The PlacekeeperDelay is a switch that can be added to the PROMS.exe shortcut // The PlacekeeperDelay is a switch that can be added to the PROMS.exe shortcut
// ex: VEPROMS.EXE /PlacekeeperDelay=2.5 will delay it 2 1/2 seconds // ex: VEPROMS.EXE /PlacekeeperDelay=2.5 will delay it 2 1/2 seconds
float delay = Volian.Base.Library.VlnSettings.GetCommandFloat("PlacekeeperDelay", 3.0f); float delay = Volian.Base.Library.VlnSettings.GetCommandFloat("PlacekeeperDelay", 3.0f);
int mydelay = (int)(1000 * delay); int mydelay = (int)(1000 * delay);
System.Threading.Thread.Sleep(mydelay); System.Threading.Thread.Sleep(mydelay);
MyPromsPrinter.MyPlacekeeper.Visible(); MyPromsPrinter.MyPlacekeeper.Visible();
} }
// this will display the generated Continuous Action Summary in MS Word (starting a new instance of MS Word outside of PROMS) // this will display the generated Continuous Action Summary in MS Word (starting a new instance of MS Word outside of PROMS)
if (MyPromsPrinter.MyContActSummary != null) if (MyPromsPrinter.MyContActSummary != null)
{ {
string instructions = "The Continuous Action Summary will be opened in MS Word.\n\nYou can make modifications and copy it into a PROMS Word section."; string instructions = "The Continuous Action Summary will be opened in MS Word.\n\nYou can make modifications and copy it into a PROMS Word section.";
MessageBox.Show(instructions, "Continuous Action Summary"); MessageBox.Show(instructions, "Continuous Action Summary");
// The ContActSummaryDelay is a switch that can be added to the PROMS.exe shortcut // The ContActSummaryDelay is a switch that can be added to the PROMS.exe shortcut
// ex: VEPROMS.EXE /ContActSummaryDelay=2.5 will delay it 2 1/2 seconds // ex: VEPROMS.EXE /ContActSummaryDelay=2.5 will delay it 2 1/2 seconds
float delay = Volian.Base.Library.VlnSettings.GetCommandFloat("ContActSummaryDelay", 1.0f); float delay = Volian.Base.Library.VlnSettings.GetCommandFloat("ContActSummaryDelay", 1.0f);
int mydelay = (int)(1000 * delay); int mydelay = (int)(1000 * delay);
System.Threading.Thread.Sleep(mydelay); System.Threading.Thread.Sleep(mydelay);
MyPromsPrinter.MyContActSummary.Visible(); MyPromsPrinter.MyContActSummary.Visible();
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -337,12 +377,14 @@ namespace VEPROMS
MessageBox.Show(str, "Error Opening PDFFile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); MessageBox.Show(str, "Error Opening PDFFile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
} }
} }
private void btnOpenFolder_Click(object sender, EventArgs e) private void btnOpenFolder_Click(object sender, EventArgs e)
{ {
System.Diagnostics.Process.Start("Explorer", "/select," + _PdfFile); System.Diagnostics.Process.Start("Explorer", "/select," + _PdfFile);
OpenPDFandPlacekeeper(null); OpenPDFandPlacekeeper(null);
this.Close(); this.Close();
} }
private void btnCancel_Click(object sender, EventArgs e) private void btnCancel_Click(object sender, EventArgs e)
{ {
CancelPrinting = true; CancelPrinting = true;

View File

@ -348,6 +348,8 @@ namespace VEPROMS
tc.SeparateWindows = Properties.Settings.Default.SeparateWindows; tc.SeparateWindows = Properties.Settings.Default.SeparateWindows;
tv.PauseRefresh += tv_PauseRefresh; tv.PauseRefresh += tv_PauseRefresh;
tv.UnPauseRefresh += tv_UnPauseRefresh; tv.UnPauseRefresh += tv_UnPauseRefresh;
} }
void displaySearch1_SearchComplete(object sender, DisplaySearchEventArgs args) void displaySearch1_SearchComplete(object sender, DisplaySearchEventArgs args)
{ {
@ -2768,6 +2770,7 @@ namespace VEPROMS
private void tmrTreeView_Tick(object sender, EventArgs e) private void tmrTreeView_Tick(object sender, EventArgs e)
{ {
_TimeActivity2.Open(); _TimeActivity2.Open();
bool giveTvFocus = true; bool giveTvFocus = true;
tmrTreeView.Enabled = false; // Timer has now fired tmrTreeView.Enabled = false; // Timer has now fired
@ -3231,6 +3234,7 @@ namespace VEPROMS
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : displayRO.MyRTB = (SelectedStepTabPanel == null) ? null :
SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.ProgressBar = bottomProgBar; displayRO.ProgressBar = bottomProgBar;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
} }
#endregion #endregion
#region InfoTabTransition #region InfoTabTransition
@ -3385,6 +3389,8 @@ namespace VEPROMS
} }
private void tc_SelectedDisplayTabItemChanged(object sender, EventArgs args) private void tc_SelectedDisplayTabItemChanged(object sender, EventArgs args)
{ {
if (tc.ShuttingDown) return; // B2022-026 RO Memory Reduction code - to prevent refreshing the RO tree again
// If the current procedure or section in the treeview doesn't match then change the treeview selection. // If the current procedure or section in the treeview doesn't match then change the treeview selection.
//jcb added for error B2012-117 //jcb added for error B2012-117
ItemInfo tvii; ItemInfo tvii;
@ -3413,7 +3419,10 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode); SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem; displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{
displayRO.MyROFSTLookup = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion); displayRO.MyROFSTLookup = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion);
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
}
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole; lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1) if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1)
btnPrint.Visible = false; btnPrint.Visible = false;
@ -3471,21 +3480,19 @@ namespace VEPROMS
private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args) private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{ {
tc.HideTheCaret(); tc.HideTheCaret();
//if (args.MyEditItem != null)
//Volian.Base.Library.vlnStackTrace.ShowStackLocal(2,10,"Edit item {0}, Step Panel {1}",args.MyEditItem.MyStepRTB.ContainsFocus, args.MyEditItem.MyStepPanel.ContainsFocus); if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus) return; return;
//if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
//{
// _RefreshRTB = args.MyEditItem.MyStepRTB;
// TmrRefreshItem.Enabled = true;
// return;
//}
btnFixMSWord.Visible = (args != null && ( args.MyItemInfo != null && args.MyEditItem == null)); btnFixMSWord.Visible = (args != null && ( args.MyItemInfo != null && args.MyEditItem == null));
if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed) if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed)
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged); _LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
_LastStepRTB = args != null && args.MyEditItem != null ? args.MyEditItem.MyStepRTB : null; _LastStepRTB = args != null && args.MyEditItem != null ? args.MyEditItem.MyStepRTB : null;
if (_LastStepRTB != null) _LastStepRTB.EditModeChanged += new StepRTBEvent(_LastStepRTB_EditModeChanged); if (_LastStepRTB != null) _LastStepRTB.EditModeChanged += new StepRTBEvent(_LastStepRTB_EditModeChanged);
lblEditView.Text = " "; lblEditView.Text = " ";
if (args == null) if (args == null)
{ {
_CurrentItem = null; _CurrentItem = null;
@ -3507,12 +3514,13 @@ namespace VEPROMS
{ {
lblItemID.Text = string.Format("ItemID = {0}", args.MyItemInfo.ItemID); lblItemID.Text = string.Format("ItemID = {0}", args.MyItemInfo.ItemID);
lblItemID.ForeColor = Color.DarkBlue; lblItemID.ForeColor = Color.DarkBlue;
if (_CurrentItem != args.MyItemInfo) if (_CurrentItem != args.MyItemInfo)
{ {
if (_CurrentItem != null) _CurrentItem.Deleted -= new ItemInfoEvent(_CurrentItem_Deleted); if (_CurrentItem != null) _CurrentItem.Deleted -= new ItemInfoEvent(_CurrentItem_Deleted);
_CurrentItem = args.MyItemInfo; _CurrentItem = args.MyItemInfo;
} }
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
if (args.MyEditItem == null) if (args.MyEditItem == null)
{ {
ctrlAnnotationDetails.Enabled = false; ctrlAnnotationDetails.Enabled = false;
@ -3520,12 +3528,15 @@ namespace VEPROMS
infotabFoldoutMaint.Visible = false; infotabFoldoutMaint.Visible = false;
infotabTransition.Visible = false; infotabTransition.Visible = false;
infotabRO.Visible = false; infotabRO.Visible = false;
if (args.MyItemInfo.MyDocVersion.DocVersionAssociations != null) if (args.MyItemInfo.MyDocVersion.DocVersionAssociations != null)
{ {
displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
displayRO.MyRTB = null; displayRO.MyRTB = null;
infotabRO.Visible = true; infotabRO.Visible = true;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
} }
infotabTags.Visible = false; infotabTags.Visible = false;
infotabApplicability.Visible = false; infotabApplicability.Visible = false;
// Not sure why but the following line was causing a hang if // Not sure why but the following line was causing a hang if
@ -3613,10 +3624,14 @@ namespace VEPROMS
displayTags.MyEditItem = args.MyEditItem; displayTags.MyEditItem = args.MyEditItem;
displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ?
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text; E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0) if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0]; displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
if (_LastStepRTB.IsRoFigure && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0) if (_LastStepRTB.IsRoFigure && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0]; displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
// if this is an enhanced step (linked from a source document), don't bring up the ro or transition panel, // if this is an enhanced step (linked from a source document), don't bring up the ro or transition panel,
// and don't allow replace on the find/replace dialog. // and don't allow replace on the find/replace dialog.
if (args.MyItemInfo.IsEnhancedStep) if (args.MyItemInfo.IsEnhancedStep)
@ -3642,6 +3657,7 @@ namespace VEPROMS
displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
} }
displayRO.ROTypeFilter = E_ROValueType.All; // allow all RO types for Word attachments (but fix) displayRO.ROTypeFilter = E_ROValueType.All; // allow all RO types for Word attachments (but fix)
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
displayRO.SetFindDocROButton(true); displayRO.SetFindDocROButton(true);
} }
} }
@ -3654,8 +3670,10 @@ namespace VEPROMS
{ {
ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); // set the CurrentItem (send Message) when the MSWord section is opened. ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); // set the CurrentItem (send Message) when the MSWord section is opened.
} }
btnPrint.Enabled = (_CurrentItem != null); btnPrint.Enabled = (_CurrentItem != null);
} }
/*KBR:Timer _tmrSetTransROInVisible; /*KBR:Timer _tmrSetTransROInVisible;
public Timer TmrSetTransROInVisible public Timer TmrSetTransROInVisible
{ {
@ -3750,6 +3768,7 @@ namespace VEPROMS
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image: E_ROValueType.Text; E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image: E_ROValueType.Text;
//displayRO.Mydvi = SelectedDVI; //displayRO.Mydvi = SelectedDVI;
displayRO.ProgressBar = bottomProgBar; displayRO.ProgressBar = bottomProgBar;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
} }
#endregion #endregion
#region VButton #region VButton

File diff suppressed because it is too large Load Diff

View File

@ -50,9 +50,9 @@ namespace VEPROMS.CSLA.Library
{ {
// B2018-002 - Invalid Transitions - Handle Range Transitions // B2018-002 - Invalid Transitions - Handle Range Transitions
int loc1 = Text.IndexOf("#Link:Transition:", 0); int loc1 = Text.IndexOf("#Link:Transition:", 0);
if(loc1 > 0) loc1+=("#Link:Transition:").Length; if (loc1 > 0) loc1 += ("#Link:Transition:").Length;
else else
loc1 = Text.IndexOf("#Link:TransitionRange:", 0)+ ("#Link:TransitionRange:").Length;; loc1 = Text.IndexOf("#Link:TransitionRange:", 0) + ("#Link:TransitionRange:").Length; ;
int loc2 = Text.IndexOf(" ", loc1); int loc2 = Text.IndexOf(" ", loc1);
string trantype = Text.Substring(loc1, loc2 - loc1); string trantype = Text.Substring(loc1, loc2 - loc1);
loc1 = loc2 + 1; loc1 = loc2 + 1;
@ -90,7 +90,7 @@ namespace VEPROMS.CSLA.Library
if (tran == null) prefix = "Invalid "; if (tran == null) prefix = "Invalid ";
Annotation.MakeAnnotation(myitem, AnnotationType.GetByNameOrCreate("Link Converted To Text"), "", prefix + string.Format("Transition ({0}) converted to text", ItemInfo.ConvertToDisplayText(gg)), null); Annotation.MakeAnnotation(myitem, AnnotationType.GetByNameOrCreate("Link Converted To Text"), "", prefix + string.Format("Transition ({0}) converted to text", ItemInfo.ConvertToDisplayText(gg)), null);
} }
if(tran != null) if (tran != null)
Transition.Delete(tran.TransitionID); Transition.Delete(tran.TransitionID);
didFixATransition = true; // B2017-076 return Transitions were processed (used when importing a procedure) didFixATransition = true; // B2017-076 return Transitions were processed (used when importing a procedure)
break; break;
@ -133,11 +133,11 @@ namespace VEPROMS.CSLA.Library
} }
string gg = MyGrid.Data.Substring(myIndex, myLength); string gg = MyGrid.Data.Substring(myIndex, myLength);
if (newvalue.Contains(@"\u8209?")) // process dash if (newvalue.Contains(@"\u8209?")) // process dash
newvalue = ProcessSpecChar(gg, newvalue, @"\u8209?","-"); newvalue = ProcessSpecChar(gg, newvalue, @"\u8209?", "-");
if (newvalue.Contains(@"\u8593?")) // process carrot/delta if (newvalue.Contains(@"\u8593?")) // process carrot/delta
newvalue = ProcessSpecChar(gg, newvalue, @"\u8593?","^"); newvalue = ProcessSpecChar(gg, newvalue, @"\u8593?", "^");
if (newvalue.Contains(@"\u9586?")) // process backslash if (newvalue.Contains(@"\u9586?")) // process backslash
newvalue = ProcessSpecChar(gg, newvalue, @"\u9586?",@"\\"); newvalue = ProcessSpecChar(gg, newvalue, @"\u9586?", @"\\");
if (gg != newvalue) if (gg != newvalue)
{ {
if (newvalue == "?") if (newvalue == "?")
@ -393,7 +393,7 @@ namespace VEPROMS.CSLA.Library
if (tText.Contains(@"\fs")) if (tText.Contains(@"\fs"))
{ {
tText = Regex.Replace(tText, @"\\v\\fs[0-9]+ ", "\\v "); tText = Regex.Replace(tText, @"\\v\\fs[0-9]+ ", "\\v ");
start = tText.IndexOf("<START]",Math.Max(lastIndex - 3,0)); //B2021-054 start looking from the last index or zero - which ever is greater start = tText.IndexOf("<START]", Math.Max(lastIndex - 3, 0)); //B2021-054 start looking from the last index or zero - which ever is greater
} }
string defPrefix = tText.Substring(start - 3, 3); string defPrefix = tText.Substring(start - 3, 3);
if (defPrefix != @"\v ") throw new Exception(string.Format("rtf string {0} does not match expected format", defPrefix)); if (defPrefix != @"\v ") throw new Exception(string.Format("rtf string {0} does not match expected format", defPrefix));
@ -406,7 +406,7 @@ namespace VEPROMS.CSLA.Library
if (lastSlash <= lastSpace) //this will return "\v " if (lastSlash <= lastSpace) //this will return "\v "
return defPrefix; return defPrefix;
txt = txt.Substring(lastSlash); txt = txt.Substring(lastSlash);
if(txt.StartsWith(@"\'")) //this is a hex if (txt.StartsWith(@"\'")) //this is a hex
return defPrefix; return defPrefix;
if (Regex.IsMatch(txt, @"\\u[0-9].*")) //this is unicode if (Regex.IsMatch(txt, @"\\u[0-9].*")) //this is unicode
return defPrefix; return defPrefix;
@ -459,7 +459,7 @@ namespace VEPROMS.CSLA.Library
if (suffix == @"\v0 ") if (suffix == @"\v0 ")
part3 = part3.Substring(4); part3 = part3.Substring(4);
else else
part3 = suffix.Replace(@"\v0","") + part3.Substring(suffix.Length); part3 = suffix.Replace(@"\v0", "") + part3.Substring(suffix.Length);
if (gg.Contains(@"\u8209?")) if (gg.Contains(@"\u8209?"))
{ {
Match mmm = Regex.Match(gg, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match mmm = Regex.Match(gg, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
@ -625,12 +625,12 @@ namespace VEPROMS.CSLA.Library
{ {
int myIndex = m.Groups[4].Index + mm.Index; int myIndex = m.Groups[4].Index + mm.Index;
int myLength = m.Groups[4].Length; int myLength = m.Groups[4].Length;
if(m.Groups[3].Value != " ") if (m.Groups[3].Value != " ")
{ {
myIndex = m.Groups[3].Index + mm.Index; myIndex = m.Groups[3].Index + mm.Index;
myLength += m.Groups[3].Length; myLength += m.Groups[3].Length;
} }
string gg = Text.Substring(myIndex,myLength); string gg = Text.Substring(myIndex, myLength);
if (((fileNameOnly == null) && (MakeConsistentFormat(gg) != MakeConsistentFormat(newvalue))) || ((fileNameOnly != null) && !(gg.Replace(@"\u8209?", "-").StartsWith(fileNameOnly) && newvalue.Replace(@"\u8209?", "-").StartsWith(fileNameOnly)))) if (((fileNameOnly == null) && (MakeConsistentFormat(gg) != MakeConsistentFormat(newvalue))) || ((fileNameOnly != null) && !(gg.Replace(@"\u8209?", "-").StartsWith(fileNameOnly) && newvalue.Replace(@"\u8209?", "-").StartsWith(fileNameOnly))))
{ {
retval = gg; retval = gg;
@ -728,11 +728,13 @@ namespace VEPROMS.CSLA.Library
// replace degree, bullet dash, hardspace // replace degree, bullet dash, hardspace
return ROFSTLookup.ConvertFortranFormatToScienctificNotation(gg).Replace("`", @"\'B0").Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ").Replace(@"\'a0", " ").Replace(@"\'A0", " "); return ROFSTLookup.ConvertFortranFormatToScienctificNotation(gg).Replace("`", @"\'B0").Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ").Replace(@"\'a0", " ").Replace(@"\'A0", " ");
} }
private string FixValue(string str) private string FixValue(string str)
{ {
return str.Replace(@"\u8209?", "-").Replace(@"\u160?", " "); //dash and hard space return str.Replace(@"\u8209?", "-").Replace(@"\u160?", " "); //dash and hard space
} }
} }
public delegate void StaticContentInfoEvent(object sender, StaticContentInfoEventArgs args); public delegate void StaticContentInfoEvent(object sender, StaticContentInfoEventArgs args);
public class StaticContentInfoEventArgs public class StaticContentInfoEventArgs
{ {
@ -761,22 +763,26 @@ namespace VEPROMS.CSLA.Library
_Type = type; _Type = type;
} }
} }
public partial class ContentInfo public partial class ContentInfo
{ {
public static string FormatByteArray(byte[] myArray) public static string FormatByteArray(byte[] myArray)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < myArray.Length; i++) for (int i = 0; i < myArray.Length; i++)
{ {
sb.Append(string.Format("{0:x2}", myArray[i])); sb.Append(string.Format("{0:x2}", myArray[i]));
} }
return sb.ToString(); return sb.ToString();
} }
public string LastChangedString public string LastChangedString
{ {
get { return ContentInfo.FormatByteArray(_LastChanged); } get { return ContentInfo.FormatByteArray(_LastChanged); }
} }
//Convert.ToInt64( ByteArrayToHexString(_ts), 16 ) )
public Int64 LastChangedInt64 public Int64 LastChangedInt64
{ {
get { return Convert.ToInt64(LastChangedString, 16); } get { return Convert.ToInt64(LastChangedString, 16); }
@ -797,39 +803,48 @@ namespace VEPROMS.CSLA.Library
public bool InList(params int[] IDs) public bool InList(params int[] IDs)
{ {
foreach (int id in IDs) foreach (int id in IDs)
{
if (id == ContentID) return true; if (id == ContentID) return true;
}
return false; return false;
} }
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii) public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii)
{ {
FixTransitionText(tran, tranLookup, ii, ""); FixTransitionText(tran, tranLookup, ii, "");
} }
public void FixTransitionText(TransitionInfo tran, ItemInfo ii)
{
FixTransitionText(tran, ii, "");
}
public void FixTransitionText(TransitionInfo tran, ItemInfo ii, string forceConvertToText)
{
FixTransitionText(tran, null, ii, forceConvertToText);
}
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii, string forceConvertToText) public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii, string forceConvertToText)
{ {
//string transText = tran.ResolvePathTo();
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
////string lookFor = string.Format(@"<START\]\\v0 ([^#]*?)\\v #Link:Transition[^:]*?:{0} {1} [0-9]*\[END>", tran.TranType, tran.TransitionID);
//Match m = Regex.Match(Text, lookFor);
//if (m != null && m.Groups.Count > 1)
//{
// System.Text.RegularExpressions.Group g = m.Groups[3];
// if (g.ToString() != transText)
// _Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
//}
string newvalue; string newvalue;
MyContentMessage = string.Empty; MyContentMessage = string.Empty;
if (tranLookup == null) if (tranLookup == null)
newvalue = tran.ResolvePathTo(); newvalue = tran.ResolvePathTo();
else else
newvalue = tran.ResolvePathTo(tranLookup); newvalue = tran.ResolvePathTo(tranLookup);
if (forceConvertToText != string.Empty) if (forceConvertToText != string.Empty)
newvalue = "?"; newvalue = "?";
string findLink = @"<START\].*?\[END>"; string findLink = @"<START\].*?\[END>";
// B2019-084: There were 2 '<START]'s in the text so regex didn't find what was needed to fix an updated procedure number. Note that 'Text' is read only, but _Text gets used. // B2019-084: There were 2 '<START]'s in the text so regex didn't find what was needed to fix an updated procedure number. Note that 'Text' is read only, but _Text gets used.
if (Text.Contains("<START]<START]")) _Text = Text.Replace("<START]<START]", "<START]"); if (Text.Contains("<START]<START]")) _Text = Text.Replace("<START]<START]", "<START]");
MatchCollection ms = Regex.Matches(Text, findLink); MatchCollection ms = Regex.Matches(Text, findLink);
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\line ?|\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID); string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\line ?|\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
foreach (Match mm in ms) foreach (Match mm in ms)
{ {
Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline);
@ -845,7 +860,7 @@ namespace VEPROMS.CSLA.Library
string gg = Text.Substring(myIndex, myLength); string gg = Text.Substring(myIndex, myLength);
MyContentMessage = string.Format("ContentExt.ContentInfo:Content:{0}, {1}, {2}", this.ContentID, tran.TransitionID, gg); MyContentMessage = string.Format("ContentExt.ContentInfo:Content:{0}, {1}, {2}", this.ContentID, tran.TransitionID, gg);
newvalue = newvalue.Replace("{", @"\{").Replace("}", @"\}"); newvalue = newvalue.Replace("{", @"\{").Replace("}", @"\}");
if ((gg.Replace(@"\u8209?", "-").Replace(@"\u9586?",@"\\")) != (newvalue.Replace("\\u8209?", "-").Replace(@"\u9586?",@"\\")) || newvalue == "?") // B2017-165 added check of newvalue if ((gg.Replace(@"\u8209?", "-").Replace(@"\u9586?", @"\\")) != (newvalue.Replace("\\u8209?", "-").Replace(@"\u9586?", @"\\")) || newvalue == "?") // B2017-165 added check of newvalue
{ {
_Text = Text.Substring(0, myIndex) + newvalue + Text.Substring(myIndex + myLength); _Text = Text.Substring(0, myIndex) + newvalue + Text.Substring(myIndex + myLength);
if (newvalue == "?") if (newvalue == "?")
@ -910,13 +925,13 @@ namespace VEPROMS.CSLA.Library
else else
newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value);
} }
if (newvalue.Contains(@"\u8593?")) if (newvalue.Contains(@"\u9586?"))
{ {
Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
if (m == null) if (m == null)
newvalue = newvalue.Replace(@"\u8593?", "^"); newvalue = newvalue.Replace(@"\u9586?", @"\\");
else else
newvalue = newvalue.Replace(@"\u8593?", m.Groups[1].Value + @"\u8593?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value);
} }
if (newvalue.Contains(@"\u9586?")) if (newvalue.Contains(@"\u9586?"))
{ {
@ -935,70 +950,47 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
public void FixTransitionText(TransitionInfo tran, ItemInfo ii)
{ public void FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo, ItemInfo ii)
FixTransitionText(tran, ii, "");
}
public void FixTransitionText(TransitionInfo tran, ItemInfo ii, string forceConvertToText)
{
FixTransitionText(tran, null, ii, forceConvertToText);
//string transText = tran.ResolvePathTo(tranLookup);
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
////string lookFor = string.Format(@"<START\]\\v0 ([^#]*?)\\v #Link:Transition[^:]*?:{0} {1} [0-9]*\[END>", tran.TranType, tran.TransitionID);
//Match m = Regex.Match(Text, lookFor);
//if (m != null && m.Groups.Count > 1)
//{
// System.Text.RegularExpressions.Group g = m.Groups[3];
// if (g.ToString() != transText)
// _Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
//}
//// see if there is a grid to update too.
//if (MyGrid != null)
//{
// string lookForXml = string.Format(@"&lt;START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END&gt;", tran.TranType, tran.TransitionID);
// Match mg = Regex.Match(MyGrid.Data, lookForXml);
// if (mg != null && mg.Groups.Count > 1)
// {
// System.Text.RegularExpressions.Group g = mg.Groups[3];
// if (g.ToString() != transText)
// MyGrid.SetData(MyGrid.Data.Substring(0, g.Index) + transText + MyGrid.Data.Substring(g.Index + g.Length));
// }
//}
}
public void FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo, ItemInfo ii) // string newvalue)
{ {
string fileNameOnly = null; string fileNameOnly = null;
//B2020-127 don't try to parse out a file name from "?" (happens with the RO figure no longer exists) //B2020-127 don't try to parse out a file name from "?" (happens with the RO figure no longer exists)
// - this allows it to drop through and put an annotation on the step // - this allows it to drop through and put an annotation on the step
if (ii.IsFigure && Text != null && Text.Length > 0 && value != "?") if (ii.IsFigure && Text != null && Text.Length > 0 && value != "?")
fileNameOnly = value.Substring(0,value.IndexOf("\n")).Replace(@"\u8209?","-"); // check only the file name of the RO figure {
fileNameOnly = value.Substring(0, value.IndexOf("\n")).Replace(@"\u8209?", "-"); // check only the file name of the RO figure
}
string newvalue = value; string newvalue = value;
newvalue = newvalue.Replace("{", @"\{").Replace("}", @"\}"); newvalue = newvalue.Replace("{", @"\{").Replace("}", @"\}");
newvalue = newvalue.Replace(@"\up2 \u8209?", @"\up2\u8209?");// B2017-167 Remove spurious space in RO Value between two RTF Commands newvalue = newvalue.Replace(@"\up2 \u8209?", @"\up2\u8209?");// B2017-167 Remove spurious space in RO Value between two RTF Commands
string findLink = @"<START\].*?\[END>"; string findLink = @"<START\].*?\[END>";
MatchCollection ms = Regex.Matches(Text, findLink); MatchCollection ms = Regex.Matches(Text, findLink);
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousg.ROUsageID); string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousg.ROUsageID);
foreach (Match mm in ms) foreach (Match mm in ms)
{ {
int offset = mm.Index; int offset = mm.Index;
Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline);
if (m != null && m.Groups.Count > 1) if (m != null && m.Groups.Count > 1)
{ {
int myIndex = m.Groups[4].Index + mm.Index; int myIndex = m.Groups[4].Index + mm.Index;
int myLength = m.Groups[4].Length; int myLength = m.Groups[4].Length;
if (m.Groups[3].Value != " ") if (m.Groups[3].Value != " ")
{ {
myIndex = m.Groups[3].Index + mm.Index; myIndex = m.Groups[3].Index + mm.Index;
myLength += m.Groups[3].Length; myLength += m.Groups[3].Length;
} }
string gg = Text.Substring(myIndex, myLength); string gg = Text.Substring(myIndex, myLength);
if (((fileNameOnly == null) && (Content.MakeConsistentFormat(gg) != Content.MakeConsistentFormat(newvalue))) || ((fileNameOnly != null) && !(gg.Replace(@"\u8209?", "-").StartsWith(fileNameOnly) && newvalue.Replace(@"\u8209?", "-").StartsWith(fileNameOnly)))) if (((fileNameOnly == null) && (Content.MakeConsistentFormat(gg) != Content.MakeConsistentFormat(newvalue))) || ((fileNameOnly != null) && !(gg.Replace(@"\u8209?", "-").StartsWith(fileNameOnly) && newvalue.Replace(@"\u8209?", "-").StartsWith(fileNameOnly))))
{ {
// Debug - jsj 5-19-2017 - left in for initial check-in
//string gg_org = gg;
//string newval_org = newvalue;
_Text = Text.Substring(0, myIndex) + newvalue + _Text.Substring(myIndex + myLength); _Text = Text.Substring(0, myIndex) + newvalue + _Text.Substring(myIndex + myLength);
if (newvalue == "?") if (newvalue == "?")
{ {
gg = ItemInfo.ConvertToDisplayText(gg); gg = ItemInfo.ConvertToDisplayText(gg);
@ -1006,6 +998,7 @@ namespace VEPROMS.CSLA.Library
OnStaticContentInfoChange(ii, new StaticContentInfoEventArgs(gg, newvalue, "RO")); OnStaticContentInfoChange(ii, new StaticContentInfoEventArgs(gg, newvalue, "RO"));
break; break;
} }
if (newvalue.StartsWith(gg) && (newvalue.ToUpper().Contains("BMP") || newvalue.ToUpper().Contains("GIF") || newvalue.ToUpper().Contains("TIF"))) if (newvalue.StartsWith(gg) && (newvalue.ToUpper().Contains("BMP") || newvalue.ToUpper().Contains("GIF") || newvalue.ToUpper().Contains("TIF")))
{ {
break; // Text has been processed break; // Text has been processed
@ -1024,36 +1017,40 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
// see if there is a grid to update too. // see if there is a grid to update too.
if (MyGrid != null) if (MyGrid != null)
{ {
if (rotype == (int)E_ROValueType.Table) // if change in rotable data... if (rotype == (int)E_ROValueType.Table) // if change in rotable data...
{ {
List<string> retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data)); List<string> retlist = origROFstInfo.OnROTableUpdate(this.Get(), new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data));
if (Text != retlist[0]) _Text = retlist[0]; if (Text != retlist[0]) _Text = retlist[0];
//if (MyGrid.Data != retlist[1]) MyGrid.Data = retlist[1];
} }
else else
{ {
// if it's an ro within a table, need to process into an flex grid to save the grid data: // if it's an ro within a table, need to process into an flex grid to save the grid data:
string findLinkXml = @"&lt;START\].*?\[END&gt;"; string findLinkXml = @"&lt;START\].*?\[END&gt;";
//string lookForXml = string.Format(@"&lt;START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END&gt;", rousg.ROUsageID);
string lookForXml = string.Format(@"^&lt;START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}} \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END&gt;$", rousg.ROUsageID); string lookForXml = string.Format(@"^&lt;START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}} \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END&gt;$", rousg.ROUsageID);
MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml); MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml);
foreach (Match mmg in msg) foreach (Match mmg in msg)
{ {
//int offset = 0; // crashed in substring line below if using mmg.Index; Set to 0 and it worked - KBR. //int offset = 0; // crashed in substring line below if using mmg.Index; Set to 0 and it worked - KBR.
Match mg = Regex.Match(mmg.Value, lookForXml); Match mg = Regex.Match(mmg.Value, lookForXml);
if (mg != null && mg.Groups.Count > 1) if (mg != null && mg.Groups.Count > 1)
{ {
int myIndex = mg.Groups[4].Index; int myIndex = mg.Groups[4].Index;
int myLength = mg.Groups[4].Length; int myLength = mg.Groups[4].Length;
if (mg.Groups[3].Value != " ") if (mg.Groups[3].Value != " ")
{ {
myIndex = mg.Groups[3].Index ; myIndex = mg.Groups[3].Index;
myLength += mg.Groups[3].Length; myLength += mg.Groups[3].Length;
} }
string gg = MyGrid.Data.Substring(myIndex+ mmg.Index, myLength);
string gg = MyGrid.Data.Substring(myIndex + mmg.Index, myLength);
if (newvalue.Contains(@"\u8209?")) if (newvalue.Contains(@"\u8209?"))
{ {
Match m = Regex.Match(gg, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match m = Regex.Match(gg, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
@ -1062,6 +1059,7 @@ namespace VEPROMS.CSLA.Library
else else
newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value);
} }
if (newvalue.Contains(@"\u8593?")) if (newvalue.Contains(@"\u8593?"))
{ {
Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
@ -1070,6 +1068,7 @@ namespace VEPROMS.CSLA.Library
else else
newvalue = newvalue.Replace(@"\u8593?", m.Groups[1].Value + @"\u8593?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u8593?", m.Groups[1].Value + @"\u8593?" + m.Groups[3].Value);
} }
if (newvalue.Contains(@"\u9586?")) if (newvalue.Contains(@"\u9586?"))
{ {
Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
@ -1078,10 +1077,11 @@ namespace VEPROMS.CSLA.Library
else else
newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value);
} }
if (gg != newvalue) if (gg != newvalue)
{ {
string prefix1 = MyGrid.Data.Substring(0,mmg.Index); string prefix1 = MyGrid.Data.Substring(0, mmg.Index);
string prefix2 = mmg.Value.Substring(0,myIndex); string prefix2 = mmg.Value.Substring(0, myIndex);
string suffix1 = MyGrid.Data.Substring(mmg.Index + mmg.Length); string suffix1 = MyGrid.Data.Substring(mmg.Index + mmg.Length);
string suffix2 = mmg.Value.Substring(myIndex + myLength); string suffix2 = mmg.Value.Substring(myIndex + myLength);
MyGrid.SetData(prefix1 + prefix2 + newvalue + suffix2 + suffix1); MyGrid.SetData(prefix1 + prefix2 + newvalue + suffix2 + suffix1);
@ -1091,23 +1091,28 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
if (_Text == string.Empty) if (_Text == string.Empty)
_Text = "?"; _Text = "?";
} }
// C2021-018 used to update the content record when displaying Alarm Pont Table information in the step Editor (BNPP alarms) // C2021-018 used to update the content record when displaying Alarm Pont Table information in the step Editor (BNPP alarms)
public void UpdateAlarmTableInfoView(string updateText) public void UpdateAlarmTableInfoView(string updateText)
{ {
_Text = updateText; _Text = updateText;
} }
public void LoadNonCachedGrid() public void LoadNonCachedGrid()
{ {
_MyGrid = GridInfo.GetNonCached(ContentID); _MyGrid = GridInfo.GetNonCached(ContentID);
//Console.WriteLine("LoadNonCachedGrid {0},{1},{2}",ContentID,_MyGrid==null,_MyContentInfoUnique); //Console.WriteLine("LoadNonCachedGrid {0},{1},{2}",ContentID,_MyGrid==null,_MyContentInfoUnique);
} }
public PartInfoList LocalContentParts public PartInfoList LocalContentParts
{ {
get { return _ContentParts; } get { return _ContentParts; }
} }
public void AddPart(SafeDataReader dr, ItemInfo itemInfo) public void AddPart(SafeDataReader dr, ItemInfo itemInfo)
{ {
if (_ContentParts == null) if (_ContentParts == null)
@ -1115,36 +1120,21 @@ namespace VEPROMS.CSLA.Library
else else
_ContentParts.AddPartInfo(dr, itemInfo); _ContentParts.AddPartInfo(dr, itemInfo);
} }
public override string ToString() public override string ToString()
{ {
return string.Format("{0} {1}", Number, Text); return string.Format("{0} {1}", Number, Text);
} }
public void ShowChange() public void ShowChange()
{ {
OnChange(); OnChange();
} }
//public XmlNode ToXml(XmlNode xn)
//{ internal ContentInfo(SafeDataReader dr, bool ForItem)
// XmlNode nd = xn.OwnerDocument.CreateElement("Content");
// xn.AppendChild(nd);
// AddAttribute(nd, "Number", _Number);
// AddAttribute(nd, "Text", _Text);
// AddAttribute(nd, "FormatID", _FormatID);
// AddAttribute(nd, "Config", _Config);
// return nd;
//}
//public void AddAttribute(XmlNode xn, string name, object o)
//{
// if (o != null && o.ToString() != "")
// {
// XmlAttribute xa = xn.OwnerDocument.CreateAttribute(name);
// xa.Value = o.ToString();
// xn.Attributes.Append(xa);
// }
//}
internal ContentInfo(SafeDataReader dr,bool ForItem)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.Constructor", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.Constructor", GetHashCode());
try try
{ {
ReadDataItemList(dr); ReadDataItemList(dr);
@ -1156,9 +1146,11 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ContentInfo.Constructor", ex); throw new DbCslaException("ContentInfo.Constructor", ex);
} }
} }
private void ReadDataItemList(SafeDataReader dr) private void ReadDataItemList(SafeDataReader dr)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.ReadDataItemList", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.ReadDataItemList", GetHashCode());
try try
{ {
_ContentID = dr.GetInt32("ContentID"); _ContentID = dr.GetInt32("ContentID");
@ -1186,8 +1178,8 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ContentInfo.ReadData", ex); throw new DbCslaException("ContentInfo.ReadData", ex);
} }
} }
} }
public partial class ContentInfoList public partial class ContentInfoList
{ {
public static ContentInfoList GetList(int? itemID) public static ContentInfoList GetList(int? itemID)
@ -1204,6 +1196,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
} }
} }
[Serializable()] [Serializable()]
private class ContentListCriteria private class ContentListCriteria
{ {
@ -1218,6 +1211,7 @@ namespace VEPROMS.CSLA.Library
set { _ItemID = value; } set { _ItemID = value; }
} }
} }
private void DataPortal_Fetch(ContentListCriteria criteria) private void DataPortal_Fetch(ContentListCriteria criteria)
{ {
this.RaiseListChangedEvents = false; this.RaiseListChangedEvents = false;
@ -1251,12 +1245,13 @@ namespace VEPROMS.CSLA.Library
} }
this.RaiseListChangedEvents = true; this.RaiseListChangedEvents = true;
} }
public static ContentInfoList GetChangedList(byte[] lastChanged) public static ContentInfoList GetChangedList(byte[] lastChanged)
{ {
try try
{ {
ContentInfoList tmp = DataPortal.Fetch<ContentInfoList>(new ChangeListCriteria(lastChanged)); ContentInfoList tmp = DataPortal.Fetch<ContentInfoList>(new ChangeListCriteria(lastChanged));
// ContentInfo.AddList(tmp); // ContentInfo.AddList(tmp);
tmp.AddEvents(); tmp.AddEvents();
return tmp; return tmp;
} }
@ -1265,6 +1260,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ContentInfoList.GetChangedList", ex); throw new DbCslaException("Error on ContentInfoList.GetChangedList", ex);
} }
} }
[Serializable()] [Serializable()]
private class ChangeListCriteria private class ChangeListCriteria
{ {
@ -1279,6 +1275,7 @@ namespace VEPROMS.CSLA.Library
_LastChanged = lastChanged; _LastChanged = lastChanged;
} }
} }
private void DataPortal_Fetch(ChangeListCriteria criteria) private void DataPortal_Fetch(ChangeListCriteria criteria)
{ {
this.RaiseListChangedEvents = false; this.RaiseListChangedEvents = false;
@ -1312,7 +1309,9 @@ namespace VEPROMS.CSLA.Library
} }
this.RaiseListChangedEvents = true; this.RaiseListChangedEvents = true;
} }
#region ClearCBOverride #region ClearCBOverride
// B2015-039 fix: // B2015-039 fix:
// the following code clears the change bar override attribute from the step config, using the // the following code clears the change bar override attribute from the step config, using the
// sql stored procedure 'ClearCBOverrideForProcedure'. The stored procedure returns // sql stored procedure 'ClearCBOverrideForProcedure'. The stored procedure returns
@ -1332,6 +1331,7 @@ namespace VEPROMS.CSLA.Library
set { _ItemID = value; } set { _ItemID = value; }
} }
} }
private void DataPortal_Fetch(ClearCBOverrideCriteria criteria) private void DataPortal_Fetch(ClearCBOverrideCriteria criteria)
{ {
try try
@ -1366,6 +1366,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ClearCBOverrideCriteria.DataPortal_Fetch", ex); throw new DbCslaException("ClearCBOverrideCriteria.DataPortal_Fetch", ex);
} }
} }
public static ContentInfoList GetClearedCBOverrides(int itemID) public static ContentInfoList GetClearedCBOverrides(int itemID)
{ {
try try
@ -1378,7 +1379,9 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ContentInfoList.GetClearedCBOverrides", ex); throw new DbCslaException("Error on ContentInfoList.GetClearedCBOverrides", ex);
} }
} }
#endregion #endregion
#region UCF Fix FormatId After Import #region UCF Fix FormatId After Import
private class FixFormatIDAfterImportCriteria private class FixFormatIDAfterImportCriteria
{ {
@ -1407,6 +1410,7 @@ namespace VEPROMS.CSLA.Library
_NewFormatID = newfid; _NewFormatID = newfid;
} }
} }
private void DataPortal_Fetch(FixFormatIDAfterImportCriteria criteria) private void DataPortal_Fetch(FixFormatIDAfterImportCriteria criteria)
{ {
try try
@ -1440,6 +1444,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("FixFormatIDAfterImport.DataPortal_Fetch", ex); throw new DbCslaException("FixFormatIDAfterImport.DataPortal_Fetch", ex);
} }
} }
public static ContentInfoList FixFormatIDAfterImport(string dvlst, int oldfid, int newfid) public static ContentInfoList FixFormatIDAfterImport(string dvlst, int oldfid, int newfid)
{ {
try try
@ -1452,7 +1457,9 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ContentInfoList.FixFormatIDAfterImport", ex); throw new DbCslaException("Error on ContentInfoList.FixFormatIDAfterImport", ex);
} }
} }
#endregion #endregion
#region UCF Clear Overwridden Formats #region UCF Clear Overwridden Formats
private class ClearOverrideFormatsByFolderCriteria private class ClearOverrideFormatsByFolderCriteria
{ {
@ -1481,6 +1488,7 @@ namespace VEPROMS.CSLA.Library
set { _FolderID = value; } set { _FolderID = value; }
} }
} }
private void DataPortal_Fetch(ClearOverrideFormatsByFolderCriteria criteria) private void DataPortal_Fetch(ClearOverrideFormatsByFolderCriteria criteria)
{ {
try try
@ -1520,6 +1528,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ClearOverrideFormatsByFolderCriteria.DataPortal_Fetch", ex); throw new DbCslaException("ClearOverrideFormatsByFolderCriteria.DataPortal_Fetch", ex);
} }
} }
public static ContentInfoList ClearOverrideFormatsByFolder(int folderID, int? formatID, int? newformatID) public static ContentInfoList ClearOverrideFormatsByFolder(int folderID, int? formatID, int? newformatID)
{ {
try try
@ -1532,9 +1541,10 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ContentInfoList.ClearOverrideFormatsByFolder", ex); throw new DbCslaException("Error on ContentInfoList.ClearOverrideFormatsByFolder", ex);
} }
} }
private class ClearOverrideFormatsByDocVersionCriteria private class ClearOverrideFormatsByDocVersionCriteria
{ {
public ClearOverrideFormatsByDocVersionCriteria(string dvlist, int? formatID, int?newformatID) public ClearOverrideFormatsByDocVersionCriteria(string dvlist, int? formatID, int? newformatID)
{ {
_FormatID = formatID; _FormatID = formatID;
_DVList = dvlist; _DVList = dvlist;
@ -1559,6 +1569,7 @@ namespace VEPROMS.CSLA.Library
set { _DVList = value; } set { _DVList = value; }
} }
} }
private void DataPortal_Fetch(ClearOverrideFormatsByDocVersionCriteria criteria) private void DataPortal_Fetch(ClearOverrideFormatsByDocVersionCriteria criteria)
{ {
try try
@ -1598,6 +1609,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ClearOverrideFormatsByDocVersion.DataPortal_Fetch", ex); throw new DbCslaException("ClearOverrideFormatsByDocVersion.DataPortal_Fetch", ex);
} }
} }
public static ContentInfoList ClearOverrideFormatsByDocVersion(string dvlist, int? formatID, int? newformatID) public static ContentInfoList ClearOverrideFormatsByDocVersion(string dvlist, int? formatID, int? newformatID)
{ {
try try
@ -1610,6 +1622,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ContentInfoList.ClearOverrideFormatsByDocVersion", ex); throw new DbCslaException("Error on ContentInfoList.ClearOverrideFormatsByDocVersion", ex);
} }
} }
private class ClearOverrideFormatsByItemCriteria private class ClearOverrideFormatsByItemCriteria
{ {
public ClearOverrideFormatsByItemCriteria(int itemID, int? formatID, int? newformatID) public ClearOverrideFormatsByItemCriteria(int itemID, int? formatID, int? newformatID)
@ -1637,6 +1650,7 @@ namespace VEPROMS.CSLA.Library
set { _ItemID = value; } set { _ItemID = value; }
} }
} }
private void DataPortal_Fetch(ClearOverrideFormatsByItemCriteria criteria) private void DataPortal_Fetch(ClearOverrideFormatsByItemCriteria criteria)
{ {
try try
@ -1676,6 +1690,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ClearOverrideFormatsByItem.DataPortal_Fetch", ex); throw new DbCslaException("ClearOverrideFormatsByItem.DataPortal_Fetch", ex);
} }
} }
public static ContentInfoList ClearOverrideFormatsByItem(int itemID, int? formatID, int? newformatID) public static ContentInfoList ClearOverrideFormatsByItem(int itemID, int? formatID, int? newformatID)
{ {
try try
@ -1689,10 +1704,10 @@ namespace VEPROMS.CSLA.Library
} }
} }
#endregion #endregion
#region Enhanced #region Enhanced
#region Enhanced_UnlinkItems #region Enhanced_UnlinkItems
[Serializable()] [Serializable()]
private class EnhancedUnlinkCriteria private class EnhancedUnlinkCriteria
@ -1708,6 +1723,7 @@ namespace VEPROMS.CSLA.Library
set { _EnhancedID = value; } set { _EnhancedID = value; }
} }
} }
private void DataPortal_Fetch(EnhancedUnlinkCriteria criteria) private void DataPortal_Fetch(EnhancedUnlinkCriteria criteria)
{ {
try try
@ -1739,6 +1755,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("EnhancedUnlinkCriteria.DataPortal_Fetch", ex); throw new DbCslaException("EnhancedUnlinkCriteria.DataPortal_Fetch", ex);
} }
} }
public static ContentInfoList DoEnhancedUnlink(int enhancedID) public static ContentInfoList DoEnhancedUnlink(int enhancedID)
{ {
try try
@ -1751,9 +1768,11 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ContentInfoList.DoEnhancedUnlink", ex); throw new DbCslaException("Error on ContentInfoList.DoEnhancedUnlink", ex);
} }
} }
#endregion Enhanced_UnlinkItems #endregion Enhanced_UnlinkItems
#region Enhanced_UnlinkDocVersionAndItems #region Enhanced_UnlinkDocVersionAndItems
//////
[Serializable()] [Serializable()]
private class EnhancedDocVersionUnlinkCriteria private class EnhancedDocVersionUnlinkCriteria
{ {
@ -1768,6 +1787,7 @@ namespace VEPROMS.CSLA.Library
set { _EnhancedDocVersionID = value; } set { _EnhancedDocVersionID = value; }
} }
} }
private void DataPortal_Fetch(EnhancedDocVersionUnlinkCriteria criteria) private void DataPortal_Fetch(EnhancedDocVersionUnlinkCriteria criteria)
{ {
try try
@ -1812,6 +1832,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
#endregion Enhanced_UnlinkDocVersionAndItems #endregion Enhanced_UnlinkDocVersionAndItems
#region Enhanced_Convert16To32 #region Enhanced_Convert16To32
////// //////
[Serializable()] [Serializable()]
@ -1964,6 +1985,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
#endregion Enhanced_Convert16To32 #endregion Enhanced_Convert16To32
#endregion Enhanced #endregion Enhanced
} }
} }

View File

@ -48,10 +48,13 @@ namespace VEPROMS.CSLA.Library
get get
{ {
if (DocVersionAssociations == null || DocVersionAssociations.Count == 0) return false; if (DocVersionAssociations == null || DocVersionAssociations.Count == 0) return false;
ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID); ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID);
RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID); RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID);
string rofstPath = rdi.FolderPath + @"\ro.fst"; string rofstPath = rdi.FolderPath + @"\ro.fst";
if (!File.Exists(rofstPath)) return false; if (!File.Exists(rofstPath)) return false;
FileInfo fiRofst = new FileInfo(rofstPath); FileInfo fiRofst = new FileInfo(rofstPath);
// if the database Ro.Fst is newer or if the files have identical DTS, // if the database Ro.Fst is newer or if the files have identical DTS,
@ -60,7 +63,11 @@ namespace VEPROMS.CSLA.Library
// next see if the data is the same size, i.e. byte count of record and byte count // next see if the data is the same size, i.e. byte count of record and byte count
// of file. If different sizes, the date/time stamp check will hold. // of file. If different sizes, the date/time stamp check will hold.
if (fiRofst.Length != roFstInfo.ROLookup.Length) return fiRofst.LastWriteTimeUtc > roFstInfo.DTS; // B2022-026 RO Memory reduction - new logic
var bytes = ROFSTLookup.GetRofstLookupBytes(roFstInfo.ROFstID);
if (bytes != null && fiRofst.Length != bytes.Length)
return fiRofst.LastWriteTimeUtc > roFstInfo.DTS;
// if we can't tell by the DTS or size, compare the contents. Get all of the rodb's // if we can't tell by the DTS or size, compare the contents. Get all of the rodb's
// rofsts of the size of the file & compare bytes. // rofsts of the size of the file & compare bytes.
@ -249,15 +256,18 @@ namespace VEPROMS.CSLA.Library
get get
{ {
if (DocVersionAssociations == null || DocVersionAssociationCount==0) return false; if (DocVersionAssociations == null || DocVersionAssociationCount==0) return false;
ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID); ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID);
RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID); RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID);
string rofstPath = rdi.FolderPath + @"\ro.fst"; string rofstPath = rdi.FolderPath + @"\ro.fst";
//if (!File.Exists(rofstPath)) return false; //if (!File.Exists(rofstPath)) return false;
if (!pathExists(rofstPath)) if (!pathExists(rofstPath))
{ {
_MyLog.WarnFormat("RO Path '{0}' could not be found", rofstPath); _MyLog.WarnFormat("RO Path '{0}' could not be found", rofstPath);
return false; return false;
} }
FileInfo fiRofst = new FileInfo(rofstPath); FileInfo fiRofst = new FileInfo(rofstPath);
// if the database Ro.Fst is newer or if the files have identical DTS, // if the database Ro.Fst is newer or if the files have identical DTS,
@ -265,14 +275,21 @@ namespace VEPROMS.CSLA.Library
// put this in a dictionary so we don't have to keep testing to see if the file version of ro.fst is newer than database version // put this in a dictionary so we don't have to keep testing to see if the file version of ro.fst is newer than database version
string key = string.Format("{0}-{1}", DocVersionAssociations[0].ROFstID, fiRofst.LastWriteTimeUtc); string key = string.Format("{0}-{1}", DocVersionAssociations[0].ROFstID, fiRofst.LastWriteTimeUtc);
if (NewerRoFstLookup.ContainsKey(key)) return NewerRoFstLookup[key]; if (NewerRoFstLookup.ContainsKey(key)) return NewerRoFstLookup[key];
if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return AddToRoFstLookup(key, false); if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return AddToRoFstLookup(key, false);
TimeSpan ts = roFstInfo.DTS - fiRofst.LastWriteTimeUtc; TimeSpan ts = roFstInfo.DTS - fiRofst.LastWriteTimeUtc;
if (ts.TotalSeconds > -1F) return AddToRoFstLookup(key, false); if (ts.TotalSeconds > -1F) return AddToRoFstLookup(key, false);
// next see if the data is the same size, i.e. byte count of record and byte count // next see if the data is the same size, i.e. byte count of record and byte count
// of file. If different sizes, the date/time stamp check will hold. // of file. If different sizes, the date/time stamp check will hold.
if (fiRofst.Length != roFstInfo.ROLookup.Length) return AddToRoFstLookup(key,fiRofst.LastWriteTimeUtc > roFstInfo.DTS); // B2022-026 RO Memory reduction - new logic
var bytes = ROFSTLookup.GetRofstLookupBytes(roFstInfo.ROFstID);
if (bytes != null && fiRofst.Length != bytes.Length)
return AddToRoFstLookup(key, fiRofst.LastWriteTimeUtc > roFstInfo.DTS);
// if we can't tell by the DTS or size, compare the contents. Get all of the rodb's // if we can't tell by the DTS or size, compare the contents. Get all of the rodb's
// rofsts of the size of the file & compare bytes. // rofsts of the size of the file & compare bytes.

View File

@ -326,26 +326,31 @@ namespace VEPROMS.CSLA.Library
public partial class ItemInfo : IVEDrillDownReadOnly public partial class ItemInfo : IVEDrillDownReadOnly
{ {
private bool _PrintAllAtOnce = false; private bool _PrintAllAtOnce = false;
public bool PrintAllAtOnce public bool PrintAllAtOnce
{ {
get { return _PrintAllAtOnce; } get { return _PrintAllAtOnce; }
set { _PrintAllAtOnce = value; } set { _PrintAllAtOnce = value; }
} }
public SectionInfo GetSectionInfo() public SectionInfo GetSectionInfo()
{ {
if (this is SectionInfo) return this as SectionInfo; if (this is SectionInfo) return this as SectionInfo;
return SectionInfo.Get(ItemID); return SectionInfo.Get(ItemID);
} }
public StepInfo GetStepInfo() public StepInfo GetStepInfo()
{ {
if (this is StepInfo) return this as StepInfo; if (this is StepInfo) return this as StepInfo;
return StepInfo.Get(ItemID); return StepInfo.Get(ItemID);
} }
public ProcedureInfo GetProcedureInfo() public ProcedureInfo GetProcedureInfo()
{ {
if (this is ProcedureInfo) return this as ProcedureInfo; if (this is ProcedureInfo) return this as ProcedureInfo;
return ProcedureInfo.Get(ItemID); return ProcedureInfo.Get(ItemID);
} }
private string _EnhType = null; private string _EnhType = null;
public string EnhType public string EnhType
{ {
@ -379,10 +384,12 @@ namespace VEPROMS.CSLA.Library
if (id == ItemID) return true; if (id == ItemID) return true;
return false; return false;
} }
public static bool IsInCache(int itemID) public static bool IsInCache(int itemID)
{ {
return _CacheByPrimaryKey.ContainsKey(itemID.ToString()); return _CacheByPrimaryKey.ContainsKey(itemID.ToString());
} }
public static string ReplaceLinkWithNewID(string tmpForLink) public static string ReplaceLinkWithNewID(string tmpForLink)
{ {
tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject:<NewID> "); tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject:<NewID> ");
@ -394,6 +401,7 @@ namespace VEPROMS.CSLA.Library
tmpForLink = tmpForLink.Replace(@"\u8211 ", @"-"); // Replace EN Dash with hyphen tmpForLink = tmpForLink.Replace(@"\u8211 ", @"-"); // Replace EN Dash with hyphen
return tmpForLink; return tmpForLink;
} }
public void SetHeader(VE_Font myFont, string myText) public void SetHeader(VE_Font myFont, string myText)
{ {
_MyHeader = new MetaTag(myFont); _MyHeader = new MetaTag(myFont);
@ -402,6 +410,7 @@ namespace VEPROMS.CSLA.Library
_MyHeader.Text = myText; _MyHeader.Text = myText;
_MyHeader.Justify = ContentAlignment.MiddleCenter; _MyHeader.Justify = ContentAlignment.MiddleCenter;
} }
public void MoveItem(IVEDrillDownReadOnly pInfo, int index) public void MoveItem(IVEDrillDownReadOnly pInfo, int index)
{ {
using (ItemInfoList movedItems = ItemInfoList.GetMoveItem(ItemID, index)) using (ItemInfoList movedItems = ItemInfoList.GetMoveItem(ItemID, index))
@ -416,6 +425,7 @@ namespace VEPROMS.CSLA.Library
if (parentInfo != null) if (parentInfo != null)
ItemInfo.ResetParts(parentInfo.ItemID); ItemInfo.ResetParts(parentInfo.ItemID);
} }
public static void Refresh(ItemInfo tmp) public static void Refresh(ItemInfo tmp)
{ {
string key = tmp.ItemID.ToString(); string key = tmp.ItemID.ToString();
@ -424,6 +434,7 @@ namespace VEPROMS.CSLA.Library
foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key]) foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key])
tmpInfo.RefreshFields(tmp); tmpInfo.RefreshFields(tmp);
} }
protected virtual void RefreshFields(ItemInfo tmp) protected virtual void RefreshFields(ItemInfo tmp)
{ {
if (_PreviousID != tmp.PreviousID) if (_PreviousID != tmp.PreviousID)
@ -574,6 +585,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
/// <summary> /// <summary>
/// The following method is used only in print because the 'printed' data is loaded into /// The following method is used only in print because the 'printed' data is loaded into
/// memory before printing. Find the next item from memory (do not go out to database). /// memory before printing. Find the next item from memory (do not go out to database).
@ -596,43 +608,35 @@ namespace VEPROMS.CSLA.Library
} }
return null; return null;
} }
public static void ResetTranCounters() public static void ResetTranCounters()
{ {
TranCheckCount = 0; TranCheckCount = 0;
TranFixCount = 0; TranFixCount = 0;
TranConvertCount = 0;// B2018-002 - Invalid Transitions - Initialize Transition Conversion Count TranConvertCount = 0;// B2018-002 - Invalid Transitions - Initialize Transition Conversion Count
} }
public static int TranCheckCount = 0; public static int TranCheckCount = 0;
public static int TranFixCount = 0; public static int TranFixCount = 0;
public static int TranConvertCount = 0;// B2018-002 - Invalid Transitions - Declare Transition Conversion Count public static int TranConvertCount = 0;// B2018-002 - Invalid Transitions - Declare Transition Conversion Count
internal static TransitionInfoList TransitionsToDisconnected; internal static TransitionInfoList TransitionsToDisconnected;
internal static TransitionInfoList TransitionsToNonEditable; internal static TransitionInfoList TransitionsToNonEditable;
internal static void MyRefreshTransitions(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup) internal static void MyRefreshTransitions(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
{ {
//TransitionInfoList til = TransitionInfoList.GetByFromID(itemInfo.ItemID);
//Console.WriteLine("Procedure: {0}, transitions: {1}", (itemInfo as ProcedureInfo).DisplayNumber, til.Count);
//foreach (TransitionInfo traninfo in til)
//{
// string oldText = itemInfo.MyContent.Text;
// itemInfo.MyContent.FixTransitionText(traninfo, tranLookup);
// string newText = itemInfo.MyContent.Text;
// if (newText != oldText)
// {
// Content content = Content.Get(itemInfo.MyContent.ContentID);
// content.FixTransitionText(traninfo);
// content.Save();
// }
//}
if (itemInfo == null) return; if (itemInfo == null) return;
if (itemInfo.MyContent.ContentPartCount > 0) if (itemInfo.MyContent.ContentPartCount > 0)
{
foreach (PartInfo pi in itemInfo.MyContent.ContentParts) foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
{ {
//List<ItemInfo> myItems = new List<ItemInfo>();
foreach (ItemInfo ii in pi.MyItems) foreach (ItemInfo ii in pi.MyItems)
// myItems.Add(ii); {
//foreach (ItemInfo ii in myItems)
MyRefreshTransitions(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo, tranLookup); MyRefreshTransitions(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo, tranLookup);
} }
}
}
// B2018-002 - Invalid Transitions - Convert Invalid Transitions to Text // B2018-002 - Invalid Transitions - Convert Invalid Transitions to Text
// An invalid transition is a transition embedded in the content text that does not match the transition table record. // An invalid transition is a transition embedded in the content text that does not match the transition table record.
if(ConvertInvalidTransitionsToText(itemInfo)) if(ConvertInvalidTransitionsToText(itemInfo))
@ -642,18 +646,7 @@ namespace VEPROMS.CSLA.Library
{ {
bool forceConvertToText = false; bool forceConvertToText = false;
TranCheckCount++; TranCheckCount++;
//if (TransitionsToNonEditable != null)
//{
// if (IsTransitionToNonEditable(traninfo))
// {
// forceConvertToText = true;
// TranFixCount++;
// itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Non-Editable Step");
// Content content = Content.Get(itemInfo.MyContent.ContentID);
// content.FixTransitionText(traninfo, true);
// content.Save();
// }
//}
if (!forceConvertToText) if (!forceConvertToText)
{ {
if (traninfo.MyItemToID.ActiveSection != null) if (traninfo.MyItemToID.ActiveSection != null)
@ -661,6 +654,7 @@ namespace VEPROMS.CSLA.Library
SectionConfig sc = traninfo.MyItemToID.ActiveSection.MyConfig as SectionConfig; SectionConfig sc = traninfo.MyItemToID.ActiveSection.MyConfig as SectionConfig;
forceConvertToText = (sc.SubSection_Edit == "N" && traninfo.MyItemToID.IsStep); // Bug fix B2016-081 also check if transition is to a step element forceConvertToText = (sc.SubSection_Edit == "N" && traninfo.MyItemToID.IsStep); // Bug fix B2016-081 also check if transition is to a step element
} }
if (forceConvertToText) if (forceConvertToText)
{ {
TranFixCount++; TranFixCount++;
@ -670,10 +664,13 @@ namespace VEPROMS.CSLA.Library
content.Save(); content.Save();
} }
} }
if (!forceConvertToText) if (!forceConvertToText)
{ {
if (itemInfo.MyProcedure.ItemID != traninfo.MyItemToID.MyProcedure.ItemID) //different proc if (itemInfo.MyProcedure.ItemID != traninfo.MyItemToID.MyProcedure.ItemID) //different proc
{
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format
{
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix
{ {
forceConvertToText = true; forceConvertToText = true;
@ -684,11 +681,15 @@ namespace VEPROMS.CSLA.Library
content.Save(); content.Save();
} }
} }
}
}
if (!forceConvertToText) if (!forceConvertToText)
{ {
if (itemInfo.MyDocVersion != null && traninfo.MyItemToID.MyDocVersion != null && itemInfo.MyDocVersion.VersionID != traninfo.MyItemToID.MyDocVersion.VersionID) //different doc version if (itemInfo.MyDocVersion != null && traninfo.MyItemToID.MyDocVersion != null && itemInfo.MyDocVersion.VersionID != traninfo.MyItemToID.MyDocVersion.VersionID) //different doc version
{ {
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format
{
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix
{ {
forceConvertToText = true; forceConvertToText = true;
@ -700,6 +701,8 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
}
if (!forceConvertToText) if (!forceConvertToText)
{ {
string oldText = itemInfo.MyContent.Text; string oldText = itemInfo.MyContent.Text;
@ -718,6 +721,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
// // B2018-002 - Invalid Transitions - Method to check for invalid transitions and convert them to text // // B2018-002 - Invalid Transitions - Method to check for invalid transitions and convert them to text
public static bool ConvertInvalidTransitionsToText(ItemInfo itemInfo) public static bool ConvertInvalidTransitionsToText(ItemInfo itemInfo)
{ {
@ -729,25 +733,30 @@ namespace VEPROMS.CSLA.Library
retval = false; retval = false;
if (itemInfo.MyContent.Text.Contains("Link:Transition")) if (itemInfo.MyContent.Text.Contains("Link:Transition"))
{ {
//Console.WriteLine("\"TranCount\"\t\"{0}\"\t{1}\t{2}\t{3}", itemInfo.ShortPath, itemInfo.ItemID, mc.Count, itemInfo.MyContent.ContentTransitionCount);
Content content = Content.Get(itemInfo.MyContent.ContentID); Content content = Content.Get(itemInfo.MyContent.ContentID);
//if (itemInfo.InList(616031, 615898, 5516866))
// Console.WriteLine("here");
if (itemInfo.MyContent.ContentTransitions != null) if (itemInfo.MyContent.ContentTransitions != null)
{
foreach (TransitionInfo ct in itemInfo.MyContent.ContentTransitions) foreach (TransitionInfo ct in itemInfo.MyContent.ContentTransitions)
{
Transition.Delete(ct.TransitionID); Transition.Delete(ct.TransitionID);
}
}
itemInfo.MyContent.RefreshContentTransitions(); itemInfo.MyContent.RefreshContentTransitions();
//if (content.Text.Contains("Link:TransitionRange"))
// Console.WriteLine("Here");
while (content.Text.Contains("Link:Transition")) while (content.Text.Contains("Link:Transition"))
{ {
TranCheckCount++; TranCheckCount++;
TranConvertCount++; TranConvertCount++;
if (content.FixTransitionText(null, true)) if (content.FixTransitionText(null, true))
{ {
ContentInfo.OnStaticContentInfoChange(itemInfo, new StaticContentInfoEventArgs("", "", "")); ContentInfo.OnStaticContentInfoChange(itemInfo, new StaticContentInfoEventArgs("", "", ""));
if (itemInfo.MyContent.MyGrid != null) if (itemInfo.MyContent.MyGrid != null)
{
content.ConvertTransitionToTextInGrid(null, null); content.ConvertTransitionToTextInGrid(null, null);
}
content.Save(); content.Save();
} }
else // B2018-043 Eliminate infinite loop for invalid transition structure else // B2018-043 Eliminate infinite loop for invalid transition structure
@ -759,14 +768,21 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
// B2021-008: Delete the transition record if there is no link in the text // B2021-008: Delete the transition record if there is no link in the text
if (mc.Count == 0 && itemInfo.MyContent.ContentTransitionCount > 0) if (mc.Count == 0 && itemInfo.MyContent.ContentTransitionCount > 0)
{ {
TranCheckCount++; TranCheckCount++;
TranFixCount++; TranFixCount++;
if (itemInfo.MyContent.ContentTransitions != null) if (itemInfo.MyContent.ContentTransitions != null)
{
foreach (TransitionInfo ct in itemInfo.MyContent.ContentTransitions) foreach (TransitionInfo ct in itemInfo.MyContent.ContentTransitions)
{
Transition.Delete(ct.TransitionID); Transition.Delete(ct.TransitionID);
}
}
itemInfo.MyContent.RefreshContentTransitions(); itemInfo.MyContent.RefreshContentTransitions();
} }
@ -800,10 +816,12 @@ namespace VEPROMS.CSLA.Library
string txt = myContent.Text; string txt = myContent.Text;
string regDelete = @"(\\v |)\<START\]\#Link\:Transition(|Range)\:[0-9]+ [0-9]+ [0-9]+(| [0-9]+)\[END\>(\\v0 |)"; string regDelete = @"(\\v |)\<START\]\#Link\:Transition(|Range)\:[0-9]+ [0-9]+ [0-9]+(| [0-9]+)\[END\>(\\v0 |)";
string txt2=txt; string txt2=txt;
do{ do{
txt = txt2; txt = txt2;
txt2 = Regex.Replace(txt, regDelete, ""); txt2 = Regex.Replace(txt, regDelete, "");
} while(txt2 != txt); } while(txt2 != txt);
if(txt2 != myContent.Text) if(txt2 != myContent.Text)
{ {
using(Content tmp = myContent.Get()) using(Content tmp = myContent.Get())
@ -814,15 +832,7 @@ namespace VEPROMS.CSLA.Library
AddInvalidTransitionAnnotation(itemInfo, "Removed Empty Transition Text"); AddInvalidTransitionAnnotation(itemInfo, "Removed Empty Transition Text");
} }
} }
//private static bool IsTransitionToDisconnected(TransitionInfo ti)
//{
// foreach (TransitionInfo til in TransitionsToDisconnected)
// {
// if (ti.TransitionID == til.TransitionID)
// return true;
// }
// return false;
//}
private static bool IsTransitionToNonEditable(TransitionInfo ti) private static bool IsTransitionToNonEditable(TransitionInfo ti)
{ {
foreach (TransitionInfo til in TransitionsToNonEditable) foreach (TransitionInfo til in TransitionsToNonEditable)
@ -832,32 +842,39 @@ namespace VEPROMS.CSLA.Library
} }
return false; return false;
} }
public static void ResetROCounters() public static void ResetROCounters()
{ {
ROCheckCount = 0; ROCheckCount = 0;
ROFixCount = 0; ROFixCount = 0;
} }
public static int ROCheckCount = 0; public static int ROCheckCount = 0;
public static int ROFixCount = 0; public static int ROFixCount = 0;
private static AnnotationType _VolianCommentType = null; // Using this to flag ro value issues with byron to braidwood private static AnnotationType _VolianCommentType = null; // Using this to flag ro value issues with byron to braidwood
public static AnnotationType VolianCommentType public static AnnotationType VolianCommentType
{ {
get get
{ {
if (_VolianCommentType == null) if (_VolianCommentType == null)
_VolianCommentType = AnnotationType.GetByName("Volian Comment"); _VolianCommentType = AnnotationType.GetByName("Volian Comment");
if (_VolianCommentType == null) if (_VolianCommentType == null)
_VolianCommentType = AnnotationType.MakeAnnotationType("Volian Comment", null); _VolianCommentType = AnnotationType.MakeAnnotationType("Volian Comment", null);
return _VolianCommentType; return _VolianCommentType;
} }
} }
public void UpdateROText() public void UpdateROText()
{ {
if (this.MyDocVersion.DocVersionAssociationCount == 0) return; if (this.MyDocVersion.DocVersionAssociationCount == 0) return;
ROFstInfo rofstinfo = this.MyDocVersion.DocVersionAssociations[0].MyROFst; ROFstInfo rofstinfo = this.MyDocVersion.DocVersionAssociations[0].MyROFst;
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(this.MyDocVersion); ROFSTLookup lookup = rofstinfo.GetROFSTLookup(this.MyDocVersion);
lookup.MyDocVersionInfo = this.MyDocVersion;
lookup.MyItemInfo = this; // B2022-020 to pass information into error log if needed lookup.MyItemInfo = this; // B2022-020 to pass information into error log if needed
if (this.MyContent.ContentRoUsageCount > 0) if (this.MyContent.ContentRoUsageCount > 0)
{ {
foreach (RoUsageInfo rousage in this.MyContent.ContentRoUsages) foreach (RoUsageInfo rousage in this.MyContent.ContentRoUsages)
@ -883,28 +900,34 @@ namespace VEPROMS.CSLA.Library
} }
} }
else else
{
content.FixContentText(rousage, roval, roch.type, rofstinfo); content.FixContentText(rousage, roval, roch.type, rofstinfo);
}
content.Save(); content.Save();
} }
} }
} }
} }
} }
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo) // B2022-026 RO Memory Reduction code - pass in ROFstInfo
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
{ {
if (itemInfo.MyContent.ContentPartCount > 0) if (itemInfo.MyContent.ContentPartCount > 0)
{
foreach (PartInfo pi in itemInfo.MyContent.ContentParts) foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
{ {
//List<ItemInfo> myItems = new List<ItemInfo>();
foreach (ItemInfo ii in pi.MyItems) foreach (ItemInfo ii in pi.MyItems)
// myItems.Add(ii); {
//foreach (ItemInfo ii in myItems) MyRefreshReferenceObjects(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo, origROFst);
MyRefreshReferenceObjects(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo);
} }
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst; }
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo); }
lookup.MyDocVersionInfo = docVersionInfo;
// B2022-026 RO Memory Reduction code - get ROLookup from passed in ROFstInfo
ROFSTLookup lookup = origROFst.GetROFSTLookup(docVersionInfo);
lookup.MyItemInfo = itemInfo; // B2022-020 to pass information into error log if needed lookup.MyItemInfo = itemInfo; // B2022-020 to pass information into error log if needed
if (itemInfo.MyContent.ContentRoUsageCount > 0) if (itemInfo.MyContent.ContentRoUsageCount > 0)
{ {
foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages) foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages)
@ -915,8 +938,9 @@ namespace VEPROMS.CSLA.Library
string oldText = itemInfo.MyContent.Text; string oldText = itemInfo.MyContent.Text;
string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues); string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues);
ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID); ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID);
itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo); itemInfo.MyContent.FixContentText(rousage, roval, roch.type, origROFst, itemInfo);
string newText = itemInfo.MyContent.Text; string newText = itemInfo.MyContent.Text;
if (DifferentROtext(newText,oldText)) if (DifferentROtext(newText,oldText))
{ {
//ShowDifference(oldText, newText); // debug - display in Visual Studio Output window //ShowDifference(oldText, newText); // debug - display in Visual Studio Output window
@ -924,7 +948,7 @@ namespace VEPROMS.CSLA.Library
Content content = Content.Get(itemInfo.MyContent.ContentID); Content content = Content.Get(itemInfo.MyContent.ContentID);
if (roval == "?") if (roval == "?")
{ {
oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo); oldText = content.ConvertROToText(rousage, roval, roch.type, origROFst);
using (Item myitem = content.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153 using (Item myitem = content.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
{ {
myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060 myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
@ -934,7 +958,7 @@ namespace VEPROMS.CSLA.Library
} }
else else
{ {
content.FixContentText(rousage, roval, roch.type, rofstinfo); content.FixContentText(rousage, roval, roch.type, origROFst);
} }
content.UserID = Volian.Base.Library.VlnSettings.UserID; content.UserID = Volian.Base.Library.VlnSettings.UserID;
content.DTS = DateTime.Now; content.DTS = DateTime.Now;
@ -949,12 +973,17 @@ namespace VEPROMS.CSLA.Library
{ {
string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " "); string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " "); string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
if (nt.Equals(ot)) if (nt.Equals(ot))
{
return false; return false;
}
return true; return true;
} }
#region debug
#region Debug Code
//private static void ShowDifference(string oldText, string newText) //private static void ShowDifference(string oldText, string newText)
//{ //{
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " "); // string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
@ -974,7 +1003,9 @@ namespace VEPROMS.CSLA.Library
// } // }
// Console.WriteLine("{0}='{1}'",title,sb.ToString()); // Console.WriteLine("{0}='{1}'",title,sb.ToString());
//} //}
#endregion // debug #endregion // debug
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup) internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
{ {
if (itemInfo.MyContent.ContentPartCount > 0) if (itemInfo.MyContent.ContentPartCount > 0)
@ -995,21 +1026,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
//internal static long ticksROUsage;
//internal static long ticksItems;
//internal static long ticksTrans;
//internal static void ResetTicks()
//{
// ticksROUsage = 0;
// ticksItems = 0;
// ticksTrans = 0;
//}
//internal static void ShowTicks()
//{
// Console.WriteLine("ROUsage: {0}", TimeSpan.FromTicks(ticksROUsage).TotalSeconds);
// Console.WriteLine("Items: {0}", TimeSpan.FromTicks(ticksItems).TotalSeconds);
// Console.WriteLine("Transitions: {0}", TimeSpan.FromTicks(ticksTrans).TotalSeconds);
//}
public static string GetCombinedTab(ItemInfo itemInfo, string parTab) public static string GetCombinedTab(ItemInfo itemInfo, string parTab)
{ {
string pTab = parTab == null ? "" : parTab; string pTab = parTab == null ? "" : parTab;
@ -1034,6 +1051,7 @@ namespace VEPROMS.CSLA.Library
if (itemInfo.HasParentTab) return thisTab.Trim(); // F2020-023: if tab includes parent tab already, don't concatenate it if (itemInfo.HasParentTab) return thisTab.Trim(); // F2020-023: if tab includes parent tab already, don't concatenate it
return pTab + thisTab.Trim(); return pTab + thisTab.Trim();
} }
internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup) internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
{ {
if (itemInfo == null) return; if (itemInfo == null) return;
@ -1044,17 +1062,20 @@ namespace VEPROMS.CSLA.Library
itemInfo.ActiveSection = sectionInfo; itemInfo.ActiveSection = sectionInfo;
itemInfo.ActiveFormat = itemInfo.MyContent.MyFormat != null ? itemInfo.MyContent.MyFormat : sectionInfo == null ? itemParent.ActiveFormat : sectionInfo.ActiveFormat; itemInfo.ActiveFormat = itemInfo.MyContent.MyFormat != null ? itemInfo.MyContent.MyFormat : sectionInfo == null ? itemParent.ActiveFormat : sectionInfo.ActiveFormat;
itemInfo.MyDocVersion = docVersionInfo; itemInfo.MyDocVersion = docVersionInfo;
if (itemInfo.IsStep) if (itemInfo.IsStep)
{ {
ItemInfo ip = itemParent as ItemInfo; ItemInfo ip = itemParent as ItemInfo;
itemInfo.CombinedTab = (ip == null) ? itemInfo.MyTab.CleanText.Trim() : GetCombinedTab(itemInfo, ip.CombinedTab); itemInfo.CombinedTab = (ip == null) ? itemInfo.MyTab.CleanText.Trim() : GetCombinedTab(itemInfo, ip.CombinedTab);
} }
if (docVersionInfo.DocVersionAssociationCount == 1) if (docVersionInfo.DocVersionAssociationCount == 1)
{ {
string otherChildUnit = null; string otherChildUnit = null;
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst; ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst;
//rofstinfo.docVer = docVersionInfo; //rofstinfo.docVer = docVersionInfo;
string rawPrcNum = itemInfo.MyProcedure.MyContent.Number; string rawPrcNum = itemInfo.MyProcedure.MyContent.Number;
// C2022-001 see if we need to get the Other child info from ROLookUp // C2022-001 see if we need to get the Other child info from ROLookUp
if (rawPrcNum.ToUpper().StartsWith("<U\\U8209?OTHER")) // proc number has <u-otherxxx> in its definiation (procedure property page) if (rawPrcNum.ToUpper().StartsWith("<U\\U8209?OTHER")) // proc number has <u-otherxxx> in its definiation (procedure property page)
{ {
@ -1064,11 +1085,11 @@ namespace VEPROMS.CSLA.Library
} }
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo, otherChildUnit); ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo, otherChildUnit);
lookup.MyDocVersionInfo = docVersionInfo;
lookup.MyItemInfo = itemInfo; // B2022-020 to pass information into error log if needed lookup.MyItemInfo = itemInfo; // B2022-020 to pass information into error log if needed
//DateTime dts = DateTime.Now;
if (itemInfo.MyContent.ContentGridCount > 0) if (itemInfo.MyContent.ContentGridCount > 0)
itemInfo.MyContent.LoadNonCachedGrid(); itemInfo.MyContent.LoadNonCachedGrid();
if (itemInfo.MyContent.ContentRoUsageCount > 0) if (itemInfo.MyContent.ContentRoUsageCount > 0)
{ {
foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages) foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages)
@ -1087,39 +1108,27 @@ namespace VEPROMS.CSLA.Library
// Force Error Message // Force Error Message
docVersionInfo.GetROFst(0); docVersionInfo.GetROFst(0);
} }
//TimeSpan ts = DateTime.Now.Subtract(dts);
//ticksROUsage += ts.Ticks;
//dts = DateTime.Now;
if (itemInfo.MyContent.ContentPartCount > 0) if (itemInfo.MyContent.ContentPartCount > 0)
{ {
foreach (PartInfo pi in itemInfo.MyContent.ContentParts) foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
{ {
//ItemInfo il = null;
foreach (ItemInfo ii in pi.MyItems) foreach (ItemInfo ii in pi.MyItems)
{ {
SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo, tranLookup); SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo, tranLookup);
//if(ii._MyPrevious == null)
// ii.MyPrevious = il;
//if (il != null) il.NextItem = ii;
//il = ii;
} }
} }
} }
//ts = DateTime.Now.Subtract(dts);
//ticksItems += ts.Ticks;
//dts = DateTime.Now;
if (itemInfo.MyContent.ContentTransitionCount > 0) if (itemInfo.MyContent.ContentTransitionCount > 0)
{ {
//itemInfo.UpdateTransitionText();
foreach (TransitionInfo traninfo in itemInfo.MyContent.ContentTransitions) foreach (TransitionInfo traninfo in itemInfo.MyContent.ContentTransitions)
{ {
//itemInfo.UpdateTransitionText();
itemInfo.MyContent.FixTransitionText(traninfo, tranLookup, itemInfo); itemInfo.MyContent.FixTransitionText(traninfo, tranLookup, itemInfo);
} }
} }
//ts = DateTime.Now.Subtract(dts);
//ticksTrans += ts.Ticks;
} }
private int _PrintBias = 0; private int _PrintBias = 0;
public int PrintBias public int PrintBias
{ {
@ -7127,10 +7136,11 @@ namespace VEPROMS.CSLA.Library
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0) if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
MyRefreshTransitions(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion, tranLookup); MyRefreshTransitions(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion, tranLookup);
} }
public static void RefreshReferenceObjects(ProcedureInfo tmp) // B2022-026 RO Memory Reduction code - added ROFstInfo parameter
public static void RefreshReferenceObjects(ProcedureInfo tmp, ROFstInfo origROFst)
{ {
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0) if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
MyRefreshReferenceObjects(tmp, tmp.MyDocVersion, null, tmp.MyDocVersion); MyRefreshReferenceObjects(tmp, tmp.MyDocVersion, null, tmp.MyDocVersion, origROFst);
} }
public static void RefreshPageNumTransitions(ProcedureInfo tmp) public static void RefreshPageNumTransitions(ProcedureInfo tmp)
{ {

View File

@ -16,6 +16,7 @@ namespace VEPROMS.CSLA.Library
Procedure = 0, Document = 1, DocVersion = 2, Folder = 3, Session = 4 Procedure = 0, Document = 1, DocVersion = 2, Folder = 3, Session = 4
} }
#endregion #endregion
#region SessionInfoList stuff #region SessionInfoList stuff
public partial class SessionInfoList public partial class SessionInfoList
{ {
@ -67,6 +68,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
#endregion #endregion
#region SessionInfo stuff #region SessionInfo stuff
public partial class SessionInfo public partial class SessionInfo
{ {
@ -750,6 +752,7 @@ namespace VEPROMS.CSLA.Library
#endregion #endregion
} }
#endregion #endregion
#region OwnerInfo stuff #region OwnerInfo stuff
public partial class OwnerInfoList public partial class OwnerInfoList
{ {
@ -1072,29 +1075,36 @@ namespace VEPROMS.CSLA.Library
} }
} }
#endregion #endregion
#region UserInfo stuff #region UserInfo stuff
public partial class UserInfo public partial class UserInfo
{ {
public static bool CanEdit(UserInfo myUserInfo, DocVersionInfo myDVI) public static bool CanEdit(UserInfo myUserInfo, DocVersionInfo myDVI)
{ {
return myUserInfo!=null && myDVI!=null && (myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsWriter(myDVI)); return myUserInfo!=null && myDVI!=null && (myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsWriter(myDVI));
} }
public static bool CanEditROs(UserInfo myUserInfo, DocVersionInfo myDVI) public static bool CanEditROs(UserInfo myUserInfo, DocVersionInfo myDVI)
{ {
return myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsROEditor(myDVI); return myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsROEditor(myDVI);
} }
public static bool CanCreateFolders(UserInfo myUserInfo, DocVersionInfo myDVI) public static bool CanCreateFolders(UserInfo myUserInfo, DocVersionInfo myDVI)
{ {
return myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI); return myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI);
} }
public static bool CanCreateFolders(UserInfo myUserInfo, FolderInfo fi) public static bool CanCreateFolders(UserInfo myUserInfo, FolderInfo fi)
{ {
return myUserInfo != null && fi != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(fi.MyParent); //B2020-111 allow if set amin controls parent return myUserInfo != null && fi != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(fi.MyParent); //B2020-111 allow if set amin controls parent
} }
public bool IsAdministrator() public bool IsAdministrator()
{ {
if (this.UserMembershipCount == 0) if (this.UserMembershipCount == 0)
return false; return false;
foreach (MembershipInfo mi in this.UserMemberships) foreach (MembershipInfo mi in this.UserMemberships)
{ {
if (mi.EndDate == string.Empty) if (mi.EndDate == string.Empty)
@ -1108,6 +1118,7 @@ namespace VEPROMS.CSLA.Library
} }
return false; return false;
} }
//B2020-111, B2020-114, C2020-035 this was setting the passed in parameter, such that the first time this //B2020-111, B2020-114, C2020-035 this was setting the passed in parameter, such that the first time this
// was called, the passed in parameter was set to the top node (VEPROMS). The check of other folders // was called, the passed in parameter was set to the top node (VEPROMS). The check of other folders
// would then be skipped (from where is called) // would then be skipped (from where is called)
@ -1115,6 +1126,7 @@ namespace VEPROMS.CSLA.Library
{ {
if (this.UserMembershipCount == 0 || fldinf == null) if (this.UserMembershipCount == 0 || fldinf == null)
return false; return false;
foreach (MembershipInfo mi in this.UserMemberships) foreach (MembershipInfo mi in this.UserMemberships)
{ {
if (mi.EndDate == string.Empty) if (mi.EndDate == string.Empty)
@ -1137,10 +1149,12 @@ namespace VEPROMS.CSLA.Library
} }
return false; return false;
} }
public bool IsSetAdministrator(DocVersionInfo dv) public bool IsSetAdministrator(DocVersionInfo dv)
{ {
if (this.UserMembershipCount == 0) if (this.UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
return false; return false;
foreach (MembershipInfo mi in this.UserMemberships) foreach (MembershipInfo mi in this.UserMemberships)
{ {
if (mi.EndDate == string.Empty) if (mi.EndDate == string.Empty)
@ -1162,10 +1176,12 @@ namespace VEPROMS.CSLA.Library
} }
return false; return false;
} }
public bool IsWriter(DocVersionInfo dv) public bool IsWriter(DocVersionInfo dv)
{ {
if (this.UserMembershipCount == 0) if (this.UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
return false; return false;
foreach (MembershipInfo mi in this.UserMemberships) foreach (MembershipInfo mi in this.UserMemberships)
{ {
if (mi.EndDate == string.Empty) if (mi.EndDate == string.Empty)
@ -1187,10 +1203,12 @@ namespace VEPROMS.CSLA.Library
} }
return false; return false;
} }
public bool IsReviewer(DocVersionInfo dv) public bool IsReviewer(DocVersionInfo dv)
{ {
if (this.UserMembershipCount == 0) if (this.UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
return false; return false;
foreach (MembershipInfo mi in this.UserMemberships) foreach (MembershipInfo mi in this.UserMemberships)
{ {
if (mi.EndDate == string.Empty) if (mi.EndDate == string.Empty)
@ -1212,10 +1230,12 @@ namespace VEPROMS.CSLA.Library
} }
return false; return false;
} }
public bool IsROEditor(DocVersionInfo dv) public bool IsROEditor(DocVersionInfo dv)
{ {
if (this.UserMembershipCount == 0) if (this.UserMembershipCount == 0 || dv == null) // B2022-026 RO Memory reduction - check for null DocVersionInfo
return false; return false;
foreach (MembershipInfo mi in this.UserMemberships) foreach (MembershipInfo mi in this.UserMemberships)
{ {
if (mi.EndDate == string.Empty) if (mi.EndDate == string.Empty)
@ -1237,6 +1257,7 @@ namespace VEPROMS.CSLA.Library
} }
return false; return false;
} }
// B2018-112 added for easy check if user's PROMS Security allows making edits - used in StepTabRibbon - SetButtonAndMenuEnabling() // B2018-112 added for easy check if user's PROMS Security allows making edits - used in StepTabRibbon - SetButtonAndMenuEnabling()
public bool IsAllowedToEdit(DocVersionInfo dvi) public bool IsAllowedToEdit(DocVersionInfo dvi)
{ {
@ -1259,6 +1280,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on UserInfo.GetByUserID", ex); throw new DbCslaException("Error on UserInfo.GetByUserID", ex);
} }
} }
[Serializable()] [Serializable()]
protected class GetByUserIDCriteria protected class GetByUserIDCriteria
{ {
@ -1270,6 +1292,7 @@ namespace VEPROMS.CSLA.Library
_UserID = userID; _UserID = userID;
} }
} }
private void DataPortal_Fetch(GetByUserIDCriteria criteria) private void DataPortal_Fetch(GetByUserIDCriteria criteria)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserInfo.DataPortal_Fetch", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserInfo.DataPortal_Fetch", GetHashCode());
@ -1307,5 +1330,6 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
#endregion #endregion
} }

File diff suppressed because it is too large Load Diff

View File

@ -435,7 +435,8 @@ namespace VEPROMS.CSLA.Library
_UserID = dr.GetString("UserID"); _UserID = dr.GetString("UserID");
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8);
_ROFst_RODbID = dr.GetInt32("ROFst_RODbID"); _ROFst_RODbID = dr.GetInt32("ROFst_RODbID");
_ROFst_ROLookup = (byte[])dr.GetValue("ROFst_ROLookup"); //_ROFst_ROLookup = (byte[])dr.GetValue("ROFst_ROLookup");
_ROFst_ROLookup = null; // B2022-026 RO Memory reduction - use ROlookup of null to know if we loaded the RO.FST file
_ROFst_Config = dr.GetString("ROFst_Config"); _ROFst_Config = dr.GetString("ROFst_Config");
_ROFst_DTS = dr.GetDateTime("ROFst_DTS"); _ROFst_DTS = dr.GetDateTime("ROFst_DTS");
_ROFst_UserID = dr.GetString("ROFst_UserID"); _ROFst_UserID = dr.GetString("ROFst_UserID");

View File

@ -81,12 +81,20 @@ namespace VEPROMS.CSLA.Library
} }
ClearRefreshList(); ClearRefreshList();
} }
#endregion #endregion
#region Collection #region Collection
private static List<ROFst> _CacheList = new List<ROFst>(); private static List<ROFst> _CacheList = new List<ROFst>();
protected static void AddToCache(ROFst rOFst) protected static void AddToCache(ROFst rOFst)
{ {
if (!_CacheList.Contains(rOFst)) _CacheList.Add(rOFst); // In AddToCache if (!_CacheList.Contains(rOFst))
{
rOFst.ROLookup = null; // B2022-026 RO Memory reduction
_CacheList.Add(rOFst); // In AddToCache
}
} }
protected static void RemoveFromCache(ROFst rOFst) protected static void RemoveFromCache(ROFst rOFst)
{ {
@ -105,6 +113,7 @@ namespace VEPROMS.CSLA.Library
_CacheByPrimaryKey[pKey] = new List<ROFst>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<ROFst>(); // Add new list for PrimaryKey
_CacheByRODbID_DTS[tmp.RODbID.ToString() + "_" + tmp.DTS.ToString()] = new List<ROFst>(); // Add new list for RODbID_DTS _CacheByRODbID_DTS[tmp.RODbID.ToString() + "_" + tmp.DTS.ToString()] = new List<ROFst>(); // Add new list for RODbID_DTS
} }
tmp.ROLookup = null; // B2022-026 RO Memory reduction
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheByRODbID_DTS[tmp.RODbID.ToString() + "_" + tmp.DTS.ToString()].Add(tmp); // Unique Index _CacheByRODbID_DTS[tmp.RODbID.ToString() + "_" + tmp.DTS.ToString()].Add(tmp); // Unique Index
_CacheList.RemoveAt(0); // Remove the first ROFst _CacheList.RemoveAt(0); // Remove the first ROFst
@ -124,8 +133,11 @@ namespace VEPROMS.CSLA.Library
if (_CacheByRODbID_DTS.ContainsKey(key)) return _CacheByRODbID_DTS[key][0]; if (_CacheByRODbID_DTS.ContainsKey(key)) return _CacheByRODbID_DTS[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
@ -180,14 +192,21 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
private byte[] _ROLookup; private byte[] _ROLookup;
public byte[] ROLookup public byte[] ROLookup
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("ROLookup", true); CanReadProperty("ROLookup", true);
return _ROLookup; return null; // B2022-026 RO Memory reduction
//if (_ROLookup == null)
//{
// _ROLookup = ROFSTLookup.GetRofstLookupBytes(_ROFstID);
//}
//return _ROLookup;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
@ -200,6 +219,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
private string _Config = string.Empty; private string _Config = string.Empty;
public string Config public string Config
{ {
@ -557,6 +577,7 @@ namespace VEPROMS.CSLA.Library
_Disposed = true; _Disposed = true;
RemoveFromDictionaries(); RemoveFromDictionaries();
} }
private void RemoveFromDictionaries() private void RemoveFromDictionaries()
{ {
RemoveFromCache(this); RemoveFromCache(this);
@ -580,6 +601,7 @@ namespace VEPROMS.CSLA.Library
_CacheByRODbID_DTS.Remove(myKey); // remove the list _CacheByRODbID_DTS.Remove(myKey); // remove the list
} }
} }
public static ROFst New() public static ROFst New()
{ {
if (!CanAddObject()) if (!CanAddObject())
@ -593,6 +615,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ROFst.New", ex); throw new DbCslaException("Error on ROFst.New", ex);
} }
} }
public static ROFst New(RODb myRODb, byte[] rOLookup) public static ROFst New(RODb myRODb, byte[] rOLookup)
{ {
ROFst tmp = ROFst.New(); ROFst tmp = ROFst.New();
@ -600,6 +623,7 @@ namespace VEPROMS.CSLA.Library
tmp.ROLookup = rOLookup; tmp.ROLookup = rOLookup;
return tmp; return tmp;
} }
public static ROFst New(RODb myRODb, byte[] rOLookup, string config, DateTime dts, string userID) public static ROFst New(RODb myRODb, byte[] rOLookup, string config, DateTime dts, string userID)
{ {
ROFst tmp = ROFst.New(); ROFst tmp = ROFst.New();
@ -610,22 +634,7 @@ namespace VEPROMS.CSLA.Library
tmp.UserID = userID; tmp.UserID = userID;
return tmp; return tmp;
} }
public static ROFst MakeROFst(RODb myRODb, byte[] rOLookup, string config, DateTime dts, string userID)
{
ROFst tmp = ROFst.New(myRODb, rOLookup, config, dts, userID);
if (tmp.IsSavable)
tmp = tmp.Save();
else
{
Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules();
tmp._ErrorMessage = "Failed Validation:";
foreach (Csla.Validation.BrokenRule br in brc)
{
tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName;
}
}
return tmp;
}
public static ROFst New(RODb myRODb, byte[] rOLookup, string config) public static ROFst New(RODb myRODb, byte[] rOLookup, string config)
{ {
ROFst tmp = ROFst.New(); ROFst tmp = ROFst.New();
@ -634,11 +643,23 @@ namespace VEPROMS.CSLA.Library
tmp.Config = config; tmp.Config = config;
return tmp; return tmp;
} }
public static ROFst MakeROFst(RODb myRODb, byte[] rOLookup, string config)
public static ROFst MakeROFst(RODb myRODb, byte[] rOLookup, string config, DateTime dts, string userID)
{ {
ROFst tmp = ROFst.New(myRODb, rOLookup, config); ROFst tmp = ROFst.New(myRODb, rOLookup, config, dts, userID);
if (tmp.IsSavable) if (tmp.IsSavable)
{
tmp = tmp.Save(); tmp = tmp.Save();
// B2022-026 RO Memory reduction
if (tmp.ROLookup != null && tmp.ROFstID > 0)
{
//Force Load the new Lookup Data
var RofstLookup = new ROFSTLookup(tmp.ROFstID);
tmp.ROLookup = null;
}
}
else else
{ {
Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules();
@ -648,8 +669,36 @@ namespace VEPROMS.CSLA.Library
tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName;
} }
} }
return tmp; return tmp;
} }
public static ROFst MakeROFst(RODb myRODb, byte[] rOLookup, string config)
{
ROFst tmp = ROFst.New(myRODb, rOLookup, config);
if (tmp.IsSavable)
{
tmp = tmp.Save();
// B2022-026 RO Memory reduction
//Force Load the new Lookup Data
var RofstLookup = new ROFSTLookup(tmp.ROFstID);
tmp.ROLookup = null;
}
else
{
Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules();
tmp._ErrorMessage = "Failed Validation:";
foreach (Csla.Validation.BrokenRule br in brc)
{
tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName;
}
}
return tmp;
}
public static ROFst Get(int rOFstID) public static ROFst Get(int rOFstID)
{ {
if (!CanGetObject()) if (!CanGetObject())
@ -662,11 +711,13 @@ namespace VEPROMS.CSLA.Library
tmp = DataPortal.Fetch<ROFst>(new PKCriteria(rOFstID)); tmp = DataPortal.Fetch<ROFst>(new PKCriteria(rOFstID));
AddToCache(tmp); AddToCache(tmp);
} }
if (tmp.ErrorMessage == "No Record Found") if (tmp.ErrorMessage == "No Record Found")
{ {
tmp.Dispose(); // Clean-up ROFst tmp.Dispose(); // Clean-up ROFst
tmp = null; tmp = null;
} }
return tmp; return tmp;
} }
catch (Exception ex) catch (Exception ex)
@ -674,6 +725,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ROFst.Get", ex); throw new DbCslaException("Error on ROFst.Get", ex);
} }
} }
public static ROFst GetByRODbID_DTS(int rODbID, DateTime dts) public static ROFst GetByRODbID_DTS(int rODbID, DateTime dts)
{ {
if (!CanGetObject()) if (!CanGetObject())
@ -735,6 +787,7 @@ namespace VEPROMS.CSLA.Library
RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache
AddToCache(rOFst);//Refresh the item in AllList AddToCache(rOFst);//Refresh the item in AllList
ProcessRefreshList(); ProcessRefreshList();
rOFst.ROLookup = null; // B2022-026 RO Memory reduction
return rOFst; return rOFst;
} }
catch (Exception ex) catch (Exception ex)
@ -781,6 +834,7 @@ namespace VEPROMS.CSLA.Library
// CSLATODO: Add any defaults that are necessary // CSLATODO: Add any defaults that are necessary
ValidationRules.CheckRules(); ValidationRules.CheckRules();
} }
private void ReadData(SafeDataReader dr) private void ReadData(SafeDataReader dr)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.ReadData", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.ReadData", GetHashCode());
@ -788,7 +842,8 @@ namespace VEPROMS.CSLA.Library
{ {
_ROFstID = dr.GetInt32("ROFstID"); _ROFstID = dr.GetInt32("ROFstID");
_RODbID = dr.GetInt32("RODbID"); _RODbID = dr.GetInt32("RODbID");
_ROLookup = (byte[])dr.GetValue("ROLookup"); //_ROLookup = (byte[])dr.GetValue("ROLookup");
_ROLookup = null; // B2022-026 RO Memory reduction
_Config = dr.GetString("Config"); _Config = dr.GetString("Config");
_DTS = dr.GetDateTime("DTS"); _DTS = dr.GetDateTime("DTS");
_UserID = dr.GetString("UserID"); _UserID = dr.GetString("UserID");
@ -804,6 +859,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFst.ReadData", ex); throw new DbCslaException("ROFst.ReadData", ex);
} }
} }
private void DataPortal_Fetch(PKCriteria criteria) private void DataPortal_Fetch(PKCriteria criteria)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Fetch", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Fetch", GetHashCode());
@ -846,6 +902,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFst.DataPortal_Fetch", ex); throw new DbCslaException("ROFst.DataPortal_Fetch", ex);
} }
} }
private void DataPortal_Fetch(RODbID_DTSCriteria criteria) private void DataPortal_Fetch(RODbID_DTSCriteria criteria)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Fetch", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Fetch", GetHashCode());
@ -883,6 +940,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFst.DataPortal_Fetch", ex); throw new DbCslaException("ROFst.DataPortal_Fetch", ex);
} }
} }
[Transactional(TransactionalTypes.TransactionScope)] [Transactional(TransactionalTypes.TransactionScope)]
protected override void DataPortal_Insert() protected override void DataPortal_Insert()
{ {
@ -908,6 +966,7 @@ namespace VEPROMS.CSLA.Library
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Insert", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Insert", GetHashCode());
} }
} }
[Transactional(TransactionalTypes.TransactionScope)] [Transactional(TransactionalTypes.TransactionScope)]
internal void SQLInsert() internal void SQLInsert()
{ {
@ -921,12 +980,14 @@ namespace VEPROMS.CSLA.Library
cm.CommandType = CommandType.StoredProcedure; cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout; cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "addROFst"; cm.CommandText = "addROFst";
// Input All Fields - Except Calculated Columns // Input All Fields - Except Calculated Columns
cm.Parameters.AddWithValue("@RODbID", RODbID); cm.Parameters.AddWithValue("@RODbID", RODbID);
cm.Parameters.AddWithValue("@ROLookup", _ROLookup); cm.Parameters.AddWithValue("@ROLookup", _ROLookup);
cm.Parameters.AddWithValue("@Config", _Config); cm.Parameters.AddWithValue("@Config", _Config);
if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS);
cm.Parameters.AddWithValue("@UserID", _UserID); cm.Parameters.AddWithValue("@UserID", _UserID);
// Output Calculated Columns // Output Calculated Columns
SqlParameter param_ROFstID = new SqlParameter("@newROFstID", SqlDbType.Int); SqlParameter param_ROFstID = new SqlParameter("@newROFstID", SqlDbType.Int);
param_ROFstID.Direction = ParameterDirection.Output; param_ROFstID.Direction = ParameterDirection.Output;
@ -934,11 +995,15 @@ namespace VEPROMS.CSLA.Library
SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp);
param_LastChanged.Direction = ParameterDirection.Output; param_LastChanged.Direction = ParameterDirection.Output;
cm.Parameters.Add(param_LastChanged); cm.Parameters.Add(param_LastChanged);
// CSLATODO: Define any additional output parameters
cm.ExecuteNonQuery(); cm.ExecuteNonQuery();
// Save all values being returned from the Procedure // Save all values being returned from the Procedure
_ROFstID = (int)cm.Parameters["@newROFstID"].Value; _ROFstID = (int)cm.Parameters["@newROFstID"].Value;
_LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value;
// Clear Out Any Rofst Binary (Bytes[]) - B2022-026 RO Memory reduction
_ROLookup = null;
} }
MarkOld(); MarkOld();
// update child objects // update child objects
@ -953,6 +1018,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFst.SQLInsert", ex); throw new DbCslaException("ROFst.SQLInsert", ex);
} }
} }
[Transactional(TransactionalTypes.TransactionScope)] [Transactional(TransactionalTypes.TransactionScope)]
public static byte[] Add(SqlConnection cn, ref int rOFstID, RODb myRODb, byte[] rOLookup, string config, DateTime dts, string userID) public static byte[] Add(SqlConnection cn, ref int rOFstID, RODb myRODb, byte[] rOLookup, string config, DateTime dts, string userID)
{ {
@ -964,12 +1030,14 @@ namespace VEPROMS.CSLA.Library
cm.CommandType = CommandType.StoredProcedure; cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout; cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "addROFst"; cm.CommandText = "addROFst";
// Input All Fields - Except Calculated Columns // Input All Fields - Except Calculated Columns
cm.Parameters.AddWithValue("@RODbID", myRODb.RODbID); cm.Parameters.AddWithValue("@RODbID", myRODb.RODbID);
cm.Parameters.AddWithValue("@ROLookup", rOLookup); cm.Parameters.AddWithValue("@ROLookup", rOLookup);
cm.Parameters.AddWithValue("@Config", config); cm.Parameters.AddWithValue("@Config", config);
if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts);
cm.Parameters.AddWithValue("@UserID", userID); cm.Parameters.AddWithValue("@UserID", userID);
// Output Calculated Columns // Output Calculated Columns
SqlParameter param_ROFstID = new SqlParameter("@newROFstID", SqlDbType.Int); SqlParameter param_ROFstID = new SqlParameter("@newROFstID", SqlDbType.Int);
param_ROFstID.Direction = ParameterDirection.Output; param_ROFstID.Direction = ParameterDirection.Output;
@ -977,8 +1045,12 @@ namespace VEPROMS.CSLA.Library
SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp);
param_LastChanged.Direction = ParameterDirection.Output; param_LastChanged.Direction = ParameterDirection.Output;
cm.Parameters.Add(param_LastChanged); cm.Parameters.Add(param_LastChanged);
// CSLATODO: Define any additional output parameters
cm.ExecuteNonQuery(); cm.ExecuteNonQuery();
// Clear Out Any Rofst Binary (Bytes[]) - B2022-026 RO Memory reduction
rOLookup = null;
// Save all values being returned from the Procedure // Save all values being returned from the Procedure
rOFstID = (int)cm.Parameters["@newROFstID"].Value; rOFstID = (int)cm.Parameters["@newROFstID"].Value;
return (byte[])cm.Parameters["@newLastChanged"].Value; return (byte[])cm.Parameters["@newLastChanged"].Value;
@ -990,6 +1062,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFst.Add", ex); throw new DbCslaException("ROFst.Add", ex);
} }
} }
[Transactional(TransactionalTypes.TransactionScope)] [Transactional(TransactionalTypes.TransactionScope)]
protected override void DataPortal_Update() protected override void DataPortal_Update()
{ {
@ -1013,6 +1086,7 @@ namespace VEPROMS.CSLA.Library
if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; if (!ex.Message.EndsWith("has been edited by another user.")) throw ex;
} }
} }
[Transactional(TransactionalTypes.TransactionScope)] [Transactional(TransactionalTypes.TransactionScope)]
internal void SQLUpdate() internal void SQLUpdate()
{ {
@ -1029,20 +1103,23 @@ namespace VEPROMS.CSLA.Library
cm.CommandType = CommandType.StoredProcedure; cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout; cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "updateROFst"; cm.CommandText = "updateROFst";
// All Fields including Calculated Fields // All Fields including Calculated Fields
cm.Parameters.AddWithValue("@ROFstID", _ROFstID); cm.Parameters.AddWithValue("@ROFstID", _ROFstID);
cm.Parameters.AddWithValue("@RODbID", RODbID); cm.Parameters.AddWithValue("@RODbID", RODbID);
cm.Parameters.AddWithValue("@ROLookup", _ROLookup); cm.Parameters.AddWithValue("@ROLookup", ROFSTLookup.GetRofstLookupBytes(_ROFstID)); // B2022-026 RO Memory reduction - new calls
cm.Parameters.AddWithValue("@Config", _Config); cm.Parameters.AddWithValue("@Config", _Config);
if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS);
cm.Parameters.AddWithValue("@UserID", _UserID); cm.Parameters.AddWithValue("@UserID", _UserID);
cm.Parameters.AddWithValue("@LastChanged", _LastChanged); cm.Parameters.AddWithValue("@LastChanged", _LastChanged);
// Output Calculated Columns // Output Calculated Columns
SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp);
param_LastChanged.Direction = ParameterDirection.Output; param_LastChanged.Direction = ParameterDirection.Output;
cm.Parameters.Add(param_LastChanged); cm.Parameters.Add(param_LastChanged);
// CSLATODO: Define any additional output parameters
cm.ExecuteNonQuery(); cm.ExecuteNonQuery();
// Save all values being returned from the Procedure // Save all values being returned from the Procedure
_LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value;
} }
@ -1059,6 +1136,7 @@ namespace VEPROMS.CSLA.Library
if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; if (!ex.Message.EndsWith("has been edited by another user.")) throw ex;
} }
} }
internal void Update() internal void Update()
{ {
if (!this.IsDirty) return; if (!this.IsDirty) return;
@ -1074,17 +1152,23 @@ namespace VEPROMS.CSLA.Library
if (_ROFstAssociations != null) _ROFstAssociations.Update(this); if (_ROFstAssociations != null) _ROFstAssociations.Update(this);
if (_ROFstFigures != null) _ROFstFigures.Update(this); if (_ROFstFigures != null) _ROFstFigures.Update(this);
} }
[Transactional(TransactionalTypes.TransactionScope)] [Transactional(TransactionalTypes.TransactionScope)]
public static byte[] Update(SqlConnection cn, ref int rOFstID, int rODbID, byte[] rOLookup, string config, DateTime dts, string userID, ref byte[] lastChanged) public static byte[] Update(SqlConnection cn, ref int rOFstID, int rODbID, byte[] rOLookup, string config, DateTime dts, string userID, ref byte[] lastChanged)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.Update", 0); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.Update", 0);
try try
{ {
// B2022-026 RO Memory reduction - check if we need to get the rOLookup
if (rOLookup == null)
rOLookup = ROFSTLookup.GetRofstLookupBytes(rOFstID);
using (SqlCommand cm = cn.CreateCommand()) using (SqlCommand cm = cn.CreateCommand())
{ {
cm.CommandType = CommandType.StoredProcedure; cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout; cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "updateROFst"; cm.CommandText = "updateROFst";
// Input All Fields - Except Calculated Columns // Input All Fields - Except Calculated Columns
cm.Parameters.AddWithValue("@ROFstID", rOFstID); cm.Parameters.AddWithValue("@ROFstID", rOFstID);
cm.Parameters.AddWithValue("@RODbID", rODbID); cm.Parameters.AddWithValue("@RODbID", rODbID);
@ -1093,12 +1177,14 @@ namespace VEPROMS.CSLA.Library
if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts);
cm.Parameters.AddWithValue("@UserID", userID); cm.Parameters.AddWithValue("@UserID", userID);
cm.Parameters.AddWithValue("@LastChanged", lastChanged); cm.Parameters.AddWithValue("@LastChanged", lastChanged);
// Output Calculated Columns // Output Calculated Columns
SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp);
param_LastChanged.Direction = ParameterDirection.Output; param_LastChanged.Direction = ParameterDirection.Output;
cm.Parameters.Add(param_LastChanged); cm.Parameters.Add(param_LastChanged);
// CSLATODO: Define any additional output parameters
cm.ExecuteNonQuery(); cm.ExecuteNonQuery();
// Save all values being returned from the Procedure // Save all values being returned from the Procedure
return (byte[])cm.Parameters["@newLastChanged"].Value; return (byte[])cm.Parameters["@newLastChanged"].Value;
} }

View File

@ -39,7 +39,11 @@ namespace VEPROMS.CSLA.Library
private static List<ROFstInfo> _CacheList = new List<ROFstInfo>(); private static List<ROFstInfo> _CacheList = new List<ROFstInfo>();
protected static void AddToCache(ROFstInfo rOFstInfo) protected static void AddToCache(ROFstInfo rOFstInfo)
{ {
if (!_CacheList.Contains(rOFstInfo)) _CacheList.Add(rOFstInfo); // In AddToCache if (!_CacheList.Contains(rOFstInfo))
{
rOFstInfo.ClearROLookupBytes(); // B2022-026 RO Memory reduction
_CacheList.Add(rOFstInfo); // In AddToCache
}
} }
protected static void RemoveFromCache(ROFstInfo rOFstInfo) protected static void RemoveFromCache(ROFstInfo rOFstInfo)
{ {
@ -56,6 +60,7 @@ namespace VEPROMS.CSLA.Library
{ {
_CacheByPrimaryKey[pKey] = new List<ROFstInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<ROFstInfo>(); // Add new list for PrimaryKey
} }
tmp.ClearROLookupBytes(); // B2022-026 RO Memory reduction
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first ROFstInfo _CacheList.RemoveAt(0); // Remove the first ROFstInfo
} }
@ -122,6 +127,7 @@ namespace VEPROMS.CSLA.Library
return _MyRODb; return _MyRODb;
} }
} }
private byte[] _ROLookup; private byte[] _ROLookup;
public byte[] ROLookup public byte[] ROLookup
{ {
@ -129,9 +135,17 @@ namespace VEPROMS.CSLA.Library
get get
{ {
CanReadProperty("ROLookup", true); CanReadProperty("ROLookup", true);
return _ROLookup; //if (_ROLookup == null)
//{
// _ROLookup = ROFSTLookup.GetRofstLookupBytes(_ROFstID);
//}
//return _ROLookup;
// B2022-026 RO Memory reduction
return null;
} }
} }
private string _Config = string.Empty; private string _Config = string.Empty;
public string Config public string Config
{ {
@ -238,16 +252,7 @@ namespace VEPROMS.CSLA.Library
foreach (ROFstInfo tmp in _CacheByPrimaryKey[_ROFstID.ToString()]) foreach (ROFstInfo tmp in _CacheByPrimaryKey[_ROFstID.ToString()])
tmp._ROFstFigureCount = -1; // This will cause the data to be requeried tmp._ROFstFigureCount = -1; // This will cause the data to be requeried
} }
// CSLATODO: Replace base ROFstInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current ROFstInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// CSLATODO: Check ROFstInfo.GetIdValue to assure that the ID returned is unique
/// <summary> /// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary> /// </summary>
@ -256,8 +261,11 @@ namespace VEPROMS.CSLA.Library
{ {
return MyROFstInfoUnique; // Absolutely Unique ID return MyROFstInfoUnique; // Absolutely Unique ID
} }
#endregion #endregion
#region Factory Methods #region Factory Methods
private static int _ROFstInfoUnique = 0; private static int _ROFstInfoUnique = 0;
private static int ROFstInfoUnique private static int ROFstInfoUnique
{ get { return ++_ROFstInfoUnique; } } { get { return ++_ROFstInfoUnique; } }
@ -272,6 +280,7 @@ namespace VEPROMS.CSLA.Library
private static int _CountCreated = 0; private static int _CountCreated = 0;
private static int _CountDisposed = 0; private static int _CountDisposed = 0;
private static int _CountFinalized = 0; private static int _CountFinalized = 0;
private static int IncrementCountCreated private static int IncrementCountCreated
{ get { return ++_CountCreated; } } { get { return ++_CountCreated; } }
private int _CountWhenCreated = IncrementCountCreated; private int _CountWhenCreated = IncrementCountCreated;
@ -309,6 +318,12 @@ namespace VEPROMS.CSLA.Library
foreach (ROFstInfo tmpInfo in _CacheByPrimaryKey[key]) foreach (ROFstInfo tmpInfo in _CacheByPrimaryKey[key])
tmpInfo.RefreshFields(tmp); tmpInfo.RefreshFields(tmp);
} }
// B2022-026 RO Memory reduction
public void ClearROLookupBytes()
{
_ROLookup = null;
}
protected virtual void RefreshFields(ROFst tmp) protected virtual void RefreshFields(ROFst tmp)
{ {
if (_RODbID != tmp.RODbID) if (_RODbID != tmp.RODbID)
@ -318,7 +333,8 @@ namespace VEPROMS.CSLA.Library
} }
_MyRODb = null; // Reset list so that the next line gets a new list _MyRODb = null; // Reset list so that the next line gets a new list
if (MyRODb != null) MyRODb.RefreshRODbROFsts(); // Update List for new value if (MyRODb != null) MyRODb.RefreshRODbROFsts(); // Update List for new value
_ROLookup = tmp.ROLookup; //_ROLookup = tmp.ROLookup;
_ROLookup = null; // B2022-026 RO Memory reduction
_Config = tmp.Config; _Config = tmp.Config;
_DTS = tmp.DTS; _DTS = tmp.DTS;
_UserID = tmp.UserID; _UserID = tmp.UserID;
@ -335,7 +351,8 @@ namespace VEPROMS.CSLA.Library
} }
protected virtual void RefreshFields(RODbROFst tmp) protected virtual void RefreshFields(RODbROFst tmp)
{ {
_ROLookup = tmp.ROLookup; //_ROLookup = tmp.ROLookup;
_ROLookup = null; // B2022-026 RO Memory reduction
_Config = tmp.Config; _Config = tmp.Config;
_DTS = tmp.DTS; _DTS = tmp.DTS;
_UserID = tmp.UserID; _UserID = tmp.UserID;
@ -344,8 +361,6 @@ namespace VEPROMS.CSLA.Library
} }
public static ROFstInfo Get(int rOFstID) public static ROFstInfo Get(int rOFstID)
{ {
//if (!CanGetObject())
// throw new System.Security.SecurityException("User not authorized to view a ROFst");
try try
{ {
ROFstInfo tmp = GetCachedByPrimaryKey(rOFstID); ROFstInfo tmp = GetCachedByPrimaryKey(rOFstID);
@ -354,11 +369,18 @@ namespace VEPROMS.CSLA.Library
tmp = DataPortal.Fetch<ROFstInfo>(new PKCriteria(rOFstID)); tmp = DataPortal.Fetch<ROFstInfo>(new PKCriteria(rOFstID));
AddToCache(tmp); AddToCache(tmp);
} }
if (tmp.ErrorMessage == "No Record Found") if (tmp.ErrorMessage == "No Record Found")
{ {
tmp.Dispose(); // Clean-up ROFstInfo tmp.Dispose(); // Clean-up ROFstInfo
tmp = null; tmp = null;
} }
if (tmp != null)
{
tmp.ClearROLookupBytes(); // B2022-026 RO Memory reduction
}
return tmp; return tmp;
} }
catch (Exception ex) catch (Exception ex)
@ -366,8 +388,11 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on ROFstInfo.Get", ex); throw new DbCslaException("Error on ROFstInfo.Get", ex);
} }
} }
#endregion #endregion
#region Data Access Portal #region Data Access Portal
internal ROFstInfo(SafeDataReader dr) internal ROFstInfo(SafeDataReader dr)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.Constructor", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.Constructor", GetHashCode());
@ -381,6 +406,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFstInfo.Constructor", ex); throw new DbCslaException("ROFstInfo.Constructor", ex);
} }
} }
[Serializable()] [Serializable()]
protected class PKCriteria protected class PKCriteria
{ {
@ -392,6 +418,7 @@ namespace VEPROMS.CSLA.Library
_ROFstID = rOFstID; _ROFstID = rOFstID;
} }
} }
private void ReadData(SafeDataReader dr) private void ReadData(SafeDataReader dr)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.ReadData", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.ReadData", GetHashCode());
@ -399,7 +426,8 @@ namespace VEPROMS.CSLA.Library
{ {
_ROFstID = dr.GetInt32("ROFstID"); _ROFstID = dr.GetInt32("ROFstID");
_RODbID = dr.GetInt32("RODbID"); _RODbID = dr.GetInt32("RODbID");
_ROLookup = (byte[])dr.GetValue("ROLookup"); //_ROLookup = (byte[])dr.GetValue("ROLookup");
_ROLookup = null; // B2022-026 RO Memory reduction
_Config = dr.GetString("Config"); _Config = dr.GetString("Config");
_DTS = dr.GetDateTime("DTS"); _DTS = dr.GetDateTime("DTS");
_UserID = dr.GetString("UserID"); _UserID = dr.GetString("UserID");
@ -413,6 +441,7 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFstInfo.ReadData", ex); throw new DbCslaException("ROFstInfo.ReadData", ex);
} }
} }
private void DataPortal_Fetch(PKCriteria criteria) private void DataPortal_Fetch(PKCriteria criteria)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.DataPortal_Fetch", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.DataPortal_Fetch", GetHashCode());
@ -449,7 +478,9 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFstInfo.DataPortal_Fetch", ex); throw new DbCslaException("ROFstInfo.DataPortal_Fetch", ex);
} }
} }
#endregion #endregion
// Standard Refresh // Standard Refresh
#region extension #region extension
ROFstInfoExtension _ROFstInfoExtension = new ROFstInfoExtension(); ROFstInfoExtension _ROFstInfoExtension = new ROFstInfoExtension();
@ -463,7 +494,9 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
} // Class } // Class
#region Converter #region Converter
internal class ROFstInfoConverter : ExpandableObjectConverter internal class ROFstInfoConverter : ExpandableObjectConverter
{ {
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
@ -476,5 +509,6 @@ namespace VEPROMS.CSLA.Library
return base.ConvertTo(context, culture, value, destType); return base.ConvertTo(context, culture, value, destType);
} }
} }
#endregion #endregion
} // Namespace } // Namespace

View File

@ -28,17 +28,16 @@ namespace Volian.Controls.Library
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DisplayRO));
this.tvROFST = new System.Windows.Forms.TreeView(); this.tvROFST = new System.Windows.Forms.TreeView();
this.panelValue = new System.Windows.Forms.Panel(); this.panelValue = new System.Windows.Forms.Panel();
this.lbROId = new DevComponents.DotNetBar.LabelX(); this.lbROId = new DevComponents.DotNetBar.LabelX();
this.lblROID = new DevComponents.DotNetBar.LabelX(); this.lblROID = new DevComponents.DotNetBar.LabelX();
this.pnlROButtons = new System.Windows.Forms.Panel(); this.pnlROButtons = new System.Windows.Forms.Panel();
this.btnFindDocRO = new DevComponents.DotNetBar.ButtonX();
this.btnGoToRO = new DevComponents.DotNetBar.ButtonX(); this.btnGoToRO = new DevComponents.DotNetBar.ButtonX();
this.btnPreviewRO = new DevComponents.DotNetBar.ButtonX(); this.btnPreviewRO = new DevComponents.DotNetBar.ButtonX();
this.btnCancelRO = new DevComponents.DotNetBar.ButtonX(); this.btnCancelRO = new DevComponents.DotNetBar.ButtonX();
this.btnSaveRO = new DevComponents.DotNetBar.ButtonX(); this.btnSaveRO = new DevComponents.DotNetBar.ButtonX();
this.btnFindDocRO = new DevComponents.DotNetBar.ButtonX();
this.panelRoValue = new System.Windows.Forms.Panel(); this.panelRoValue = new System.Windows.Forms.Panel();
this.tbROValue = new DevComponents.DotNetBar.Controls.TextBoxX(); this.tbROValue = new DevComponents.DotNetBar.Controls.TextBoxX();
this.lblROValue = new DevComponents.DotNetBar.LabelX(); this.lblROValue = new DevComponents.DotNetBar.LabelX();
@ -53,10 +52,9 @@ namespace Volian.Controls.Library
// //
this.tvROFST.Dock = System.Windows.Forms.DockStyle.Fill; this.tvROFST.Dock = System.Windows.Forms.DockStyle.Fill;
this.tvROFST.HideSelection = false; this.tvROFST.HideSelection = false;
this.tvROFST.Location = new System.Drawing.Point(0, 248); this.tvROFST.Location = new System.Drawing.Point(0, 202);
this.tvROFST.Margin = new System.Windows.Forms.Padding(4);
this.tvROFST.Name = "tvROFST"; this.tvROFST.Name = "tvROFST";
this.tvROFST.Size = new System.Drawing.Size(311, 376); this.tvROFST.Size = new System.Drawing.Size(233, 305);
this.tvROFST.TabIndex = 5; this.tvROFST.TabIndex = 5;
this.tvROFST.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tvROFST_BeforeExpand); this.tvROFST.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tvROFST_BeforeExpand);
this.tvROFST.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvROFST_AfterSelect); this.tvROFST.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvROFST_AfterSelect);
@ -70,9 +68,8 @@ namespace Volian.Controls.Library
this.panelValue.Controls.Add(this.panelRoValue); this.panelValue.Controls.Add(this.panelRoValue);
this.panelValue.Dock = System.Windows.Forms.DockStyle.Top; this.panelValue.Dock = System.Windows.Forms.DockStyle.Top;
this.panelValue.Location = new System.Drawing.Point(0, 0); this.panelValue.Location = new System.Drawing.Point(0, 0);
this.panelValue.Margin = new System.Windows.Forms.Padding(4);
this.panelValue.Name = "panelValue"; this.panelValue.Name = "panelValue";
this.panelValue.Size = new System.Drawing.Size(311, 180); this.panelValue.Size = new System.Drawing.Size(233, 146);
this.panelValue.TabIndex = 7; this.panelValue.TabIndex = 7;
// //
// lbROId // lbROId
@ -83,10 +80,10 @@ namespace Volian.Controls.Library
this.lbROId.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.lbROId.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lbROId.Dock = System.Windows.Forms.DockStyle.Left; this.lbROId.Dock = System.Windows.Forms.DockStyle.Left;
this.lbROId.ForeColor = System.Drawing.SystemColors.Highlight; this.lbROId.ForeColor = System.Drawing.SystemColors.Highlight;
this.lbROId.Location = new System.Drawing.Point(61, 30); this.lbROId.Location = new System.Drawing.Point(48, 24);
this.lbROId.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.lbROId.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.lbROId.Name = "lbROId"; this.lbROId.Name = "lbROId";
this.lbROId.Size = new System.Drawing.Size(244, 40); this.lbROId.Size = new System.Drawing.Size(183, 33);
this.superTooltip1.SetSuperTooltip(this.lbROId, new DevComponents.DotNetBar.SuperTooltipInfo("RO ID", "", "The RO ID for the selected RO Value will be displayed here. Double-Click to open" + this.superTooltip1.SetSuperTooltip(this.lbROId, new DevComponents.DotNetBar.SuperTooltipInfo("RO ID", "", "The RO ID for the selected RO Value will be displayed here. Double-Click to open" +
" the RO Editor.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80))); " the RO Editor.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80)));
this.lbROId.TabIndex = 11; this.lbROId.TabIndex = 11;
@ -99,14 +96,13 @@ namespace Volian.Controls.Library
// //
this.lblROID.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.lblROID.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblROID.Dock = System.Windows.Forms.DockStyle.Left; this.lblROID.Dock = System.Windows.Forms.DockStyle.Left;
this.lblROID.Location = new System.Drawing.Point(0, 30); this.lblROID.Location = new System.Drawing.Point(0, 24);
this.lblROID.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.lblROID.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.lblROID.Name = "lblROID"; this.lblROID.Name = "lblROID";
this.lblROID.Size = new System.Drawing.Size(61, 40); this.lblROID.Size = new System.Drawing.Size(48, 33);
this.superTooltip1.SetSuperTooltip(this.lblROID, new DevComponents.DotNetBar.SuperTooltipInfo("RO ID", "", "The RO ID for the selected RO Value will be displayed here.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80))); this.superTooltip1.SetSuperTooltip(this.lblROID, new DevComponents.DotNetBar.SuperTooltipInfo("RO ID", "", "The RO ID for the selected RO Value will be displayed here.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80)));
this.lblROID.TabIndex = 10; this.lblROID.TabIndex = 10;
this.lblROID.Text = "RO ID:"; this.lblROID.Text = "RO ID:";
this.lblROID.TextAlignment = System.Drawing.StringAlignment.Center;
// //
// pnlROButtons // pnlROButtons
// //
@ -116,27 +112,41 @@ namespace Volian.Controls.Library
this.pnlROButtons.Controls.Add(this.btnCancelRO); this.pnlROButtons.Controls.Add(this.btnCancelRO);
this.pnlROButtons.Controls.Add(this.btnSaveRO); this.pnlROButtons.Controls.Add(this.btnSaveRO);
this.pnlROButtons.Dock = System.Windows.Forms.DockStyle.Bottom; this.pnlROButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlROButtons.Location = new System.Drawing.Point(0, 70); this.pnlROButtons.Location = new System.Drawing.Point(0, 57);
this.pnlROButtons.Margin = new System.Windows.Forms.Padding(4);
this.pnlROButtons.Name = "pnlROButtons"; this.pnlROButtons.Name = "pnlROButtons";
this.pnlROButtons.Size = new System.Drawing.Size(311, 110); this.pnlROButtons.Size = new System.Drawing.Size(233, 89);
this.pnlROButtons.TabIndex = 9; this.pnlROButtons.TabIndex = 9;
// //
// btnFindDocRO
//
this.btnFindDocRO.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnFindDocRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnFindDocRO.Dock = System.Windows.Forms.DockStyle.Top;
this.btnFindDocRO.Enabled = false;
this.btnFindDocRO.Location = new System.Drawing.Point(0, 73);
this.btnFindDocRO.Name = "btnFindDocRO";
this.btnFindDocRO.Size = new System.Drawing.Size(233, 18);
this.superTooltip1.SetSuperTooltip(this.btnFindDocRO, new DevComponents.DotNetBar.SuperTooltipInfo("Find Doc RO", "", "Determine if there are any ROs for the selected text in a Word Document. If found" +
", the list of ROs is displayed.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnFindDocRO.TabIndex = 9;
this.btnFindDocRO.Text = "Find Doc RO";
this.btnFindDocRO.Click += new System.EventHandler(this.btnFindDocRO_Click);
//
// btnGoToRO // btnGoToRO
// //
this.btnGoToRO.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnGoToRO.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnGoToRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnGoToRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnGoToRO.Dock = System.Windows.Forms.DockStyle.Top; this.btnGoToRO.Dock = System.Windows.Forms.DockStyle.Top;
this.btnGoToRO.Enabled = false; this.btnGoToRO.Enabled = false;
this.btnGoToRO.Location = new System.Drawing.Point(0, 89); this.btnGoToRO.Location = new System.Drawing.Point(0, 55);
this.btnGoToRO.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnGoToRO.Name = "btnGoToRO"; this.btnGoToRO.Name = "btnGoToRO";
this.btnGoToRO.Size = new System.Drawing.Size(311, 22); this.btnGoToRO.Size = new System.Drawing.Size(233, 18);
this.btnGoToRO.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnGoToRO.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.superTooltip1.SetSuperTooltip(this.btnGoToRO, new DevComponents.DotNetBar.SuperTooltipInfo("Go To", "", "Opens the RO Editor and positions to the selected RO.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnGoToRO.TabIndex = 11; this.btnGoToRO.TabIndex = 11;
this.btnGoToRO.Text = "Go To"; this.btnGoToRO.Text = "Go To";
this.btnGoToRO.Click += new System.EventHandler(this.btnGoToRO_Click); this.btnGoToRO.Click += new System.EventHandler(this.btnGoToRO_Click);
this.superTooltip1.SetSuperTooltip(this.btnGoToRO, new DevComponents.DotNetBar.SuperTooltipInfo("Go To", "", "Opens the RO Editor and positions to the selected RO.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); // C2020-020
// //
// btnPreviewRO // btnPreviewRO
// //
@ -144,10 +154,10 @@ namespace Volian.Controls.Library
this.btnPreviewRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnPreviewRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnPreviewRO.Dock = System.Windows.Forms.DockStyle.Top; this.btnPreviewRO.Dock = System.Windows.Forms.DockStyle.Top;
this.btnPreviewRO.Enabled = false; this.btnPreviewRO.Enabled = false;
this.btnPreviewRO.Location = new System.Drawing.Point(0, 67); this.btnPreviewRO.Location = new System.Drawing.Point(0, 37);
this.btnPreviewRO.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnPreviewRO.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnPreviewRO.Name = "btnPreviewRO"; this.btnPreviewRO.Name = "btnPreviewRO";
this.btnPreviewRO.Size = new System.Drawing.Size(311, 22); this.btnPreviewRO.Size = new System.Drawing.Size(233, 18);
this.superTooltip1.SetSuperTooltip(this.btnPreviewRO, new DevComponents.DotNetBar.SuperTooltipInfo("Preview", "", "This will Preview the selected RO Table, X/Y Plot, or Image.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80))); this.superTooltip1.SetSuperTooltip(this.btnPreviewRO, new DevComponents.DotNetBar.SuperTooltipInfo("Preview", "", "This will Preview the selected RO Table, X/Y Plot, or Image.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80)));
this.btnPreviewRO.TabIndex = 10; this.btnPreviewRO.TabIndex = 10;
this.btnPreviewRO.Text = "Preview"; this.btnPreviewRO.Text = "Preview";
@ -159,10 +169,9 @@ namespace Volian.Controls.Library
this.btnCancelRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnCancelRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnCancelRO.Dock = System.Windows.Forms.DockStyle.Top; this.btnCancelRO.Dock = System.Windows.Forms.DockStyle.Top;
this.btnCancelRO.Enabled = false; this.btnCancelRO.Enabled = false;
this.btnCancelRO.Location = new System.Drawing.Point(0, 44); this.btnCancelRO.Location = new System.Drawing.Point(0, 18);
this.btnCancelRO.Margin = new System.Windows.Forms.Padding(4);
this.btnCancelRO.Name = "btnCancelRO"; this.btnCancelRO.Name = "btnCancelRO";
this.btnCancelRO.Size = new System.Drawing.Size(311, 23); this.btnCancelRO.Size = new System.Drawing.Size(233, 19);
this.superTooltip1.SetSuperTooltip(this.btnCancelRO, new DevComponents.DotNetBar.SuperTooltipInfo("Cancel", "", "This become active when you about to replace an existing RO link in you procedure" + this.superTooltip1.SetSuperTooltip(this.btnCancelRO, new DevComponents.DotNetBar.SuperTooltipInfo("Cancel", "", "This become active when you about to replace an existing RO link in you procedure" +
".\r\n\r\nNOTE: This willL NOT un-do after you select the Save RO button.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(195, 145))); ".\r\n\r\nNOTE: This willL NOT un-do after you select the Save RO button.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(195, 145)));
this.btnCancelRO.TabIndex = 9; this.btnCancelRO.TabIndex = 9;
@ -175,40 +184,22 @@ namespace Volian.Controls.Library
this.btnSaveRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnSaveRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnSaveRO.Dock = System.Windows.Forms.DockStyle.Top; this.btnSaveRO.Dock = System.Windows.Forms.DockStyle.Top;
this.btnSaveRO.Enabled = false; this.btnSaveRO.Enabled = false;
this.btnSaveRO.Location = new System.Drawing.Point(0, 22); this.btnSaveRO.Location = new System.Drawing.Point(0, 0);
this.btnSaveRO.Margin = new System.Windows.Forms.Padding(4);
this.btnSaveRO.Name = "btnSaveRO"; this.btnSaveRO.Name = "btnSaveRO";
this.btnSaveRO.Size = new System.Drawing.Size(311, 22); this.btnSaveRO.Size = new System.Drawing.Size(233, 18);
this.superTooltip1.SetSuperTooltip(this.btnSaveRO, new DevComponents.DotNetBar.SuperTooltipInfo("Save RO", "", "Saves the RO at the cursor location in either a step or a Word document.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); // C2020-020 this.superTooltip1.SetSuperTooltip(this.btnSaveRO, new DevComponents.DotNetBar.SuperTooltipInfo("Save RO", "", "Saves the RO at the cursor location in either a step or a Word document.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnSaveRO.TabIndex = 8; this.btnSaveRO.TabIndex = 8;
this.btnSaveRO.Text = "Save RO"; this.btnSaveRO.Text = "Save RO";
this.btnSaveRO.Click += new System.EventHandler(this.btnSaveRO_Click); this.btnSaveRO.Click += new System.EventHandler(this.btnSaveRO_Click);
// //
// btnFindDocRO
//
this.btnFindDocRO.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnFindDocRO.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnFindDocRO.Dock = System.Windows.Forms.DockStyle.Top;
this.btnFindDocRO.Enabled = false;
this.btnFindDocRO.Location = new System.Drawing.Point(0, 0);
this.btnFindDocRO.Margin = new System.Windows.Forms.Padding(4);
this.btnFindDocRO.Name = "btnFindDocRO";
this.btnFindDocRO.Size = new System.Drawing.Size(311, 22);
//see if there are any ro's for the selected text & if so, display in the lbFound li
this.superTooltip1.SetSuperTooltip(this.btnFindDocRO, new DevComponents.DotNetBar.SuperTooltipInfo("Find Doc RO", "", "Determine if there are any ROs for the selected text in a Word Document. If found, the list of ROs is displayed." , null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); // C2020-020
this.btnFindDocRO.TabIndex = 9;
this.btnFindDocRO.Text = "Find Doc RO";
this.btnFindDocRO.Click += new System.EventHandler(this.btnFindDocRO_Click);
//
// panelRoValue // panelRoValue
// //
this.panelRoValue.Controls.Add(this.tbROValue); this.panelRoValue.Controls.Add(this.tbROValue);
this.panelRoValue.Controls.Add(this.lblROValue); this.panelRoValue.Controls.Add(this.lblROValue);
this.panelRoValue.Dock = System.Windows.Forms.DockStyle.Top; this.panelRoValue.Dock = System.Windows.Forms.DockStyle.Top;
this.panelRoValue.Location = new System.Drawing.Point(0, 0); this.panelRoValue.Location = new System.Drawing.Point(0, 0);
this.panelRoValue.Margin = new System.Windows.Forms.Padding(4);
this.panelRoValue.Name = "panelRoValue"; this.panelRoValue.Name = "panelRoValue";
this.panelRoValue.Size = new System.Drawing.Size(311, 30); this.panelRoValue.Size = new System.Drawing.Size(233, 24);
this.panelRoValue.TabIndex = 8; this.panelRoValue.TabIndex = 8;
// //
// tbROValue // tbROValue
@ -220,11 +211,10 @@ namespace Volian.Controls.Library
this.tbROValue.Border.Class = "TextBoxBorder"; this.tbROValue.Border.Class = "TextBoxBorder";
this.tbROValue.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.tbROValue.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.tbROValue.Dock = System.Windows.Forms.DockStyle.Top; this.tbROValue.Dock = System.Windows.Forms.DockStyle.Top;
this.tbROValue.Location = new System.Drawing.Point(64, 0); this.tbROValue.Location = new System.Drawing.Point(48, 0);
this.tbROValue.Margin = new System.Windows.Forms.Padding(4);
this.tbROValue.Name = "tbROValue"; this.tbROValue.Name = "tbROValue";
this.tbROValue.ReadOnly = true; this.tbROValue.ReadOnly = true;
this.tbROValue.Size = new System.Drawing.Size(247, 22); this.tbROValue.Size = new System.Drawing.Size(185, 20);
this.superTooltip1.SetSuperTooltip(this.tbROValue, new DevComponents.DotNetBar.SuperTooltipInfo("RO Value", "", "The value of selected RO will be displayed here.\r\n\r\nExceptions:\r\n- Tables, X/Y Pl" + this.superTooltip1.SetSuperTooltip(this.tbROValue, new DevComponents.DotNetBar.SuperTooltipInfo("RO Value", "", "The value of selected RO will be displayed here.\r\n\r\nExceptions:\r\n- Tables, X/Y Pl" +
"ots, and Images will state what they are. The Preview button will display the va" + "ots, and Images will state what they are. The Preview button will display the va" +
"lue.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(230, 135))); "lue.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(230, 135)));
@ -239,17 +229,15 @@ namespace Volian.Controls.Library
// //
this.lblROValue.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.lblROValue.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblROValue.Dock = System.Windows.Forms.DockStyle.Left; this.lblROValue.Dock = System.Windows.Forms.DockStyle.Left;
this.lblROValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblROValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblROValue.Location = new System.Drawing.Point(0, 0); this.lblROValue.Location = new System.Drawing.Point(0, 0);
this.lblROValue.Margin = new System.Windows.Forms.Padding(4);
this.lblROValue.Name = "lblROValue"; this.lblROValue.Name = "lblROValue";
this.lblROValue.Size = new System.Drawing.Size(64, 30); this.lblROValue.Size = new System.Drawing.Size(48, 24);
this.superTooltip1.SetSuperTooltip(this.lblROValue, new DevComponents.DotNetBar.SuperTooltipInfo("RO Value", "", "The value of selected RO will be displayed here.\r\n\r\nExceptions:\r\n- Tables, X/Y Pl" + this.superTooltip1.SetSuperTooltip(this.lblROValue, new DevComponents.DotNetBar.SuperTooltipInfo("RO Value", "", "The value of selected RO will be displayed here.\r\n\r\nExceptions:\r\n- Tables, X/Y Pl" +
"ots, and Images will state what they are. The Preview button will display the va" + "ots, and Images will state what they are. The Preview button will display the va" +
"lue.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(230, 135))); "lue.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(230, 135)));
this.lblROValue.TabIndex = 6; this.lblROValue.TabIndex = 6;
this.lblROValue.Text = "RO Value:"; this.lblROValue.Text = "RO Value:";
this.lblROValue.TextLineAlignment = System.Drawing.StringAlignment.Near;
// //
// superTooltip1 // superTooltip1
// //
@ -260,11 +248,9 @@ namespace Volian.Controls.Library
// //
this.lbFound.Dock = System.Windows.Forms.DockStyle.Top; this.lbFound.Dock = System.Windows.Forms.DockStyle.Top;
this.lbFound.FormattingEnabled = true; this.lbFound.FormattingEnabled = true;
this.lbFound.ItemHeight = 16; this.lbFound.Location = new System.Drawing.Point(0, 146);
this.lbFound.Location = new System.Drawing.Point(0, 180);
this.lbFound.Margin = new System.Windows.Forms.Padding(4);
this.lbFound.Name = "lbFound"; this.lbFound.Name = "lbFound";
this.lbFound.Size = new System.Drawing.Size(311, 68); this.lbFound.Size = new System.Drawing.Size(233, 56);
this.superTooltip1.SetSuperTooltip(this.lbFound, new DevComponents.DotNetBar.SuperTooltipInfo("Available ROs", "", "ROs that are available are displayed in a tree view. ", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(this.lbFound, new DevComponents.DotNetBar.SuperTooltipInfo("Available ROs", "", "ROs that are available are displayed in a tree view. ", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.lbFound.TabIndex = 8; this.lbFound.TabIndex = 8;
this.lbFound.Visible = false; this.lbFound.Visible = false;
@ -272,14 +258,13 @@ namespace Volian.Controls.Library
// //
// DisplayRO // DisplayRO
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tvROFST); this.Controls.Add(this.tvROFST);
this.Controls.Add(this.lbFound); this.Controls.Add(this.lbFound);
this.Controls.Add(this.panelValue); this.Controls.Add(this.panelValue);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "DisplayRO"; this.Name = "DisplayRO";
this.Size = new System.Drawing.Size(311, 624); this.Size = new System.Drawing.Size(233, 507);
this.panelValue.ResumeLayout(false); this.panelValue.ResumeLayout(false);
this.pnlROButtons.ResumeLayout(false); this.pnlROButtons.ResumeLayout(false);
this.panelRoValue.ResumeLayout(false); this.panelRoValue.ResumeLayout(false);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -537,6 +537,7 @@ namespace Volian.Controls.Library
} }
else else
{ {
if (!ShuttingDown) // B2022-026 RO Memory Reduction code - don't activate if shutting down PROMS
ActivateRemainingTab((Bar)sender); ActivateRemainingTab((Bar)sender);
} }
} }

View File

@ -3347,10 +3347,17 @@ namespace Volian.Controls.Library
using (DocVersion dv = DocVersion.Get(Mydvi.VersionID)) using (DocVersion dv = DocVersion.Get(Mydvi.VersionID))
{ {
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi));
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
{
// only load the RO.fst
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
roFstInfo = Mydvi.DocVersionAssociations[0].MyROFst;
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi));// RO changes placed in file in the Documents\VEPROMS folder
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
ROFst newrofst = ROFstInfo.RefreshROFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo, DoProgressBarRefresh, null); ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
swROUpdate.Close(); swROUpdate.Close();
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange; ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
@ -3720,12 +3727,12 @@ namespace Volian.Controls.Library
} }
private void btnRefObjRefresh_Click(object sender, System.EventArgs e) private void btnRefObjRefresh_Click(object sender, System.EventArgs e)
{ {
// This code is disabled - Button is not visible //// This code is disabled - Button is not visible
this.Cursor = Cursors.WaitCursor; //this.Cursor = Cursors.WaitCursor;
ProcedureInfo.ResetROCounters(); // ProcedureInfo.ResetROCounters();
ProcedureInfo.RefreshReferenceObjects(MyItemInfo.MyProcedure as ProcedureInfo); // ProcedureInfo.RefreshReferenceObjects(MyItemInfo.MyProcedure as ProcedureInfo);
this.Cursor = Cursors.Default; // this.Cursor = Cursors.Default;
FlexibleMessageBox.Show(this, string.Format("Checked {0} referenced objects, fixed {1} referenced objects", ProcedureInfo.ROCheckCount, ProcedureInfo.ROFixCount), "Results of Refresh Referenced Objects", MessageBoxButtons.OK, MessageBoxIcon.Information); //FlexibleMessageBox.Show(this, string.Format("Checked {0} referenced objects, fixed {1} referenced objects", ProcedureInfo.ROCheckCount, ProcedureInfo.ROFixCount), "Results of Refresh Referenced Objects", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
//private FindReplace dlgFindReplace = null; //private FindReplace dlgFindReplace = null;
private void btnFindRplDlg_Click(object sender, EventArgs e) private void btnFindRplDlg_Click(object sender, EventArgs e)

View File

@ -1955,10 +1955,17 @@ namespace Volian.Controls.Library
int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion); int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion);
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID)) using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
{ {
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(MyDVI)); // RO changes placed in file in the Documents\VEPROMS folder swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(MyDVI)); // RO changes placed in file in the Documents\VEPROMS folder
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
{
// only load the RO.fst
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
roFstInfo = MyDVI.DocVersionAssociations[0].MyROFst;
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
ROFst newrofst = ROFstInfo.RefreshROFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo, DoProgressBarRefresh, null); ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
swROUpdate.Close(); swROUpdate.Close();
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange; ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);

File diff suppressed because it is too large Load Diff