From e4866e4ecc6063216f89b934a66ae04d17281682 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 12 Mar 2018 14:35:07 +0000 Subject: [PATCH] =?UTF-8?q?C2015-022=20Separate=20Windows=20Upgrade=20?= =?UTF-8?q?=E2=80=93=20added=20logic=20to=20restore=20child=20tree=20nodes?= =?UTF-8?q?=20of=20a=20procedure=20set=20that=20was=20opened=20in=20a=20ch?= =?UTF-8?q?ild=20window=20but=20then=20closed=20C2015-022=20Separate=20Win?= =?UTF-8?q?dows=20Upgrade=20=E2=80=93=20added=20an=20event=20to=20allow=20?= =?UTF-8?q?us=20to=20update=20the=20bookmark=20list=20in=20child=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VEObjects/VETreeNode.cs | 12 ++++++ .../DisplayBookMarks.cs | 37 +++++++++++++++---- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs b/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs index c70a25cb..0169fcf3 100644 --- a/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs +++ b/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs @@ -92,6 +92,18 @@ namespace VEPROMS.CSLA.Library get { return _ChildrenLoaded; } set { _ChildrenLoaded = value; } } + protected bool _MovedToSeparateWindow = false; // C2015-022 tells us this tree node and childern are now in a child window (separate Window) - used on Parent window side for a folder context menu + public bool MovedToSeparateWindow + { + get { return _MovedToSeparateWindow; } + set { _MovedToSeparateWindow = value; } + } + protected bool _InChildWindow = false; // C2015-022 tells us this tree node is in the child window - used on child window side for folder context menu + public bool InChildWindow + { + get { return _InChildWindow; } + set { _InChildWindow = value; } + } // Reset Node //public void CloseNode() //{ diff --git a/PROMS/Volian.Controls.Library/DisplayBookMarks.cs b/PROMS/Volian.Controls.Library/DisplayBookMarks.cs index 645e0e36..847093ae 100644 --- a/PROMS/Volian.Controls.Library/DisplayBookMarks.cs +++ b/PROMS/Volian.Controls.Library/DisplayBookMarks.cs @@ -7,13 +7,27 @@ using System.Text; using System.Windows.Forms; using VEPROMS.CSLA.Library; - namespace Volian.Controls.Library { - public partial class DisplayBookMarks : UserControl + public partial class DisplayBookMarks : UserControl { - #region Properties - private MostRecentItemList _MyBookMarks; + #region delegates and Events + // C2015-022 added event so that we can update child PROMS windows + public delegate void ResetBookMarksInPROMSWindowsEvent(object sender, EventArgs args); + public event ResetBookMarksInPROMSWindowsEvent ResetBookMarksInPROMSWindows; + private void OnResetBookMarksInPROMSWindows() + { + if (ResetBookMarksInPROMSWindows != null) + ResetBookMarksInPROMSWindows(this, new EventArgs()); + } + #endregion //delegates and Events + #region Properties + private MostRecentItemList _MyBookMarks; + public MostRecentItemList MyBookMarks + { + get { return _MyBookMarks; } + set { _MyBookMarks = value; } + } private ItemInfo _CurItemInfo = null; private bool _Initalizing = false; private DisplayTabControl _MyDisplayTabControl; @@ -77,14 +91,23 @@ namespace Volian.Controls.Library } private void RefreshBookMarkData() { + ResetBookMarkList(); + OnResetBookMarksInPROMSWindows(); // C2015-022 trigger event to update child PROMS windows with current bookmark list + SaveBookMarks(); + } + + // Part of Separate Windows upgrade C2015-022 + // Call from FrmVEPROMS which spins through all of the child windows and updates the bookmark list in each + // - broke is code out of RefreshBookMarkData() + public void ResetBookMarkList() + { lbxBookMarks.DataSource = null; lbxBookMarks.DisplayMember = "MenuTitle"; lbxBookMarks.DataSource = _MyBookMarks; btnClrBookMrks.Enabled = (lbxBookMarks.Items.Count > 0); btnRmvCurBookMrk.Enabled = lbxBookMarks.SelectedIndex > -1; - SaveBookMarks(); - } - private void SaveBookMarks() + } + private void SaveBookMarks() { Properties.Settings.Default.BookMarks = _MyBookMarks.ToSettings(); Properties.Settings.Default.Save();