B2022-026 RO Memory reduction coding

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

View File

@@ -189,9 +189,9 @@ namespace VEPROMS
displaySearch1.TopFolderID = myDocVersion.FolderID;
SelectedDVI = myDocVersion;
tc.VersionID = myDocVersion.VersionID;
tc.SeparateWindows = true; // need to set this in child window for goto Outside Transitions
displayBookMarks.MyBookMarks = MyParent.displayBookMarks.MyBookMarks;
displayBookMarks.SetupBookMarks(); // setup bookmarks in the child window
tc.SeparateWindows = true; // need to set this in child window for goto Outside Transitions
displayBookMarks.MyBookMarks = MyParent.displayBookMarks.MyBookMarks;
displayBookMarks.SetupBookMarks(); // setup bookmarks in the child window
tc.MyCopyStep = myParent.tc.MyCopyStep; // copy the copystep info to the child window
(tv.Nodes[0] as VETreeNode).InChildWindow = true; // tells us this folder's tree nodes are in the child window
}
@@ -324,8 +324,8 @@ namespace VEPROMS
if(Properties.Settings.Default.VersionWindows != null)
Properties.Settings.Default.VersionWindows.Clear();
Properties.Settings.Default.MRIList = null;
Properties.Settings.Default.DefaultDB = Database.SelectedDatabase;
Properties.Settings.Default.Save();
Properties.Settings.Default.DefaultDB = Database.SelectedDatabase;
Properties.Settings.Default.Save();
}
displayBookMarks.SetupBookMarks();
DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek));
@@ -348,6 +348,8 @@ namespace VEPROMS
tc.SeparateWindows = Properties.Settings.Default.SeparateWindows;
tv.PauseRefresh += tv_PauseRefresh;
tv.UnPauseRefresh += tv_UnPauseRefresh;
}
void displaySearch1_SearchComplete(object sender, DisplaySearchEventArgs args)
{
@@ -432,7 +434,7 @@ namespace VEPROMS
tv.Processing += tv_Processing;
tv.CreateContinuousActionSummary += new vlnTreeViewEvent(tv_CreateContinuousActionSummary);
tv.SelectDateToStartChangeBars += tv_SelectDateToStartChangeBars;
displayBookMarks.ResetBookMarksInPROMSWindows += displayBookMarks_ResetBookMarksInPROMSWindows;
displayBookMarks.ResetBookMarksInPROMSWindows += displayBookMarks_ResetBookMarksInPROMSWindows;
}
// Part of Separate Windows upgrade C2015-022
@@ -1284,10 +1286,10 @@ namespace VEPROMS
VolianTimer.ShowTimers();
foreach (DisplayTabItem dti in tc.MyBar.Items)
{
if (dti.MyDSOTabPanel != null)
dti.MyDSOTabPanel.CloseDSO();
else
MySessionInfo.CheckInItem(dti.OwnerID); //C2015-022 Separate Windows closing child form only left procedure ownership active
if (dti.MyDSOTabPanel != null)
dti.MyDSOTabPanel.CloseDSO();
else
MySessionInfo.CheckInItem(dti.OwnerID); //C2015-022 Separate Windows closing child form only left procedure ownership active
}
//_MyLog.WarnFormat("frmVEPROMS_FormClosing");
if (MyParent == null)
@@ -2767,6 +2769,7 @@ namespace VEPROMS
/// <param name="e"></param>
private void tmrTreeView_Tick(object sender, EventArgs e)
{
_TimeActivity2.Open();
bool giveTvFocus = true;
@@ -3231,6 +3234,7 @@ namespace VEPROMS
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null :
SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.ProgressBar = bottomProgBar;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
}
#endregion
#region InfoTabTransition
@@ -3385,6 +3389,8 @@ namespace VEPROMS
}
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.
//jcb added for error B2012-117
ItemInfo tvii;
@@ -3413,7 +3419,10 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{
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;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1)
btnPrint.Visible = false;
@@ -3471,21 +3480,19 @@ namespace VEPROMS
private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
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) return;
//if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
//{
// _RefreshRTB = args.MyEditItem.MyStepRTB;
// TmrRefreshItem.Enabled = true;
// return;
//}
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
return;
btnFixMSWord.Visible = (args != null && ( args.MyItemInfo != null && args.MyEditItem == null));
if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed)
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
_LastStepRTB = args != null && args.MyEditItem != null ? args.MyEditItem.MyStepRTB : null;
if (_LastStepRTB != null) _LastStepRTB.EditModeChanged += new StepRTBEvent(_LastStepRTB_EditModeChanged);
lblEditView.Text = " ";
if (args == null)
{
_CurrentItem = null;
@@ -3507,12 +3514,13 @@ namespace VEPROMS
{
lblItemID.Text = string.Format("ItemID = {0}", args.MyItemInfo.ItemID);
lblItemID.ForeColor = Color.DarkBlue;
if (_CurrentItem != args.MyItemInfo)
{
if (_CurrentItem != null) _CurrentItem.Deleted -= new ItemInfoEvent(_CurrentItem_Deleted);
_CurrentItem = args.MyItemInfo;
}
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
if (args.MyEditItem == null)
{
ctrlAnnotationDetails.Enabled = false;
@@ -3520,12 +3528,15 @@ namespace VEPROMS
infotabFoldoutMaint.Visible = false;
infotabTransition.Visible = false;
infotabRO.Visible = false;
if (args.MyItemInfo.MyDocVersion.DocVersionAssociations != null)
{
displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
displayRO.MyRTB = null;
infotabRO.Visible = true;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
}
infotabTags.Visible = false;
infotabApplicability.Visible = false;
// Not sure why but the following line was causing a hang if
@@ -3613,10 +3624,14 @@ namespace VEPROMS
displayTags.MyEditItem = args.MyEditItem;
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;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
if (_LastStepRTB.IsRoFigure && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 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,
// and don't allow replace on the find/replace dialog.
if (args.MyItemInfo.IsEnhancedStep)
@@ -3642,6 +3657,7 @@ namespace VEPROMS
displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
}
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);
}
}
@@ -3654,8 +3670,10 @@ namespace VEPROMS
{
ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); // set the CurrentItem (send Message) when the MSWord section is opened.
}
btnPrint.Enabled = (_CurrentItem != null);
}
/*KBR: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;
//displayRO.Mydvi = SelectedDVI;
displayRO.ProgressBar = bottomProgBar;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
}
#endregion
#region VButton