From f02cce2cedd399ef00d222694bee5fa6d73b12de Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 1 Feb 2016 21:30:07 +0000 Subject: [PATCH] Change RTF token \line to \pard\line so that text displays properly. Pause timer to refresh the treeview while items are being added. --- .../Extension/DisplayText.cs | 2 ++ PROMS/Volian.Controls.Library/vlnTreeView.cs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index d474f751..54c45d78 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -312,6 +312,8 @@ namespace VEPROMS.CSLA.Library // save portion of this code for an explanation. text = text.Replace(@"\~", @"\u160?"); text = text.Replace("\r\n", @"\line "); // replace a \r\n with a \line instead of a \par + text = text.Replace(@"\line", @"\pard\line"); + text = text.Replace(@"\pard\pard\line", @"\pard\line"); //if (text.IndexOf(@"\line") > -1) // MessageBox.Show("Found rtf line"); //text = text.Replace(@"\line", @"\par"); // we don't want to replace the \line part of bug fix B2015-140 diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 949664d4..b0e10010 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -548,6 +548,16 @@ namespace Volian.Controls.Library { if (SectionShouldClose != null) SectionShouldClose(sender, args); } + public event vlnTreeViewSectionInfoEvent PauseRefresh; + private void OnPauseRefresh(object sender, vlnTreeSectionInfoEventArgs args) + { + if (PauseRefresh != null) PauseRefresh(sender, args); + } + public event vlnTreeViewSectionInfoEvent UnPauseRefresh; + private void OnUnPauseRefresh(object sender, vlnTreeSectionInfoEventArgs args) + { + if (UnPauseRefresh != null) UnPauseRefresh(sender, args); + } public event WordSectionDeletedEvent WordSectionDeleted; internal void OnWordSectionDeleted(object sender, WordSectionEventArgs args) { @@ -2090,6 +2100,7 @@ namespace Volian.Controls.Library { VETreeNode tn = null; if (SelectedNode == null) return; + OnPauseRefresh(this, null); SetLastValues((VETreeNode)SelectedNode); #region InsertFolderOrDocVersion @@ -2226,6 +2237,7 @@ namespace Volian.Controls.Library if (!MySessionInfo.CanCheckOutItem(_LastProcedureInfo.ItemID, CheckOutType.Procedure, ref message)) { MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); + OnUnPauseRefresh(this, null); return; } int s1 = -1; @@ -2332,6 +2344,7 @@ namespace Volian.Controls.Library if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) { MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); + OnUnPauseRefresh(this, null); return; } int tvindex = SelectedNode.Index; @@ -2373,6 +2386,7 @@ namespace Volian.Controls.Library if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) { MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); + OnUnPauseRefresh(this, null); return; } tn = InsertChildStep((VETreeNode)SelectedNode); @@ -2383,6 +2397,7 @@ namespace Volian.Controls.Library if (!MySessionInfo.CanCheckOutItem(_LastStepInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) { MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); + OnUnPauseRefresh(this, null); return; } tn = InsertBeforeOrAfter(newtype, (VETreeNode)SelectedNode); @@ -2396,6 +2411,7 @@ namespace Volian.Controls.Library Refresh(); OnNodeInsert(this, new vlnTreeEventArgs(SelectedNode)); } + OnUnPauseRefresh(this, null); } private void CreateEnhancedForProcedure(MenuSelections typ, Procedure sourceProc, ProcedureInfo lastProcedureInfo) {