From e0b628dce9114fe446fc02e054a41452b48ddf9d Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 28 May 2025 18:19:24 -0400 Subject: [PATCH] B2025-024-Document-Unit-Print --- PROMS/Volian.Controls.Library/vlnTreeView.cs | 546 ++++++++++--------- 1 file changed, 287 insertions(+), 259 deletions(-) diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 6fbd3093..bdd75d47 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -22,11 +22,11 @@ namespace Volian.Controls.Library public delegate void vlnTreeViewEvent(object sender, vlnTreeEventArgs args); public delegate void vlnTreeViewTimeEvent(object sender, vlnTreeTimeEventArgs args); public delegate void vlnTreeViewStatusEvent(object sender, vlnTreeStatusEventArgs args); - public delegate ItemInfo vlnTreeViewClipboardStatusEvent(object sender, vlnTreeEventArgs args); - public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args); + public delegate ItemInfo vlnTreeViewClipboardStatusEvent(object sender, vlnTreeEventArgs args); + public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args); public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args); public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args); - + public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args); public delegate bool vlnTreeViewItemInfoDeleteFolderEvent(object sender, vlnTreeFolderDeleteEventArgs args); public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args); @@ -57,7 +57,7 @@ namespace Volian.Controls.Library { _MySectionInfo = mySectionInfo; } - public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo,bool isDeleting) + public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo, bool isDeleting) { _MySectionInfo = mySectionInfo; _IsDeleting = isDeleting; @@ -140,7 +140,7 @@ namespace Volian.Controls.Library get { return _Node; } set { _Node = value; } } - private TreeNode _Destination=null; + private TreeNode _Destination = null; public TreeNode Destination { get { return _Destination; } @@ -168,7 +168,7 @@ namespace Volian.Controls.Library //end jcb multiunit #endregion #region Factory Methods - private vlnTreeEventArgs() { ;} + private vlnTreeEventArgs() {; } public vlnTreeEventArgs(TreeNode node) { _Node = node; @@ -192,7 +192,7 @@ namespace Volian.Controls.Library #endregion public override string ToString() { - return string.Format("Node={0},Destination={1},Index={2},Unit={3},UnitIndex={4}",NodePath(this.Node),this.Destination, this.Index,this.Unit, this.UnitIndex); + return string.Format("Node={0},Destination={1},Index={2},Unit={3},UnitIndex={4}", NodePath(this.Node), this.Destination, this.Index, this.Unit, this.UnitIndex); } private string NodePath(TreeNode node) @@ -215,7 +215,7 @@ namespace Volian.Controls.Library } #endregion #region Factory Methods - private vlnTreeItemInfoEventArgs() { ;} + private vlnTreeItemInfoEventArgs() {; } public vlnTreeItemInfoEventArgs(ItemInfo myItemInfo) { _MyItemInfo = myItemInfo; @@ -231,7 +231,7 @@ namespace Volian.Controls.Library FolderId = folderId; } } - public enum E_InsertType {Before, After, Child}; + public enum E_InsertType { Before, After, Child }; public partial class vlnTreeItemInfoInsertEventArgs { #region Business Methods @@ -267,7 +267,7 @@ namespace Volian.Controls.Library } #endregion #region Factory Methods - private vlnTreeItemInfoInsertEventArgs() { ;} + private vlnTreeItemInfoInsertEventArgs() {; } public vlnTreeItemInfoInsertEventArgs(ItemInfo myItemInfo, E_InsertType insertType, string stepText) { _MyItemInfo = myItemInfo; @@ -314,7 +314,7 @@ namespace Volian.Controls.Library } #endregion #region Factory Methods - private vlnTreeItemInfoPasteEventArgs() { ;} + private vlnTreeItemInfoPasteEventArgs() {; } public vlnTreeItemInfoPasteEventArgs(ItemInfo myItemInfo, int copyStartId, ItemInfo.EAddpingPart pasteType, int? type) { _MyItemInfo = myItemInfo; @@ -322,7 +322,7 @@ namespace Volian.Controls.Library _PasteType = pasteType; _Type = type; } - + #endregion } #endregion @@ -364,7 +364,7 @@ namespace Volian.Controls.Library get { return _SectionConfig; } set { _ConfigObject = _SectionConfig = value; } } - private vlnTreePropertyEventArgs() { ;} + private vlnTreePropertyEventArgs() {; } public vlnTreePropertyEventArgs(string title, FolderConfig folderConfig) { _Title = title; @@ -573,16 +573,16 @@ namespace Volian.Controls.Library { if (ProcedureCheckedOutTo != null) ProcedureCheckedOutTo(sender, args); } - - - - - - public event vlnTreeViewEvent ExportImportProcedureSets; - private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args) - { - if (ExportImportProcedureSets != null) ExportImportProcedureSets(sender, args); - } + + + + + + public event vlnTreeViewEvent ExportImportProcedureSets; + private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args) + { + if (ExportImportProcedureSets != null) ExportImportProcedureSets(sender, args); + } public event vlnTreeViewEvent PrintTransitionReport; private void OnPrintTransitionReport(object sender, vlnTreeEventArgs args) { @@ -634,7 +634,7 @@ namespace Volian.Controls.Library // This event was added to update the Step Properties/RO & Tools/Search RO & Reports // when an update of ro.fst is done & the ro trees on those panels needs refreshed. // (bug fix B2015-226) - public event StepPanelTabDisplayEvent TabDisplay; + public event StepPanelTabDisplayEvent TabDisplay; private void OnTabDisplay(object sender, StepPanelTabDisplayEventArgs args) { if (TabDisplay != null) TabDisplay(sender, args); @@ -720,39 +720,39 @@ namespace Volian.Controls.Library //_MyLog.WarnFormat("Context Menu 1b - {0}", GC.GetTotalMemory(true)); if (ui.IsAdministrator() || ui.IsSetAdministrator(fi)) { - if (fi.MyParent != null) // don't allow insert before/after if at top node + if (fi.MyParent != null) // don't allow insert before/after if at top node { if (!ui.IsAdministrator() && DoSpecificInfo) cm.MenuItems.Add("Procedure Set Specific Information", new EventHandler(mi_Click)); // B2020-111 only allow Set Administrator to add new folders inside folders they admininstrate - if (ui.IsAdministrator()||ui.IsSetAdministrator(fi.MyParent)) + if (ui.IsAdministrator() || ui.IsSetAdministrator(fi.MyParent)) { cm.MenuItems.Add("Insert Folder Before", new EventHandler(mi_Click)); cm.MenuItems.Add("Insert Folder After", new EventHandler(mi_Click)); } } // B2020-111 only allow Set Administrator to add new folders inside folders they admininstrate - if ((ui.IsAdministrator() || ui.IsSetAdministrator(fi.MyParent)) && fi.FolderDocVersionCount == 0) + if ((ui.IsAdministrator() || ui.IsSetAdministrator(fi.MyParent)) && fi.FolderDocVersionCount == 0) cm.MenuItems.Add("New Folder", new EventHandler(mi_Click)); - if (fi.ChildFolderCount == 0 && !fi.HasWorkingDraft) + if (fi.ChildFolderCount == 0 && !fi.HasWorkingDraft) cm.MenuItems.Add("Create Working Draft", new EventHandler(mi_Click)); } - if (fi.HasWorkingDraft) + if (fi.HasWorkingDraft) cm.MenuItems.Add("Print Transition Report", new EventHandler(mi_Click)); } - else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs + else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs { isWrkDftNode = true; //_MyLog.WarnFormat("Context Menu 1c - {0}", GC.GetTotalMemory(true)); DocVersionInfo dvi = tn.VEObject as DocVersionInfo; if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi)) - { - cm.MenuItems.Add("Import Procedure", mi_Click); - } - if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi) || ui.IsWriter(dvi)) + { + cm.MenuItems.Add("Import Procedure", mi_Click); + } + if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi) || ui.IsWriter(dvi)) { OwnerInfoList.Reset(); oil = OwnerInfoList.GetByVersionID(dvi.VersionID); - if (dvi.ActiveFormat.PlantFormat.FormatData.SpecificInfo) + if (dvi.ActiveFormat.PlantFormat.FormatData.SpecificInfo) cm.MenuItems.Add("Procedure Set Specific Information", new EventHandler(mi_Click)); cm.MenuItems.Add("Refresh Checked Out Procedures", new EventHandler(mi_Click)); cm.MenuItems.Add("New Procedure", new EventHandler(mi_Click)); @@ -839,15 +839,15 @@ namespace Volian.Controls.Library urv.Enabled = !dvi.ROfstLastCompleted || dvi.NewerRoFst; } } - else if (tn.VEObject as ProcedureInfo != null) // Procs can only contain sections + else if (tn.VEObject as ProcedureInfo != null) // Procs can only contain sections { isProcNode = true; ProcedureInfo pri = tn.VEObject as ProcedureInfo; oi = OwnerInfo.GetByItemID(pri.ItemID, CheckOutType.Procedure); if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion)) - { - cm.MenuItems.Add("Export Procedure", mi_Click); - } + { + cm.MenuItems.Add("Export Procedure", mi_Click); + } if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion) || ui.IsWriter(pri.MyDocVersion)) { if (oi != null && oi.SessionID != MySessionInfo.SessionID) @@ -898,7 +898,7 @@ namespace Volian.Controls.Library } cm.MenuItems.Add(micas); cm.MenuItems.Add(mitcas); - cm.MenuItems.Add(mip); + cm.MenuItems.Add(mip); cm.MenuItems.Add(miqp); //cm.MenuItems.Add(mips); AddShowChangeBarsAfterMenuItem(cm.MenuItems, pri); @@ -1081,10 +1081,37 @@ namespace Volian.Controls.Library // require clearing of all enhanced config data or mapping it to existing data (quite complicated) if ((ui.IsAdministrator() || ui.IsSetAdministrator(i.MyProcedure.MyDocVersion) || ui.IsWriter(i.MyProcedure.MyDocVersion)) && (!i.IsEnhancedStep && !i.IsEnhancedProcedure && !i.IsEnhancedSection && !i.IsRtfRaw && !i.IsFigure)) cm.MenuItems.Add("Copy", new EventHandler(mi_Click)); + //if (i.HasWordContent) + //{ + // cm.MenuItems.Add("Print Section", new EventHandler(mi_Click)); + // cm.MenuItems.Add("Quick Print Section", new EventHandler(mi_Click)); + //} if (i.HasWordContent) { - cm.MenuItems.Add("Print Section", new EventHandler(mi_Click)); - cm.MenuItems.Add("Quick Print Section", new EventHandler(mi_Click)); + if (i.MyDocVersion.MultiUnitCount > 1) + { + if (!i.IsSubsection) + { + MenuItem mps = new MenuItem("Print Section"); + MenuItem mqps = new MenuItem("Quick Print Section"); + int k = 0; + foreach (string s in i.MyDocVersion.UnitNames) + { + k++; + MenuItem mp = mps.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); + mp.Tag = k; + MenuItem mqp = mqps.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); + mqp.Tag = k; + } + cm.MenuItems.Add(mps); + cm.MenuItems.Add(mqps); + } + } + else + { + cm.MenuItems.Add("Print Section", new EventHandler(mi_Click)); + cm.MenuItems.Add("Quick Print Section", new EventHandler(mi_Click)); + } } } #endregion @@ -1098,42 +1125,42 @@ namespace Volian.Controls.Library ok = true; else if (tn.VEObject is ItemInfo && (ui.IsAdministrator() || ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion))) ok = true; - if(ok) + if (ok) Menu_Paste(tn, cm); #endregion //_MyLog.WarnFormat("Context Menu 5 - {0}", GC.GetTotalMemory(true)); #region Menu_Delete if (ok) - - - - - + + + + + + { + // Add delete to the menu unless at the very 'top' node, on a grouping (partinfo) + // node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items. + PartInfo pi = tn.VEObject as PartInfo; + if (pi == null && tn.Parent != null) // it's not a part and it's not the top.... { - // Add delete to the menu unless at the very 'top' node, on a grouping (partinfo) - // node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items. - PartInfo pi = tn.VEObject as PartInfo; - if (pi == null && tn.Parent != null) // it's not a part and it's not the top.... + fi = tn.VEObject as FolderInfo; + if (fi == null || tn.Nodes.Count == 0) // it's not a folder or it has no children { - fi = tn.VEObject as FolderInfo; - if (fi == null || tn.Nodes.Count == 0) // it's not a folder or it has no children + DocVersionInfo di = tn.VEObject as DocVersionInfo; + if (di == null || tn.Nodes.Count == 0) // it's not a docversion or it has no children { - DocVersionInfo di = tn.VEObject as DocVersionInfo; - if (di == null || tn.Nodes.Count == 0) // it's not a docversion or it has no children - { - // if it's an enhanced step that was linked from a source, don't allow delete - bool canDoDel = true; - ItemInfo iienh = tn.VEObject as ItemInfo; - if (iienh != null && iienh.IsProcedure && iienh.IsEnhancedProcedure) canDoDel = false; - if (iienh != null && iienh.IsSection && iienh.IsEnhancedSection && !iienh.IsEnhancedSectionTitleOnly) canDoDel = false; - if (iienh != null && iienh.IsEnhancedStep) canDoDel = false; - if (canDoDel) cm.MenuItems.Add("Delete", new EventHandler(mi_Click)); - } + // if it's an enhanced step that was linked from a source, don't allow delete + bool canDoDel = true; + ItemInfo iienh = tn.VEObject as ItemInfo; + if (iienh != null && iienh.IsProcedure && iienh.IsEnhancedProcedure) canDoDel = false; + if (iienh != null && iienh.IsSection && iienh.IsEnhancedSection && !iienh.IsEnhancedSectionTitleOnly) canDoDel = false; + if (iienh != null && iienh.IsEnhancedStep) canDoDel = false; + if (canDoDel) cm.MenuItems.Add("Delete", new EventHandler(mi_Click)); } } } - + } + #endregion //_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true)); #region Menu_ExternalTransitions @@ -1169,13 +1196,13 @@ namespace Volian.Controls.Library } doclink = string.Format("Unlink Source and {0} Procedure", doclink); MenuItem mix = cm.MenuItems.Add(doclink, new EventHandler(miEnhanced_Click)); - mix.Tag = -1; // NOTE this is what flags what gets processed on menu click, i.e. -1 + mix.Tag = -1; // NOTE this is what flags what gets processed on menu click, i.e. -1 } // if this is a source procedure that has enhanced, for example Background and/or deviation, ask which should be unlinked including all else if (eds != null && eds.Count > 1) { MenuItem miu = new MenuItem("Unlink Enhanced Procedure(s) from Source"); - miu.Tag = -2; // this menu item doesn't get used. + miu.Tag = -2; // this menu item doesn't get used. int k = 0; foreach (EnhancedDocument ed in eds) { @@ -1186,7 +1213,7 @@ namespace Volian.Controls.Library } // add all submenu item MenuItem mp1 = miu.MenuItems.Add("All", new EventHandler(miEnhanced_Click)); - mp1.Tag = 0; // Tag of 0 flags All + mp1.Tag = 0; // Tag of 0 flags All cm.MenuItems.Add(miu); } } @@ -1196,9 +1223,9 @@ namespace Volian.Controls.Library // Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo) // node (RNOs, Steps, Cautions, Notes) or at the step level. // B2020-105 Allow Set Administrators to rename folder's (sets of procedures) to which they have been given access. - if ( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo)); - else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo)) - : (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) + if (tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo)); + else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo)) + : (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion))); PartInfo pia = tn.VEObject as PartInfo; ItemInfo ii = tn.VEObject as ItemInfo; @@ -1279,7 +1306,7 @@ namespace Volian.Controls.Library itm.Text == "Procedure Set Specific Information" || itm.Text == "Approve All Procedures for" || itm.Text == "Approve Some Procedures" || itm.Text == "Approve Some Procedures for") itm.Enabled = false; - + } } } @@ -1308,9 +1335,9 @@ namespace Volian.Controls.Library // F2022-024 added Time Critical Action Summary option foreach (MenuItem itm in cm.MenuItems) { - if(itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" || + if (itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" || itm.Text == "Copy" || itm.Text == "Delete" || itm.Text == "Properties..." || itm.Text == "Replace Existing Procedure" || - itm.Text.StartsWith("Showing Change Bars Starting") || itm.Text == "Create Continuous Action Summary" || + itm.Text.StartsWith("Showing Change Bars Starting") || itm.Text == "Create Continuous Action Summary" || itm.Text == "Create Time Critical Action Summary" || itm.Text == "Export Procedure") itm.Enabled = false; } @@ -1319,7 +1346,7 @@ namespace Volian.Controls.Library { foreach (MenuItem itm in cm.MenuItems) { - if(!itm.Text.StartsWith("Document Checked Out")) + if (!itm.Text.StartsWith("Document Checked Out")) itm.Enabled = false; } } @@ -1336,7 +1363,7 @@ namespace Volian.Controls.Library { _currentPri = pri; RevisionInfoList ril = RevisionInfoList.GetByItemID(pri.ItemID); - if (ril.Count == 0) return; // no versions to list + if (ril.Count == 0) return; // no versions to list MenuItem mi = menuItemCollection.Add("Versions"); int k = 0; int lastApprovedRevisionID = 0; @@ -1383,11 +1410,11 @@ namespace Volian.Controls.Library ril = null; } } - public void AddNewNode(IVEDrillDownReadOnly o) - { - VETreeNode tn = new VETreeNode(o); - SelectedNode.Nodes.Add(tn); - } + public void AddNewNode(IVEDrillDownReadOnly o) + { + VETreeNode tn = new VETreeNode(o); + SelectedNode.Nodes.Add(tn); + } private void AddApprovedRevisions(Menu.MenuItemCollection menuItemCollection, ProcedureInfo pri) { try @@ -1396,7 +1423,7 @@ namespace Volian.Controls.Library _currentPri = pri; using (RevisionInfoList ril = RevisionInfoList.GetByItemID(pri.ItemID)) { - //_MyLog.WarnFormat("Context Menu 1 After GET - {0}", GC.GetTotalMemory(true)); + //_MyLog.WarnFormat("Context Menu 1 After GET - {0}", GC.GetTotalMemory(true)); if (ril.Count == 0) return; // no versions to list MenuItem mi = menuItemCollection.Add("Versions"); int lastApprovedRevisionID = 0; @@ -1477,7 +1504,7 @@ namespace Volian.Controls.Library RevisionConfig rc = ri.MyConfig as RevisionConfig; // bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures. int applIdx = rc.Applicability_Index; - string str = (applIdx > 0)?_currentPri.MyDocVersion.UnitNames[applIdx-1] +"_":""; // if parent/child get the defined child name to inlcude the export filename + string str = (applIdx > 0) ? _currentPri.MyDocVersion.UnitNames[applIdx - 1] + "_" : ""; // if parent/child get the defined child name to inlcude the export filename System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.LoadXml(ri.LatestVersion.ApprovedXML); string PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database; @@ -1525,12 +1552,12 @@ namespace Volian.Controls.Library { MenuItem mip = mi.Parent as MenuItem; //B2021-086 Added the check for the last revision stage is an Approved stage - if ((ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) && ri.LatestVersion.MyStage.IsApproved!=0) + if ((ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) && ri.LatestVersion.MyStage.IsApproved != 0) superceded = true; } vlnTreeViewPdfArgs args = new vlnTreeViewPdfArgs(Volian.Base.Library.TmpFile.CreateFileName(ProcedureInfo.Get(ri.ItemID).PDFNumber), ri.LatestVersion.PDF, superceded ? "Superceded" : ""); OnViewPDF(sender, args); -// System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded)); + // System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded)); } void MultiUnitApprovedRevision_Click(object sender, EventArgs e) { @@ -1643,7 +1670,7 @@ namespace Volian.Controls.Library // 'from' is object copied // 'to' is object where paste was selected from #region Menu_Paste_ToDocVersion - if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc + if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc { if (iiClipboard.IsProcedure) { @@ -1653,7 +1680,7 @@ namespace Volian.Controls.Library // 3) 'to' docversion is 'source' and 'from' procedure is within this docversion // 4) 'to' docVersion is 'enhanced' and 'from' procedure is not bool canPaste = false; - + DocVersionInfo dvi = tn.VEObject as DocVersionInfo; DocVersionConfig dvc = dvi.DocVersionConfig; bool docVersionIsEnhanced = dvc.MyEnhancedDocuments != null && dvc.MyEnhancedDocuments.Count > 0 && dvc.MyEnhancedDocuments[0].Type == 0; @@ -1674,7 +1701,7 @@ namespace Volian.Controls.Library if (iiClipboard.IsRtfRaw) canPaste = false; // never paste an equation. if (canPaste) cm.MenuItems.Add("Paste Procedure", new EventHandler(mi_Click)); } - #endregion + #endregion } else { @@ -1685,7 +1712,7 @@ namespace Volian.Controls.Library { SectionInfo si = (tn.VEObject as SectionInfo != null) ? tn.VEObject as SectionInfo : null; #region Menu_Paste_ToFromProcedure - if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after + if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after { // Enhanced considerations, in order to paste a procedure around another procedure: NOTE that an 'enhanced' procedure cannot be in paste buffer! // 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced) @@ -1709,16 +1736,16 @@ namespace Volian.Controls.Library bool prFromIsEnhanced = iiClipboard.IsEnhancedProcedure; bool prFromIsSource = pcFromCfg.MyEnhancedDocuments != null && pcFromCfg.MyEnhancedDocuments.Count > 0 && pcFromCfg.MyEnhancedDocuments[0].Type != 0; bool prCanPaste = false; - if (!prToIsEnhanced && !prToIsSource && !prFromIsEnhanced && !prFromIsSource) prCanPaste = true; // 1) - // else if ((!prToIsEnhanced && !prToIsSource) && prFromIsSource) prCanPaste = false; // 2) commented out because already set to false - else if (prToIsSource && !prFromIsEnhanced && !prFromIsSource) // 3) + if (!prToIsEnhanced && !prToIsSource && !prFromIsEnhanced && !prFromIsSource) prCanPaste = true; // 1) + // else if ((!prToIsEnhanced && !prToIsSource) && prFromIsSource) prCanPaste = false; // 2) commented out because already set to false + else if (prToIsSource && !prFromIsEnhanced && !prFromIsSource) // 3) { prCanPaste = true; okToReplace = false; } - else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) prCanPaste = true; // 4) - //else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID != iiClipboard.MyDocVersion.VersionID) prCanPaste = false; // 5) commented out because already set to false - //else if (prToIsEnhanced && prFromIsSource) prCanPaste = false; // 6)commented out because already set to false + else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) prCanPaste = true; // 4) + //else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID != iiClipboard.MyDocVersion.VersionID) prCanPaste = false; // 5) commented out because already set to false + //else if (prToIsEnhanced && prFromIsSource) prCanPaste = false; // 6)commented out because already set to false if (iiClipboard.IsRtfRaw) prCanPaste = okToReplace = prCanPaste = false; // never paste an equation. if (prCanPaste) cm.MenuItems.Add("Paste Procedure Before", new EventHandler(mi_Click)); if (okToReplace && prCanPaste) cm.MenuItems.Add("Replace Existing Procedure", new EventHandler(mi_Click)); @@ -1750,9 +1777,9 @@ namespace Volian.Controls.Library bool scFromIsEnhanced = iiClipboard.IsEnhancedSection; bool scFromIsSource = scFromCfg.MyEnhancedDocuments != null && scFromCfg.MyEnhancedDocuments.Count > 0 && scFromCfg.MyEnhancedDocuments[0].Type != 0; bool scCanPaste = false; - if (!prToIsEnhanced && !prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true; // 1) + if (!prToIsEnhanced && !prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true; // 1) else if (prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true; - else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) scCanPaste = true; // 3) + else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) scCanPaste = true; // 3) if (iiClipboard.IsRtfRaw) scCanPaste = false; // never paste an equation. if (scCanPaste) cm.MenuItems.Add("Paste Section", new EventHandler(mi_Click)); } @@ -1824,9 +1851,9 @@ namespace Volian.Controls.Library bool stpFromIsEnhanced = iiClipboard.IsEnhancedStep; bool stpFromIsSource = stpFromCfg.MyEnhancedDocuments != null && stpFromCfg.MyEnhancedDocuments.Count > 0 && stpFromCfg.MyEnhancedDocuments[0].Type != 0; bool stpCanPaste = false; - if (!secToIsEnhanced && !secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1) + if (!secToIsEnhanced && !secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1) else if (secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 2) - else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) stpCanPaste = true; // 3) + else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) stpCanPaste = true; // 3) if (iiClipboard.IsRtfRaw) stpCanPaste = false; // never paste an equation. if (stpCanPaste) cm.MenuItems.Add("Paste Step", new EventHandler(mi_Click)); } @@ -1850,8 +1877,8 @@ namespace Volian.Controls.Library bool stpFromIsEnhanced = iiClipboard.IsEnhancedStep; bool stpFromIsSource = stpFromCfg.MyEnhancedDocuments != null && stpFromCfg.MyEnhancedDocuments.Count > 0 && stpFromCfg.MyEnhancedDocuments[0].Type != 0; bool stpCanPaste = false; - if (!stpToIsEnhanced && !stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1) - else if (stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) // 2) + if (!stpToIsEnhanced && !stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1) + else if (stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) // 2) { stpCanPaste = true; okToReplace = false; @@ -1859,7 +1886,7 @@ namespace Volian.Controls.Library else if (stpToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) // 3 { stpCanPaste = true; - if (stpFromIsSource) okToReplace = false; // B2017-183: don't allow a replace to source steps + if (stpFromIsSource) okToReplace = false; // B2017-183: don't allow a replace to source steps } if (iiClipboard.IsRtfRaw) stpCanPaste = false; // never paste an equation. if (stpCanPaste && AddToInsertMenu(iiPasteHere, 0)) cm.MenuItems.Add("Paste Step Before", new EventHandler(mi_Click)); @@ -1892,7 +1919,7 @@ namespace Volian.Controls.Library OnQPrintSection(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); break; case "Print All Procedures for": - OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0,mi.Text,(int)mi.Tag)); + OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); break; case "Approve": OnApproveProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); @@ -1904,10 +1931,10 @@ namespace Volian.Controls.Library OnApproveSomeProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); break; case "Create Continuous Action Summary": - OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0,mi.Text,(int)mi.Tag)); + OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); break; case "Create Time Critical Action Summary": - OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0,mi.Text,(int)mi.Tag)); + OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); break; default: if (mip.Text.StartsWith("Showing Change Bars Starting")) @@ -1945,7 +1972,7 @@ namespace Volian.Controls.Library { if (selprc.IsEnhancedProcedure) { - selprc.DoUnlinkEnhanced(selprc, 0, !hasValidConnectingProc); // if no valid linked: enhtype = 0 since this an enhanced doc is getting unlinked + selprc.DoUnlinkEnhanced(selprc, 0, !hasValidConnectingProc); // if no valid linked: enhtype = 0 since this an enhanced doc is getting unlinked } else // from source { @@ -1953,7 +1980,7 @@ namespace Volian.Controls.Library if (hasValidConnectingProc) { ItemInfo lprc = ItemInfo.Get(seleds[0].ItemID); - lprc.DoUnlinkEnhanced(lprc, 0, !hasValidConnectingProc); + lprc.DoUnlinkEnhanced(lprc, 0, !hasValidConnectingProc); } else selprc.DoUnlinkEnhanced(selprc, seleds[0].Type, !hasValidConnectingProc); @@ -1973,7 +2000,7 @@ namespace Volian.Controls.Library { ItemInfo lprc = ItemInfo.Get(ed.ItemID); bool hasValidConnectingProc = CheckForValidEnhLink(lprc); - // if there is a valid connection, unlink both. Otherwise, just unlink this selected procedure. + // if there is a valid connection, unlink both. Otherwise, just unlink this selected procedure. if (hasValidConnectingProc) lprc.DoUnlinkEnhanced(lprc, ed.Type, !hasValidConnectingProc); else @@ -1997,37 +2024,37 @@ namespace Volian.Controls.Library OnNodeSI(this, new vlnTreeEventArgs(tn, null, 0)); return; } - if (mi.Text.StartsWith("Collapse")) - { + if (mi.Text.StartsWith("Collapse")) + { CollapseProcedures(); - return; - } + return; + } if (mi.Text == "Print Transition Report") { OnPrintTransitionReport(this, new vlnTreeEventArgs(SelectedNode as VETreeNode)); return; } - - - - - - - - - - - if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure") - { - OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - return; - } - if (mi.Text == "Import Procedure Set" || mi.Text == "Import Procedure") - { - OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 1)); - return; - } - if (mi.Text.StartsWith("Procedure Checked Out to") || mi.Text.StartsWith("Document Checked Out to")) + + + + + + + + + + + if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure") + { + OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); + return; + } + if (mi.Text == "Import Procedure Set" || mi.Text == "Import Procedure") + { + OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 1)); + return; + } + if (mi.Text.StartsWith("Procedure Checked Out to") || mi.Text.StartsWith("Document Checked Out to")) { OnProcedureCheckedOutTo(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); return; @@ -2053,7 +2080,7 @@ namespace Volian.Controls.Library break; case "New Folder": SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Folder); + tv_NodeNew(MenuSelections.Folder); break; case "Create Working Draft": SelectedNode.Expand(); @@ -2097,7 +2124,7 @@ namespace Volian.Controls.Library tv_NodeCopy(); break; // lots of paste options: - case "Paste Procedure": + case "Paste Procedure": case "Paste Procedure Before": case "Paste Procedure After": case "Paste Section": @@ -2131,7 +2158,7 @@ namespace Volian.Controls.Library break; } - + case "Delete": if (tv_NodeDelete()) { @@ -2197,14 +2224,14 @@ namespace Volian.Controls.Library UpdateROValues(SelectedNode as VETreeNode); break; case "Create Continuous Action Summary": - OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0)); + OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); break; - // F2022-024 Time Critical Action Summary + // F2022-024 Time Critical Action Summary case "Create Time Critical Action Summary": - OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0)); + OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); break; - // B2017-243 added the following two Cannot Paste items when dealing with enhanced documents - // when then user selects these menu items a message box will appear giving more information as to why it cannot be pasted + // B2017-243 added the following two Cannot Paste items when dealing with enhanced documents + // when then user selects these menu items a message box will appear giving more information as to why it cannot be pasted case "CANNOT PASTE HERE. Click for more information...": FlexibleMessageBox.Show("You have copied a document that is linked to an Enhanced Document.\n\n" + "It can only be pasted before or after another document, within the set, that is linked to an Enhanced Document.", "Cannot Paste Here"); @@ -2246,7 +2273,7 @@ namespace Volian.Controls.Library foreach (VETreeNode tnc in tn.Nodes) CollapseProcedures(tnc); if (tn.VEObject as DocVersionInfo == null && tn.VEObject as FolderInfo == null) - tn.Collapse(); + tn.Collapse(); _doingCollapseNode = true; // B2016-058 this will prevent a Drag Node error when collapsing an RNOs, Cautions, or Notes tree node } private void tv_RemoveChgIds() @@ -2301,12 +2328,12 @@ namespace Volian.Controls.Library FinalProgressBarMessage = "Cannot check-out Working Draft"; return; } - Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error + Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion); using (DocVersion dv = DocVersion.Get(MyDVI.VersionID)) { 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 + // 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 @@ -2334,7 +2361,7 @@ namespace Volian.Controls.Library swROUpdate.Write(string.Format("Fixed Referenced Object for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID)); } - private ProgressBarItem _ProgressBar=null; + private ProgressBarItem _ProgressBar = null; public ProgressBarItem ProgressBar { get { return _ProgressBar; } @@ -2447,7 +2474,7 @@ namespace Volian.Controls.Library return; } // C2017-003: ro data in sql server, check for sql connection string - if (MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString != "cstring") + if (MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString != "cstring") roloc = roloc + " \"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString + "\""; // C2021-026 pass in Parent/Child information (list of the children) // B2022-019 look at all DocVersions to find ParentChild information @@ -2498,7 +2525,7 @@ namespace Volian.Controls.Library } } VETreeNode tn = SelectedNode as VETreeNode; - + DocVersionInfo dvi = tn.VEObject as DocVersionInfo; // Check for paste into a docversion - queries/code is different than paste related to an item (into a proc or section) if (dvi != null) @@ -2512,7 +2539,7 @@ namespace Volian.Controls.Library // assume that item to paste is a procedure, otherwise the menuing would not have // included the paste options - tn = (VETreeNode) tn.Nodes[tn.Nodes.Count - 1]; + tn = (VETreeNode)tn.Nodes[tn.Nodes.Count - 1]; p = "After"; } else // this is an empty docversion: @@ -2548,7 +2575,7 @@ namespace Volian.Controls.Library if (OnlyProc && repitem != null && tmp != null) { VETreeNode tn1 = new VETreeNode(repitem); - tmp.Nodes.Add(tn1); + tmp.Nodes.Add(tn1); SelectedNode = tn1; } } @@ -2557,7 +2584,7 @@ namespace Volian.Controls.Library //if (p.IndexOf("Replace") <= -1) - this.Cursor = Cursors.Default; + this.Cursor = Cursors.Default; } public void PasteAsDocVersionChild(VETreeNode tn, int copyStartID) @@ -2574,7 +2601,7 @@ namespace Volian.Controls.Library } ItemInfo newProc = dvi.PasteChild(copyStartID); VETreeNode tn1 = new VETreeNode(newProc); - SelectedNode.Nodes.Add(tn1); // add tree node to end of list. + SelectedNode.Nodes.Add(tn1); // add tree node to end of list. SelectedNode = tn1; } @@ -2611,7 +2638,7 @@ namespace Volian.Controls.Library } if (pasteSectIntoEmptySect) { - tn.ChildrenLoaded = false; // force a reload of treenode + tn.ChildrenLoaded = false; // force a reload of treenode tn.LoadChildren(true); } SelectedNode = tn; @@ -2626,7 +2653,7 @@ namespace Volian.Controls.Library // the item to be pasted in the step editor and the tree. ItemInfo newItemInfo = null; // F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format - if (!ii.IsProcedure) + if (!ii.IsProcedure) ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, false); if (ii.IsProcedure || !OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, pasteOpt, ii.MyContent.Type))) { @@ -2649,8 +2676,8 @@ namespace Volian.Controls.Library } private ItemInfo PasteReplace(VETreeNode tn, int copyStartID) { - VETreeNode prevtn = (VETreeNode) tn.PrevNode; - VETreeNode partn = (VETreeNode) tn.Parent; + VETreeNode prevtn = (VETreeNode)tn.PrevNode; + VETreeNode partn = (VETreeNode)tn.Parent; ItemInfo ii = tn.VEObject as ItemInfo; // F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, true); @@ -2689,7 +2716,7 @@ namespace Volian.Controls.Library SelectedNode.Nodes.Add(tn1); // add tree node to end of list. SelectedNode = tn1; } - private void tv_NodeCopy() + private void tv_NodeCopy() { if (SelectedNode == null) return; VETreeNode tn = SelectedNode as VETreeNode; @@ -2701,7 +2728,7 @@ namespace Volian.Controls.Library private void SetupNodeProperties() { VETreeNode tn = SelectedNode as VETreeNode; - if (tn==null)return; + if (tn == null) return; if ((tn.VEObject as FolderInfo) != null) OpenProperties(tn.VEObject as FolderInfo); @@ -2713,7 +2740,7 @@ namespace Volian.Controls.Library if (dvi != null && dvi.DocVersionAssociations != null && dvi.DocVersionAssociations.Count > 0) rofstid = dvi.DocVersionAssociations[0].MyROFst.ROFstID; OpenProperties(tn.VEObject as DocVersionInfo); if (dvi != null && dvi.DocVersionAssociations != null && dvi.DocVersionAssociations.Count > 0 && rofstid != dvi.DocVersionAssociations[0].MyROFst.ROFstID) - OnTabDisplay(this,new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST")); + OnTabDisplay(this, new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST")); } else if ((tn.VEObject as ProcedureInfo) != null) OpenProperties(tn.VEObject as ProcedureInfo); @@ -2727,7 +2754,7 @@ namespace Volian.Controls.Library { using (Folder folder = folderInfo.Get()) { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", folder.FolderConfig.Name), folder.FolderConfig)); + OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", folder.FolderConfig.Name), folder.FolderConfig)); } } private void OpenProperties(DocVersionInfo dvInfo) @@ -2741,7 +2768,7 @@ namespace Volian.Controls.Library { using (Procedure proc = procInfo.Get()) { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} {1} Properties", proc.ProcedureConfig.Number, proc.ProcedureConfig.Title), proc.ProcedureConfig)); + OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} {1} Properties", proc.ProcedureConfig.Number, proc.ProcedureConfig.Title), proc.ProcedureConfig)); } } private void OpenProperties(SectionInfo sectInfo) @@ -2754,7 +2781,7 @@ namespace Volian.Controls.Library title = string.Format("{0} {1} Properties", sectInfo.SectionConfig.Number, sectInfo.SectionConfig.Title); else title = string.Format("{0} Properties", sectInfo.SectionConfig.Title); - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(title, sect.SectionConfig)); + OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(title, sect.SectionConfig)); } } private void OpenProperties(StepInfo stpinfo) @@ -2808,7 +2835,7 @@ namespace Volian.Controls.Library { if (newtype == MenuSelections.DocVersion) { - int dvid = -1; // flag to allow user to cancel from dialog & then we remove it. + int dvid = -1; // flag to allow user to cancel from dialog & then we remove it. using (DocVersion docversion = DocVersion.MakeDocVersion(parentfolder, "Working Draft", "Title", null, null, null)) { ShowBrokenRules(docversion.BrokenRulesCollection); @@ -2817,7 +2844,7 @@ namespace Volian.Controls.Library { docversion.Save(); tn = new VETreeNode(_LastDocVersionInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. + SelectedNode.Nodes.Add(tn); // add tree node to end of list. parentfolder.Reset_ChildFolders(); parentfolder.Reset_FolderDocVersions(); } @@ -2828,7 +2855,7 @@ namespace Volian.Controls.Library } else if (newtype == MenuSelections.Folder) { - int f1 = -1; // flag to allow user to cancel from dialog & then we remove it. + int f1 = -1; // flag to allow user to cancel from dialog & then we remove it. string uniquename = _LastFolderInfo.UniqueChildName("New Folder"); using (Folder folder = Folder.MakeFolder(parentfolder, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, string.Empty, DateTime.Now, VlnSettings.UserID)) { @@ -2840,14 +2867,14 @@ namespace Volian.Controls.Library { folder.Save(); tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo); - SelectedNode.Nodes.Add(tn); // add new tree node to end of childlist. + SelectedNode.Nodes.Add(tn); // add new tree node to end of childlist. } else f1 = folder.FolderID; } if (f1 != -1) Folder.Delete(f1); } - else if (newtype == MenuSelections.FolderAfter||newtype == MenuSelections.FolderBefore) + else if (newtype == MenuSelections.FolderAfter || newtype == MenuSelections.FolderBefore) { int f2 = -1; string uniquename = _LastFolderInfo.MyParent.UniqueChildName("New Folder"); @@ -2856,7 +2883,8 @@ namespace Volian.Controls.Library //since before/after folder is at same level as current folder //so need to use the parents order to determine where to place it using (FolderInfo parfolderinfo = FolderInfo.Get(parentfolder.MyParent.FolderID)) - { double? myorder = parfolderinfo.NewManualOrder(myindex); + { + double? myorder = parfolderinfo.NewManualOrder(myindex); using (Folder folder = Folder.MakeFolder(parentfolder.MyParent, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, myorder, string.Empty, DateTime.Now, VlnSettings.UserID)) { ShowBrokenRules(folder.BrokenRulesCollection); @@ -2881,7 +2909,7 @@ namespace Volian.Controls.Library else if (newtype == MenuSelections.Procedure) { int p1 = -1; - using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count!=0?_LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count-1]:null, null, "New Procedure", 0)) + using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count != 0 ? _LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count - 1] : null, null, "New Procedure", 0)) { ShowBrokenRules(procedure.BrokenRulesCollection); SetLastValues(ProcedureInfo.Get(procedure.ItemID)); @@ -2890,8 +2918,8 @@ namespace Volian.Controls.Library { procedure.Save(); tn = new VETreeNode(_LastProcedureInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - // The following line will allow for a refresh of the procedure list on the Working Draft's treenodes docversion (B2016-034) + SelectedNode.Nodes.Add(tn); // add tree node to end of list. + // The following line will allow for a refresh of the procedure list on the Working Draft's treenodes docversion (B2016-034) if (((SelectedNode as VETreeNode).VEObject as DocVersionInfo) != null) ((SelectedNode as VETreeNode).VEObject as DocVersionInfo).ResetProcedures(); if (procedure.MyProcedureInfo.CreateEnhanced) { @@ -2933,21 +2961,21 @@ namespace Volian.Controls.Library else p2 = procedure.ItemID; } - if (p2 != -1) + if (p2 != -1) DeleteItemInfoAndChildren(_LastProcedureInfo); // Delete Item and reset Previous and Next } #endregion #region InsertSection - else if (newtype == MenuSelections.Section) // Insert subsection at end of parents section list + else if (newtype == MenuSelections.Section) // Insert subsection at end of parents section list { string message = string.Empty; if (_LastProcedureInfo != null) if (!MySessionInfo.CanCheckOutItem(_LastProcedureInfo.ItemID, CheckOutType.Procedure, ref message)) - { - FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - OnUnPauseRefresh(this, null); - return; - } + { + FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); + OnUnPauseRefresh(this, null); + return; + } int s1 = -1; if (!(_LastProcedureInfo == null) || !(_LastSectionInfo == null)) { @@ -2977,7 +3005,7 @@ namespace Volian.Controls.Library "If you would like to view or copy these hidden steps you will need to go\n" + "into the properties of this section and check the Editable Data checkbox.\n" + "You will then be able to view and copy those steps. When finished, open\n" + - "the properties page again and uncheck the Editable Data checkbox.\n\n"+ + "the properties page again and uncheck the Editable Data checkbox.\n\n" + "Do you want to continue creating the subsection?"; if (FlexibleMessageBox.Show(this, msgstr, "Subsection Insert", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { @@ -2989,7 +3017,7 @@ namespace Volian.Controls.Library if (!hasMetaSubs) doPseudo = true; } } - using(Section section = CreateNewSection()) + using (Section section = CreateNewSection()) { ShowBrokenRules(section.BrokenRulesCollection); SectionInfo savLastSectionInfo = _LastSectionInfo; @@ -2999,10 +3027,10 @@ namespace Volian.Controls.Library if (!doPseudo) { tn = new VETreeNode(_LastSectionInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - // if the new section was flagged as either having an enhanced link for Title or Contents, create the - // Enhanced section: - Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem. + SelectedNode.Nodes.Add(tn); // add tree node to end of list. + // if the new section was flagged as either having an enhanced link for Title or Contents, create the + // Enhanced section: + Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem. if (sectiontmp.SectionConfig.LinkEnhanced == "T" || sectiontmp.SectionConfig.LinkEnhanced == "Y") CreateEnhancedForSection(newtype, sectiontmp, savLastSectionInfo, sectiontmp.DisplayNumber, sectiontmp.MyContent.Text); sectiontmp.Dispose(); @@ -3013,7 +3041,7 @@ namespace Volian.Controls.Library // may have to add a 'steps' node if a step(s) already exist... ItemInfo ii = (SelectedNode as VETreeNode).VEObject as ItemInfo; int cpindx = 0; - if (SelectedNode.Nodes.Count>0) + if (SelectedNode.Nodes.Count > 0) { VETreeNode vtn = SelectedNode.Nodes[0] as VETreeNode; // B2017-014: removed code that was adding a 2nd section part node. and also select node to @@ -3023,13 +3051,13 @@ namespace Volian.Controls.Library // B2017-014: removed code that was adding a 2nd section part node. } } - else // Properties was canceled out of: + else // Properties was canceled out of: s1 = section.ItemID; } if (s1 != -1) { DeleteItemInfoAndChildren(_LastSectionInfo);// Delete Item and reset Previous and Next - // B2020-087 refresh the tree node after canceling the creation of the subsection + // B2020-087 refresh the tree node after canceling the creation of the subsection _LastTreeNode.ChildrenLoaded = false; _LastTreeNode.RefreshNode(); _LastTreeNode.Collapse(); @@ -3057,14 +3085,14 @@ namespace Volian.Controls.Library if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK) { int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1); - int itemido = (indx >= par.Nodes.Count)?-1:(((par.Nodes[indx] as VETreeNode).VEObject) as ItemInfo).ItemID; - if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString() || itemido !=section.ItemID) + int itemido = (indx >= par.Nodes.Count) ? -1 : (((par.Nodes[indx] as VETreeNode).VEObject) as ItemInfo).ItemID; + if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString() || itemido != section.ItemID) { tn = new VETreeNode(_LastSectionInfo); par.Nodes.Insert(indx, tn); // if the new section was flagged as either having an enhanced link for Title or Contents, create the // Enhanced section: - Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem. + Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem. if (sectiontmp.SectionConfig.LinkEnhanced == "T" || sectiontmp.SectionConfig.LinkEnhanced == "Y") CreateEnhancedForSection(newtype, sectiontmp, savLastSectionInfo, sectiontmp.DisplayNumber, sectiontmp.MyContent.Text); sectiontmp.Dispose(); @@ -3076,7 +3104,7 @@ namespace Volian.Controls.Library if (s2 != -1) { DeleteItemInfoAndChildren(_LastSectionInfo);// Delete Item and reset Previous and Next - // B2020-087 refresh the tree node after canceling the creation of the subsection + // B2020-087 refresh the tree node after canceling the creation of the subsection _LastTreeNode.ChildrenLoaded = false; _LastTreeNode.RefreshNode(); _LastTreeNode.Collapse(); @@ -3084,7 +3112,7 @@ namespace Volian.Controls.Library } #endregion #region InsertStep - else if (newtype == MenuSelections.Step) // insert step from section - no substeps from tree. + else if (newtype == MenuSelections.Step) // insert step from section - no substeps from tree. { string message = string.Empty; if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) @@ -3161,7 +3189,7 @@ namespace Volian.Controls.Library using (Procedure newenhProcedure = Procedure.MakeProcedure(enhDVInfo, enhDVInfo.Procedures.Count != 0 ? enhDVInfo.Procedures[enhDVInfo.Procedures.Count - 1] : null, null, "New Procedure", 0)) { SaveEnhancedForProcedure(sourceProc, newenhProcedure, ded.Type); - RefreshRelatedNode(ProcedureInfo.Get(newenhProcedure.ItemID)); // this updates the treeview to include the new enhanced procedure + RefreshRelatedNode(ProcedureInfo.Get(newenhProcedure.ItemID)); // this updates the treeview to include the new enhanced procedure } } } @@ -3259,7 +3287,7 @@ namespace Volian.Controls.Library { SectionConfig newenhcfg = new SectionConfig(newenhSection); newenhcfg.AddEnhancedDocument(0, sourceSect.ItemID); - newenhcfg.SaveEnhancedDocuments(); // does this save data? + newenhcfg.SaveEnhancedDocuments(); // does this save data? using (Content c1 = Content.Get(newenhSection.ContentID)) { c1.Config = newenhcfg.ToString(); @@ -3273,7 +3301,7 @@ namespace Volian.Controls.Library cs.Save(); } } - + private Section CreateNewSection() { // B2020-087 the config for SubSection_Edit was sometimes set even when there wasn't any subsections, @@ -3313,7 +3341,7 @@ namespace Volian.Controls.Library // The parent step was not open in the step editor, just create new step(s) and add treenode. int newId = -1; // B2020-076: if this step has a template, insert template steps. - int topType = ii.GetSmartTemplateTopLevelIndxOfThisType(20002); + int topType = ii.GetSmartTemplateTopLevelIndxOfThisType(20002); if (topType != -1) { ItemInfo tmp = null; @@ -3340,12 +3368,12 @@ namespace Volian.Controls.Library // see if enhanced related steps need created: SectionConfig scfgE = _LastItemInfo.ActiveSection.MyConfig as SectionConfig; // C2018-003 fixed use of getting the active section - if (scfgE != null && scfgE.Section_LnkEnh=="Y") + if (scfgE != null && scfgE.Section_LnkEnh == "Y") { // set up which item to insert from based on whether editor was open (see comment from 11/17 above). EnhancedDocuments enhdocs = null; ItemInfo.EAddpingPart addpart = ItemInfo.EAddpingPart.Child; - if (_LastItemInfo.MyPrevious != null) // the code above will do the MakeStep regardless of whether editor is up if this is the only step. + if (_LastItemInfo.MyPrevious != null) // the code above will do the MakeStep regardless of whether editor is up if this is the only step. { addpart = ItemInfo.EAddpingPart.After; ItemInfo lstSrc = _LastItemInfo.MyPrevious; @@ -3517,7 +3545,7 @@ namespace Volian.Controls.Library result = FlexibleMessageBox.Show("Are you sure you want to delete this " + typeDescription + "?", "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); } - if (_LastProcedureInfo != null || result == DialogResult.Yes) + if (_LastProcedureInfo != null || result == DialogResult.Yes) { if (_LastFolderInfo != null) { @@ -3533,7 +3561,7 @@ namespace Volian.Controls.Library { foreach (DVEnhancedDocument dve in dvc.MyEnhancedDocuments) { - if (dve.Type != 0) + if (dve.Type != 0) DocVersion.Delete(dve.VersionID); else { @@ -3579,7 +3607,7 @@ namespace Volian.Controls.Library if (ed.Type != 0) enhIds.Add(ed.ItemID); // always return false because an event gets fired to delete tree nodes. if (!DeleteItemInfoAndChildren(_LastProcedureInfo)) return false; - + _LastProcedureInfo = null; foreach (int enhId in enhIds) { @@ -3623,7 +3651,7 @@ namespace Volian.Controls.Library // just clear enhanced links back _LastSectionInfo.ClearEnhancedSectionLink(); } - OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo,true)); + OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo, true)); // always return false because an event gets fired to delete tree nodes. if (!DeleteItemInfoAndChildren(_LastSectionInfo)) { @@ -3678,7 +3706,7 @@ namespace Volian.Controls.Library } return false; } - + public void RemoveFolder(int folderId) { TreeNode nodeToRemove = FindNodeById(folderId, this.Nodes); @@ -3724,11 +3752,11 @@ namespace Volian.Controls.Library // do delete using RTBItem - this manages windowing from the step editor. // If the procedure is open & you're deleting procedure, you want to close open // window - this is done in DisplayTabControl-DeleteStepTabItem. - OnProcessing(true,"Deleting"); + OnProcessing(true, "Deleting"); if (!OnDeleteItemInfo(this, new vlnTreeItemInfoEventArgs(ii))) Item.DeleteItemAndChildren(ii); - OnProcessing(false,"Deleted"); - OnProcessingComplete(dtStart,"Deleted"); + OnProcessing(false, "Deleted"); + OnProcessingComplete(dtStart, "Deleted"); if (deletedSection) { // B2020-087 if we deleted the last sub section, then clear the SubSection_Edit in the parent's config @@ -3747,12 +3775,12 @@ namespace Volian.Controls.Library } catch (System.Data.SqlClient.SqlException ex) { - OnProcessing(false,"Delete Failed"); - OnProcessingComplete(dtStart,"Delete Failed"); + OnProcessing(false, "Delete Failed"); + OnProcessingComplete(dtStart, "Delete Failed"); // C2020-033: Support delete to bring up Search/Incoming Transitions panel if (ex.Message.Contains("has External Transitions")) { - ItemInfo iis = ItemInfo.Get(ii.ItemID); + ItemInfo iis = ItemInfo.Get(ii.ItemID); OnSearchIncTransIn(this, new vlnTreeItemInfoEventArgs(iis)); iis = ii.HandleSqlExceptionOnDelete(ex); } @@ -3768,13 +3796,13 @@ namespace Volian.Controls.Library private void OnProcessingComplete(DateTime dtStart, string message) { if (ProcessingComplete != null) - ProcessingComplete(this, new vlnTreeTimeEventArgs(dtStart,message)); + ProcessingComplete(this, new vlnTreeTimeEventArgs(dtStart, message)); } public event vlnTreeViewStatusEvent Processing; private void OnProcessing(bool status, string message) { if (Processing != null) - Processing(this, new vlnTreeStatusEventArgs(status,message)); + Processing(this, new vlnTreeStatusEventArgs(status, message)); } #endregion #region SetLastValuesAndSaveIfChangedStuff @@ -3850,7 +3878,7 @@ namespace Volian.Controls.Library ItemInfo iidrag = ((VETreeNode)dragNode).VEObject as ItemInfo; FolderInfo fdrag = ((VETreeNode)dragNode).VEObject as FolderInfo; DocVersionInfo ddrag = ((VETreeNode)dragNode).VEObject as DocVersionInfo; - if ((iidrag == null && fdrag == null && ddrag == null)) + if ((iidrag == null && fdrag == null && ddrag == null)) { FlexibleMessageBox.Show("Cannot drag/drop a grouping node."); return; @@ -3865,7 +3893,7 @@ namespace Volian.Controls.Library } catch (Exception ex) { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_ItemDrag", ex); + if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_ItemDrag", ex); } } #endregion @@ -3901,7 +3929,7 @@ namespace Volian.Controls.Library { get { return _lastScroll; } } - private string _location = string.Empty; + private string _location = string.Empty; #endregion #region Constructors public DropLocation(TreeView tv, System.Windows.Forms.DragEventArgs e, DateTime lastScroll) @@ -4018,7 +4046,7 @@ namespace Volian.Controls.Library { return; } - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Line at {0} Node {1}[{2}] {3}", _location, _dropNode.Text, _index, _position.ToString()); + //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Line at {0} Node {1}[{2}] {3}", _location, _dropNode.Text, _index, _position.ToString()); // Changed the color of the drag indicator to always be red Color lc = (_position == DropPosition.After ? Color.Red : Color.Red); Brush lb = (_position == DropPosition.After ? Brushes.Red : Brushes.Red); @@ -4045,12 +4073,12 @@ namespace Volian.Controls.Library //if (e.Effect == DragDropEffects.None) return; if (_dropNode != null) { -// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation1 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); + // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation1 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); DragHelper.ImageList_DragShowNolock(false); TreeView tv = _dropNode.TreeView; TreeNode tmp = tv.GetNodeAt(tv.PointToClient(new Point(e.X, e.Y))); -// if (!ScrollOnly) -// { + // if (!ScrollOnly) + // { if (ScrollTreeView(tmp) || !ScrollOnly) { //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation2 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); @@ -4060,11 +4088,11 @@ namespace Volian.Controls.Library //tv.SelectedNode = dropNode; Graphics g = tv.CreateGraphics(); TreeNodeTriangle(g); - if (_position != DropPosition.Child)InsertPointer(tmp, g); + if (_position != DropPosition.Child) InsertPointer(tmp, g); } } -// } -// else ScrollTreeView(tmp); + // } + // else ScrollTreeView(tmp); DragHelper.ImageList_DragShowNolock(true); } } @@ -4087,10 +4115,10 @@ namespace Volian.Controls.Library tn.NextVisibleNode.EnsureVisible();// Make sure that the next node is visible else if (tn.PrevVisibleNode != null && tn.PrevVisibleNode.PrevVisibleNode != null && tn.PrevVisibleNode.PrevVisibleNode.IsVisible == false) - tn.PrevVisibleNode.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible } - else + tn.PrevVisibleNode.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible } + else if (tn.PrevVisibleNode != null && tn.PrevVisibleNode.IsVisible == false) - tn.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible + tn.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible retval = (top != tn.Bounds.Top); // if (retval) if(_MyLog.IsInfoEnabled)_MyLog.Info("Scroll"); } @@ -4123,14 +4151,14 @@ namespace Volian.Controls.Library { DragDropEffects ee = e.Effect; if (e.KeyState == 13) // Shift and Control Keys to do a move. - ee = DragDropEffects.Move; + ee = DragDropEffects.Move; else ee = DragDropEffects.None; // Default - Do nothing - if (IsChild(dragNode, dl.DropNode)) // Don't copy or move to a child node + if (IsChild(dragNode, dl.DropNode)) // Don't copy or move to a child node ee = DragDropEffects.None; - else if (IsDocVersion((VETreeNode)dragNode)) // Don't move docversions + else if (IsDocVersion((VETreeNode)dragNode)) // Don't move docversions ee = DragDropEffects.None; - else if (IsFolder((VETreeNode)dragNode)) // Folder move is only valid if moving to folder with NO docversions + else if (IsFolder((VETreeNode)dragNode)) // Folder move is only valid if moving to folder with NO docversions { FolderInfo fdropi = ((VETreeNode)dl.DropNode).VEObject as FolderInfo; if (fdropi == null || fdropi.FolderDocVersionCount > 0) ee = DragDropEffects.None; @@ -4141,7 +4169,7 @@ namespace Volian.Controls.Library // For HLP, just move within the same procedure // TODO: allow for section move within subsections. ProcedureInfo pdropi = ((VETreeNode)dl.DropNode).VEObject as ProcedureInfo; - if (pdropi == null || (dragNode.Parent != dl.DropNode)) ee = DragDropEffects.None; + if (pdropi == null || (dragNode.Parent != dl.DropNode)) ee = DragDropEffects.None; } else if (!IsFolder((VETreeNode)dragNode) && (dragNode.Parent != dl.DropNode)) ee = DragDropEffects.None; @@ -4152,7 +4180,7 @@ namespace Volian.Controls.Library } catch (Exception ex) { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragOver", ex); + if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_DragOver", ex); } } @@ -4206,7 +4234,7 @@ namespace Volian.Controls.Library } catch (Exception ex) { - if(_MyLog.IsErrorEnabled)_MyLog.Error("GetTreeNodeFromData", ex); + if (_MyLog.IsErrorEnabled) _MyLog.Error("GetTreeNodeFromData", ex); } } return null; @@ -4232,7 +4260,7 @@ namespace Volian.Controls.Library this.SelectedNode = dragNode; FolderInfo fdragi = ((VETreeNode)dragNode).VEObject as FolderInfo; FolderInfo fdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as FolderInfo; - if (fdragi != null && fdropi != null && fdropi.FolderDocVersionCount==0) + if (fdragi != null && fdropi != null && fdropi.FolderDocVersionCount == 0) { using (Folder fdrag = fdragi.Get()) { @@ -4251,7 +4279,7 @@ namespace Volian.Controls.Library // may either be a document version or a procedure depending on where the user wants to position the procedure. ProcedureInfo pdragi = ((VETreeNode)dragNode).VEObject as ProcedureInfo; ProcedureInfo pdropi = null; - if (pdragi != null) // moving a procedure + if (pdragi != null) // moving a procedure { pdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as ProcedureInfo; if (pdropi != null && pdragi.ActiveParent == pdropi.ActiveParent) @@ -4271,7 +4299,7 @@ namespace Volian.Controls.Library // Allow drag/drop of sections within the same procedure or same section (if subsection) (must have same parent) SectionInfo sdragi = ((VETreeNode)dragNode).VEObject as SectionInfo; SectionInfo sdropi = null; - if (sdragi != null) // moving a section + if (sdragi != null) // moving a section { sdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as SectionInfo; if (sdropi != null && sdragi.ActiveParent == sdropi.ActiveParent) @@ -4292,7 +4320,7 @@ namespace Volian.Controls.Library // Allow drag/drop of steps within the same parent only StepInfo stdragi = ((VETreeNode)dragNode).VEObject as StepInfo; StepInfo stdropi = null; - if (stdragi != null) // moving a step + if (stdragi != null) // moving a step { stdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as StepInfo; if (stdropi != null && stdragi.ActiveParent == stdropi.ActiveParent) @@ -4316,36 +4344,36 @@ namespace Volian.Controls.Library } catch (Exception ex) { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragDrop", ex); + if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_DragDrop", ex); } } -// private void DumpMembers(object o) -// { -// Type t = o.GetType(); -// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n\r\nMembers for type {0}", t.ToString()); -// MemberInfo[] mis = t.GetMembers(); -// int i = 0; -// foreach (MemberInfo mi in mis) -// { -// i++; -// try -// { -// //if(mi.MemberType != MemberTypes.Method) -// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0} {1} {2}", i, mi.Name, mi.MemberType); -//// if (fi.Name == "TreeView") -//// fi.SetValue(o, null); -// } -// catch (Exception ex) -// { -// if(_MyLog.IsErrorEnabled)_MyLog.Error("DumpMembers", ex); -// } -// } -// } + // private void DumpMembers(object o) + // { + // Type t = o.GetType(); + // //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n\r\nMembers for type {0}", t.ToString()); + // MemberInfo[] mis = t.GetMembers(); + // int i = 0; + // foreach (MemberInfo mi in mis) + // { + // i++; + // try + // { + // //if(mi.MemberType != MemberTypes.Method) + // //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0} {1} {2}", i, mi.Name, mi.MemberType); + //// if (fi.Name == "TreeView") + //// fi.SetValue(o, null); + // } + // catch (Exception ex) + // { + // if(_MyLog.IsErrorEnabled)_MyLog.Error("DumpMembers", ex); + // } + // } + // } private TreeNode Clone(TreeNode tn) { TreeNode tmp = (TreeNode)tn.Clone(); - ExpandMatch(tmp,tn); + ExpandMatch(tmp, tn); return tmp; } private void tv_DragDropOld(object sender, System.Windows.Forms.DragEventArgs e)