From 678018c4a1df43e42dad76ae089c4a2830f776a7 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 12 Mar 2018 14:38:21 +0000 Subject: [PATCH] =?UTF-8?q?C2015-022=20Separate=20Windows=20Upgrade=20?= =?UTF-8?q?=E2=80=93=20For=20Right=20Mouse=20Click,=20don=E2=80=99t=20allo?= =?UTF-8?q?w=20Insert=20Folder=20Before/After=20in=20child=20windows=20and?= =?UTF-8?q?=20when=20a=20procedure=20set=20is=20in=20child=20window,=20onl?= =?UTF-8?q?y=20allow=20the=20Insert=20of=20a=20folder=20tree=20node.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Controls.Library/vlnTreeView.cs | 56 +++++++++++++------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index dce61be4..5d894385 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -989,28 +989,47 @@ namespace Volian.Controls.Library --Folder level see if we need to disable "Export Procedure Set" or "Folder Specific Information" */ - if (!tn.ChildrenLoaded) tn.LoadChildren(); - VETreeNode wrkdrft = (VETreeNode) tn.LastNode; - DocVersionInfo docver = wrkdrft.VEObject as DocVersionInfo; - OwnerInfoList.Reset(); - oil = OwnerInfoList.GetByVersionID(docver.VersionID); - bool greyOut = false; - foreach (OwnerInfo own in oil) - { - if (own.SessionID != MySessionInfo.SessionID) - { - greyOut = true; - break; - } - } - if (greyOut) + if (tn.MovedToSeparateWindow) { foreach (MenuItem itm in cm.MenuItems) { - if (itm.Text == "Export Procedure Set" || itm.Text == "Folder Specific Information") + if (!itm.Text.StartsWith("Insert")) // C2015-022 only enable insert folder before/after if in the main window and the procedures of this folder are in a child window itm.Enabled = false; } } + else if (tn.InChildWindow) + { + foreach (MenuItem itm in cm.MenuItems) + { + if (itm.Text.StartsWith("Insert")) // C2015-022 disable insert folder before/after if doing a properties on a folder in a child window + itm.Enabled = false; + } + } + else + { + if (!tn.ChildrenLoaded) tn.LoadChildren(); + VETreeNode wrkdrft = (VETreeNode)tn.LastNode; + DocVersionInfo docver = wrkdrft.VEObject as DocVersionInfo; + OwnerInfoList.Reset(); + oil = OwnerInfoList.GetByVersionID(docver.VersionID); + bool greyOut = false; + foreach (OwnerInfo own in oil) + { + if (own.SessionID != MySessionInfo.SessionID) + { + greyOut = true; + break; + } + } + if (greyOut) + { + foreach (MenuItem itm in cm.MenuItems) + { + if (itm.Text == "Export Procedure Set" || itm.Text == "Folder Specific Information") + itm.Enabled = false; + } + } + } } if (oil != null && oil.Count > 0 && tn.VEObject as DocVersionInfo != null) { @@ -2192,7 +2211,7 @@ namespace Volian.Controls.Library OpenProperties(tn.VEObject as SectionInfo); else if ((tn.VEObject as StepInfo) != null) MessageBox.Show("Open up info tab or whatever is associated with step"); - tn.RefreshNode(); + if (!tn.MovedToSeparateWindow) tn.RefreshNode(); // C2015-022 don't want to rebuild tree node in the main window if it is currently in a child window } private void OpenProperties(FolderInfo folderInfo) { @@ -3726,6 +3745,7 @@ namespace Volian.Controls.Library { return (VETreeNode)this.Nodes[0]; // Return the top node } + if (selectedItem == ((VETreeNode)this.Nodes[0]).VEObject) return (VETreeNode)this.Nodes[0]; // C2015-022 check needed for tree in child windows VETreeNode parent = FindNodeAndExpand(selectedItem.ActiveParent); if (parent == null) return null; if (!parent.IsExpanded) @@ -3743,7 +3763,7 @@ namespace Volian.Controls.Library foreach (TreeNode tn in tnc) if (tn is VETreeNode) { - if ((tn as VETreeNode).VEObject is ItemInfo && ((tn as VETreeNode).VEObject as ItemInfo).ItemID == (selectedItem as ItemInfo).ItemID) + if ((tn as VETreeNode).VEObject is ItemInfo && (selectedItem is ItemInfo) && ((tn as VETreeNode).VEObject as ItemInfo).ItemID == (selectedItem as ItemInfo).ItemID) return tn as VETreeNode; else {