Compare commits

..
Author SHA1 Message Date
mschill f5f9975363 B2026-077 – Update Format inheritance to use index id instead of position/order. 2026-09-28 14:15:48 -04:00
mschill 8df20f32ce Merge pull request 'B2026-076 - Update Base format to move new type to bottom' (#818) from B2026-076 into Development
Ready for QA
2026-09-15 11:59:46 -04:00
mschill 6ca427a7c6 B2026-076 - Update Base format to move new 2026-09-15 12:01:22 -04:00
mschill 14a8922976 Merge pull request 'C2026-054 Text change for Open Tabs from Previous Session dialog box' (#815) from C2026-054-Text-change-for-Open-Tabs-from-Previous-Session into Development
Looks Good. Ready for QA.
2026-09-14 05:36:50 -04:00
plarsen 2f5affabbe C2026-054-Text-change-for-Open-Tabs-from-Previous-Session 2026-09-12 07:47:56 -04:00
plarsen 44c86e5d80 C2026-054-Text-change-for-Open-Tabs-from-Previous-Session 2026-09-11 12:13:16 -04:00
plarsen d5859f2a01 C2026-054-Text-change-for-Open-Tabs-from-Previous-Session 2026-09-10 16:10:08 -04:00
jjenko 506c826eb3 Merge pull request 'C2026 048 tool tip update' (#814) from C2026-048-Tool-Tip-Update into Development
good for testing phase
2026-09-10 14:00:18 -04:00
plarsen 96839f8379 Merge branch 'Development' into C2026-048-Tool-Tip-Update 2026-09-10 13:53:21 -04:00
plarsen f6e42d933e C2026-048-Tool-Tip-Update 2026-09-10 11:11:06 -04:00
mschill 28b79bf81b Merge pull request 'C2026-053' (#813) from C2026-053_restore_only_Proc_section_tabs into Development
Looks Good - Ready For QA
2026-09-09 14:54:21 -04:00
jjenko a87e23af7e C2026-053
When restoring the open procedure tabs while starting up PROMS, don’t restore any of the Word section tabs.
2026-09-09 14:51:51 -04:00
mschill 1e0e3a7114 Merge pull request 'B2026-074 Fixed issue where PROMS would hang when opening multiple saved Word section tabs. Also, we now save and restore to the step location of saved procedure editor sections.' (#812) from B2026-074_restore_proc_tabs into Development
Looks good. Ready for QA.
2026-09-04 10:47:44 -04:00
jjenko 7333247b52 B2026-074 Fixed issue where PROMS would hang when opening multiple saved Word section tabs. Also, we now save and restore to the step location of saved procedure editor sections. 2026-09-04 10:44:35 -04:00
jjenko e16b3262d9 Merge pull request 'C2026-041-invisible-position-changes-as-differences' (#807) from C2026-041-invisible-position-changes-as-differences into Development
good for QA
2026-09-03 08:56:31 -04:00
plarsen edc5bc611b C2026-041-invisible-position-changes-as-differences 2026-09-02 16:27:59 -04:00
plarsen c32121c4c4 C2026-041-invisible-position-changes-as-differences 2026-09-02 15:48:26 -04:00
plarsen 213b8d18f7 C2026-041-invisible-position-changes-as-differences 2026-09-02 14:47:09 -04:00
plarsen 8e7be9723e Merge branch 'Development' into C2026-041-invisible-position-changes-as-differences 2026-09-02 08:03:22 -04:00
plarsen 61394a8b26 Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2026-09-02 08:01:43 -04:00
plarsen 1cb397f47b C2026-041-invisible-position-changes-as-differences 2026-09-02 08:01:06 -04:00
jjenko 298dfaeece Merge pull request 'F2026-021 Fixed the inheritance of the new step type “Step with Section Num” to allow RNO and sub items. Removed the period between the section number and high level step number.' (#811) from F2026-021_Ginna_Appendex_Num_Step_Prefix into Development
Format only changes. Ready for testing.
2026-08-31 10:10:25 -04:00
jjenko ae94400fff F2026-021 Fixed the inheritance of the new step type “Step with Section Num” to allow RNO and sub items. Removed the period between the section number and high level step number. 2026-08-31 10:08:12 -04:00
mschill 8a33bcafe8 Merge pull request 'F2026-021 Ginna EOP/AOP Format, added a high level step type called “Step with Section Num”' (#810) from F2026-021_Ginna_Appendex_Num_Step_Prefix into Development
Looks Good. Ready for QA.
2026-08-28 14:35:58 -04:00
jjenko dcf9c03738 F2026-021 Ginna EOP/AOP Format, added a high level step type called “Step with Section Num” 2026-08-28 14:33:17 -04:00
jjenko 23f6a0febc Merge pull request 'F2026-022 In the Farley formats, adjusted the title box on the procedure pages to make room for large (long) procedure titles.' (#809) from F2026-022_Farley_Title_Box into Development
Format only changes.  Go for testing phase
2026-08-27 14:03:20 -04:00
plarsen 0137ccc5b3 C2026-041-invisible-position-changes-as-differences 2026-08-26 09:42:46 -04:00
plarsen 21c4936ee8 C2026-041-invisible-position-changes-as-differences 2026-08-24 13:47:02 -04:00
plarsen df2311dbda C2026-041-invisible-position-changes-as-differences 2026-08-24 10:51:54 -04:00
plarsen 034aa67e31 C2026-041-invisible-position-changes-as-differences 2026-08-18 17:37:12 -04:00
plarsen f8ab3c57be C2026-041-invisible-position-changes-as-differences 2026-08-18 13:33:10 -04:00
plarsen 6376d4669b C2026-041-invisible-position-changes-as-differences 2026-08-18 13:22:29 -04:00
plarsen f9cce608d6 Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2026-08-17 18:41:57 -04:00
plarsen 3d65b7c34a Development 2026-08-17 18:40:16 -04:00
43 changed files with 475 additions and 754 deletions
+1
View File
@@ -67,6 +67,7 @@
<Compile Include="frmSettings.Designer.cs">
<DependentUpon>frmSettings.cs</DependentUpon>
</Compile>
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmBaseline.resx">
+8
View File
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Not modifying Naming Styles")]
-3
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Baseline
+14
View File
@@ -30,6 +30,7 @@
{
this.components = new System.ComponentModel.Container();
this.panel1 = new System.Windows.Forms.Panel();
this.cbUseTruncatedData = new System.Windows.Forms.CheckBox();
this.btnUC = new System.Windows.Forms.Button();
this.cbCaseSensitive = new System.Windows.Forms.CheckBox();
this.cbFile2 = new System.Windows.Forms.ComboBox();
@@ -72,6 +73,7 @@
//
this.panel1.Controls.Add(this.btnUC);
this.panel1.Controls.Add(this.cbCaseSensitive);
this.panel1.Controls.Add(this.cbUseTruncatedData);
this.panel1.Controls.Add(this.cbFile2);
this.panel1.Controls.Add(this.cbFile1);
this.panel1.Controls.Add(this.tbSearch);
@@ -87,6 +89,17 @@
this.panel1.Size = new System.Drawing.Size(707, 80);
this.panel1.TabIndex = 0;
//
// cbUseTruncatedData // C2026-041
//
this.cbUseTruncatedData.AutoSize = true;
this.cbUseTruncatedData.Location = new System.Drawing.Point(456, 56);
this.cbUseTruncatedData.Name = "cbUseTruncatedData";
this.cbUseTruncatedData.Size = new System.Drawing.Size(123, 17);
this.cbUseTruncatedData.TabIndex = 11;
this.cbUseTruncatedData.Text = "Use Truncated Data";
this.tt.SetToolTip(this.cbUseTruncatedData, "Set the Search to be Case Sensitive\r\nUppercase and Lowercase will not match");
this.cbUseTruncatedData.UseVisualStyleBackColor = true;
//
// btnUC
//
this.btnUC.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -381,6 +394,7 @@
private System.Windows.Forms.ComboBox cbFile2;
private System.Windows.Forms.ComboBox cbFile1;
private System.Windows.Forms.CheckBox cbCaseSensitive;
private System.Windows.Forms.CheckBox cbUseTruncatedData;
private System.Windows.Forms.Button btnUC;
private System.Windows.Forms.ToolTip tt;
}
+174 -271
View File
@@ -43,18 +43,15 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Collections.Specialized;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Xml;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
namespace Baseline
{
@@ -70,15 +67,10 @@ namespace Baseline
StartsWith,
EndsWith,
Regex
}
}
public partial class frmBaseline : Form
{
private IgnoreLines _MyIgnore = new IgnoreLines();
public IgnoreLines MyIgnore
{
get { return _MyIgnore; }
set { _MyIgnore = value; }
}
public IgnoreLines MyIgnore { get; set; } = new IgnoreLines();
private LastWas myLast = LastWas.Search;
private Settings MySettings;
public string MyStatus
@@ -149,10 +141,12 @@ namespace Baseline
this.Location = Properties.Settings.Default.Location;
this.Size = Properties.Settings.Default.Size;
this.WindowState = Properties.Settings.Default.WidnowState;
if(Properties.Settings.Default.Ignore != null && Properties.Settings.Default.Ignore != "")
if (Properties.Settings.Default.Ignore != null && Properties.Settings.Default.Ignore != "")
MyIgnore = IgnoreLines.Get(Properties.Settings.Default.Ignore);
MySettings= new Settings();
MySettings.IgnoreLines = new BindingList<string>();
MySettings = new Settings
{
IgnoreLines = new BindingList<string>()
};
splitContainer1.SplitterDistance = Properties.Settings.Default.Split1;
splitContainer2.SplitterDistance = Properties.Settings.Default.Split2;
splitContainer3.SplitterDistance = Properties.Settings.Default.Split3;
@@ -224,7 +218,7 @@ namespace Baseline
lbResults2.Items.Clear();
MyStatus = "Searching...";
// Perform DebugPagination Comparison
FindFiles fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugPagination.txt",MyIgnore);
FindFiles fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugPagination.txt",MyIgnore, cbUseTruncatedData.Checked);
lbDifferent.DataSource = fnd;
lbDifferent.DisplayMember = "File1";
MyStatus = string.Format("{0} Differences Found", fnd.Count);
@@ -240,28 +234,27 @@ namespace Baseline
lbProcedures.Items.Clear();
lbResults1.Items.Clear();
lbResults2.Items.Clear();
FindFile ff = lbDifferent.SelectedItem as FindFile;
if (ff != null)
{
// Fill Procedure or Result ListBoxes
switch (myLast)
{
case LastWas.Pagination:
CompareContent(ff.File1, ff.File2);// Compare DebugPagination
break;
case LastWas.Baseline:
CompareContent3(ff.File1, ff.File2);// Compare DebugMeta
break;
case LastWas.Search:
ShowSearchResults(ff.File1, ff.File2);// Perform search on DebugMeta
break;
default:
CompareContent(ff.File1, ff.File2);//Default DebugPagination
break;
}
//CompareOneFile(ff.File1, ff.File2);
}
}
if (lbDifferent.SelectedItem is FindFile ff)
{
// Fill Procedure or Result ListBoxes
switch (myLast)
{
case LastWas.Pagination:
CompareContent(ff.File1, ff.File2);// Compare DebugPagination
break;
case LastWas.Baseline:
CompareContent3(ff.File1, ff.File2);// Compare DebugMeta
break;
case LastWas.Search:
ShowSearchResults(ff.File1, ff.File2);// Perform search on DebugMeta
break;
default:
CompareContent(ff.File1, ff.File2);//Default DebugPagination
break;
}
//CompareOneFile(ff.File1, ff.File2);
}
}
Procedures MyProcs1;
Procedures MyProcs2;
/// <summary>
@@ -361,13 +354,6 @@ namespace Baseline
lines1 = list1.AsEnumerable<string>();// Convert back to Enumerable to work with LINQ
return lines1;
}
private string GetProcNum(string line)
{
string retval = line.Substring(3, line.IndexOf(" | ") - 3);
if (retval.Contains("_"))
retval = retval.Substring(0, retval.IndexOf("_") - 1);
return retval;
}
/// <summary>
/// Include lines for Procedure or Page or Search is true
/// Account for Case Insensitive CheckBox
@@ -450,8 +436,8 @@ namespace Baseline
private void lbResults1_SelectedIndexChanged(object sender, EventArgs e)
{
string line=null;
if (lbResults1.SelectedItem is string)
line = (string)lbResults1.SelectedItem;
if (lbResults1.SelectedItem is string v)
line = v;
Line myLine = lbResults1.SelectedItem as Line;
switch (myLast)
{
@@ -472,8 +458,8 @@ namespace Baseline
{
string line=null;
if(lbResults2.SelectedItem is string)
line = (string)lbResults2.SelectedItem;
if(lbResults2.SelectedItem is string v)
line = v;
Line myLine = lbResults2.SelectedItem as Line;
switch (myLast)
@@ -515,16 +501,10 @@ namespace Baseline
/// <returns></returns>
private string ParseOutProcedureNumberFromLine(string txt)
{
// old logic was looking for the first occurence of ".S" in the txt string as the ending point of the procedure nuumber
// Beaver Valley has a procedure number "1.SBGEN" in which the old logic would not work
// 1.SBGEN.SC. ==> short path of attachment section "C"
// 1.SBGEN.SC..S1. ==> short path of Step 1 in attachment section "C"
string rtnstr = null;
int lidx = -1;
// if the item is to a high levels step or sub-step the short path as "..S" for each part of the step
// so look for the last occurence of ".." which will be the end of the section information
lidx = txt.LastIndexOf("..");
if (lidx > 0)
// if the item is to a high levels step or sub-step the short path as "..S" for each part of the step
// so look for the last occurence of ".." which will be the end of the section information
int lidx = txt.LastIndexOf("..");
if (lidx > 0)
{
lidx = txt.LastIndexOf(".S", lidx); // this will position us to the end of the procedure number
}
@@ -532,9 +512,13 @@ namespace Baseline
{
lidx = txt.LastIndexOf(".S"); // this will position us to the end of the procedure number if there was no step information
}
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
rtnstr = txt.Substring(8, lidx - 8).Replace("/", "_").Replace("\\", "_");
return rtnstr;
// old logic was looking for the first occurence of ".S" in the txt string as the ending point of the procedure nuumber
// Beaver Valley has a procedure number "1.SBGEN" in which the old logic would not work
// 1.SBGEN.SC. ==> short path of attachment section "C"
// 1.SBGEN.SC..S1. ==> short path of Step 1 in attachment section "C"
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
string rtnstr = txt.Substring(8, lidx - 8).Replace("/", "_").Replace("\\", "_");
return rtnstr;
}
string exePath;
@@ -616,10 +600,10 @@ namespace Baseline
progname = @"C:\Program Files (x86)\IDM Computer Solutions\UltraCompare\UC.exe";
System.Diagnostics.ProcessStartInfo psi =
new System.Diagnostics.ProcessStartInfo(progname, string.Format(@" -t ""{0}"" ""{1}""", compareFile, baseFile));
System.Diagnostics.Process prc = System.Diagnostics.Process.Start(psi);
}
_ = System.Diagnostics.Process.Start(psi);
}
private ProcessLocationQueue myQueue= new ProcessLocationQueue();
private readonly ProcessLocationQueue myQueue= new ProcessLocationQueue();
private Timer queueTimer = null;
/// <summary>
/// Move a Process to a specific screen location - This is done with a timer so
@@ -632,9 +616,11 @@ namespace Baseline
{
if (queueTimer == null)
{
queueTimer = new Timer();
queueTimer.Enabled = false;
queueTimer.Tick += queueTimer_Tick;
queueTimer = new Timer
{
Enabled = false
};
queueTimer.Tick += queueTimer_Tick;
queueTimer.Interval = 1000;
}
myQueue.Add(proc, x, y);
@@ -669,8 +655,8 @@ namespace Baseline
string procPatern = string.Format("*{0}*.pdf", proc == string.Empty ? "noProcNumber" : proc);
int pagenum = myLine.MyPage.Number;
FindFile ff = lbDifferent.SelectedItem as FindFile;
string PDFfileName = null;
if (list == 1)
string PDFfileName;
if (list == 1)
{
FileInfo fi1 = new FileInfo(ff.File1);
PDFfileName = GetPFDFileAndPath(fi1, procPatern);
@@ -701,11 +687,13 @@ namespace Baseline
return;
}
}
// open the PDF and jump to the page number
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum,PDFfileName));
psi1.UseShellExecute = false;
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
}
// open the PDF and jump to the page number
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum, PDFfileName))
{
UseShellExecute = false
};
_ = System.Diagnostics.Process.Start(psi1);
}
/// <summary>
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
/// </summary>
@@ -720,8 +708,9 @@ namespace Baseline
lbResults1.Items.Clear();
lbResults2.Items.Clear();
MyStatus = "Searching...";
// Perform code to find DebugMeta files with diffences
FindFiles fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugMeta.txt",MyIgnore);
FindFiles fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugMeta.txt", MyIgnore, cbUseTruncatedData.Checked);
lbDifferent.DataSource = fnd;
lbDifferent.DisplayMember = "File1";
MyStatus = string.Format("{0} Differences Found", fnd.Count);
@@ -744,7 +733,7 @@ namespace Baseline
lbResults2.Items.Clear();
MyStatus = "Searching...";
//Perform Search
FindFiles fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugMeta.txt", tbSearch.Text, SearchType.Contains, cbCaseSensitive.Checked);
FindFiles fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugMeta.txt", tbSearch.Text, SearchType.Contains, cbCaseSensitive.Checked, cbUseTruncatedData.Checked);
lbDifferent.DataSource = fnd;
lbDifferent.DisplayMember = "File1";
MyStatus = string.Format("{0} Differences Found", fnd.Count);
@@ -785,11 +774,10 @@ namespace Baseline
}
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
{
//Initialize Results List Box
Procedure myProc = lbProcedures.SelectedItem as Procedure;
if (myProc == null) return; // clicked on the white space (blank line) in the list of different procedures
//TODO: May need to consider if there are duplicate procedure numers and titles
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
//Initialize Results List Box
if (!(lbProcedures.SelectedItem is Procedure myProc)) return; // clicked on the white space (blank line) in the list of different procedures
//TODO: May need to consider if there are duplicate procedure numers and titles
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
// Build the results ListBox for the left window
lbResults1.Items.Clear();
if (myProc1 != null)
@@ -827,6 +815,7 @@ namespace Baseline
CompareOneFile(ff.File1, ff.File2);
}
}
}
public enum SearchType
{
@@ -836,28 +825,13 @@ namespace Baseline
};
public class Settings
{
private BindingList<string> _IgnoreLines;
public BindingList<string> IgnoreLines
{
get { return _IgnoreLines; }
set { _IgnoreLines = value; }
}
}
public BindingList<string> IgnoreLines { get; set; }
}
public partial class FindFile
{
private string _File1;
public string File1
{
get { return _File1; }
set { _File1 = value; }
}
private string _File2;
public string File2
{
get { return _File2; }
set { _File2 = value; }
}
public FindFile(string file1, string file2)
public string File1 { get; set; }
public string File2 { get; set; }
public FindFile(string file1, string file2)
{
File1 = file1;
File2 = file2;
@@ -865,24 +839,23 @@ namespace Baseline
}
public partial class FindFiles : List<FindFile>
{
private string _FileName;
public string FileName
{
get { return _FileName; }
}
/// <summary>
/// Build list of DocVersion Folders with differences
/// </summary>
/// <param name="path1">Base path</param>
/// <param name="path2">Compare path</param>
/// <param name="fileName">filename</param>
/// <param name="myIgnore">Ignore list</param>
public FindFiles(string path1, string path2, string fileName,IgnoreLines myIgnore)
private readonly string _FileName;
public string FileName => _FileName;
/// <summary>
/// Build list of DocVersion Folders with differences
/// </summary>
/// <param name="path1">Base path</param>
/// <param name="path2">Compare path</param>
/// <param name="fileName">filename</param>
/// <param name="myIgnore">Ignore list</param>
public FindFiles(string path1, string path2, string fileName,IgnoreLines myIgnore, bool TruncatedDataFg)
{
DirectoryInfo di1 = new DirectoryInfo(path1);
DirectoryInfo di2 = new DirectoryInfo(path2);
_FileName = fileName;
FillByCompare(di1, di2, fileName, myIgnore);
FillByCompare(di1, di2, fileName, myIgnore, TruncatedDataFg);
}
/// <summary>
/// Fill for a search
@@ -893,12 +866,12 @@ namespace Baseline
/// <param name="searchText"></param>
/// <param name="searchType"></param>
/// <param name="caseSensitive"></param>
public FindFiles(string path1, string path2, string fileName, string searchText, SearchType searchType, bool caseSensitive)
public FindFiles(string path1, string path2, string fileName, string searchText, SearchType searchType, bool caseSensitive, bool useTruncatedData)
{
DirectoryInfo di1 = new DirectoryInfo(path1);
DirectoryInfo di2 = new DirectoryInfo(path2);
_FileName = fileName;
FillByCompare(di1, di2, fileName,searchText,searchType, caseSensitive);
FillByCompare(di1, di2, fileName,searchText,searchType, caseSensitive, useTruncatedData);
}
/// <summary>
/// Fill results by search
@@ -909,13 +882,13 @@ namespace Baseline
/// <param name="searchText"></param>
/// <param name="searchType"></param>
/// <param name="caseSensitive"></param>
private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, string searchText, SearchType searchType, bool caseSensitive)
private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, string searchText, SearchType searchType, bool caseSensitive, bool UseTruncatedData)
{
foreach (DirectoryInfo diChild1 in di1.GetDirectories())
{
DirectoryInfo diChild2 = new DirectoryInfo(di2.FullName + "\\" + diChild1.Name);
if (diChild2.Exists)
FillByCompare(diChild1, diChild2, fileName,searchText,searchType,caseSensitive);
FillByCompare(diChild1, diChild2, fileName,searchText,searchType,caseSensitive, UseTruncatedData);
}
foreach (FileInfo fiChild1 in di1.GetFiles(fileName))
{
@@ -989,27 +962,49 @@ namespace Baseline
}
return false;
}
private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, IgnoreLines myIgnore)
private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, IgnoreLines myIgnore, bool isTruncatedChecked = false)
{
foreach (DirectoryInfo diChild1 in di1.GetDirectories())
foreach (DirectoryInfo diChild1 in di1.GetDirectories())
{
DirectoryInfo diChild2 = new DirectoryInfo(di2.FullName + "\\" + diChild1.Name);
DirectoryInfo diChild2 = new DirectoryInfo(Path.Combine(di2.FullName, diChild1.Name));
if (diChild2.Exists)
FillByCompare(diChild1, diChild2, fileName,myIgnore);// Recursively work on Sub-Folders
FillByCompare(diChild1, diChild2, fileName,myIgnore, isTruncatedChecked);// Recursively work on Sub-Folders
}
foreach (FileInfo fiChild1 in di1.GetFiles(fileName))
{
FileInfo fiChild2 = new FileInfo(di2.FullName + "\\" + fiChild1.Name);
if (fiChild2.Exists)
FileInfo fiChild2 = new FileInfo(Path.Combine(di2.FullName, fiChild1.Name));
FileInfo fiChild1_truncated = new FileInfo(fiChild1.FullName.Replace(".txt", "_Truncated.txt"));
FileInfo fiChild2_truncated = new FileInfo(fiChild2.FullName.Replace(".txt", "_Truncated.txt"));
//truncate checked and both files exist
if (isTruncatedChecked && fiChild1_truncated.Exists && fiChild2_truncated.Exists)
{
if (CompareFile(fiChild1, fiChild2,myIgnore))
Add(new FindFile(fiChild1.FullName, fiChild2.FullName));// Process Each File
if (CompareFile(fiChild1_truncated, fiChild2_truncated, myIgnore))
Add(new FindFile(fiChild1_truncated.FullName, fiChild2_truncated.FullName));
}
//truncate checked and only file 1 truncate files exist
else if (isTruncatedChecked && fiChild1_truncated.Exists && fiChild2.Exists)
{
if (CompareFile(fiChild1_truncated, fiChild2, myIgnore))
Add(new FindFile(fiChild1_truncated.FullName, fiChild2.FullName));
}
//truncate checked and only file 2 truncate files exist
else if (isTruncatedChecked && fiChild2_truncated.Exists)
{
if (CompareFile(fiChild1, fiChild2_truncated, myIgnore))
Add(new FindFile(fiChild1.FullName, fiChild2_truncated.FullName));
}
//truncated not checked or truncate files dont exist
else if (fiChild2.Exists)
{
if (CompareFile(fiChild1, fiChild2, myIgnore))
Add(new FindFile(fiChild1.FullName, fiChild2.FullName));
}
}
}
private bool CompareFile(FileInfo fiChild1, FileInfo fiChild2,IgnoreLines myIgnore)
{
if (fiChild1.Name == "DebugMeta.txt")
if (fiChild1.Name == "DebugMeta.txt" || fiChild1.Name == "DebugMeta_Truncated.txt")
{
IEnumerable<string> lines1 = ReadFilteredLines(fiChild1.FullName, false, myIgnore);//LINQ Read lines without ignored lines
IEnumerable<string> lines2 = ReadFilteredLines(fiChild2.FullName, false, myIgnore);//LINQ Read lines without ignored lines
@@ -1103,34 +1098,16 @@ namespace Baseline
// Text - the line of text
public partial class Procedure
{
private string _Number;
public string Number
public string Number { get; set; }
public string Title { get; set; }
public Pages MyPages { get; set; } = new Pages();
public Procedure(string number, string title)
{
get { return _Number; }
set { _Number = value; }
Number = number;
Title = title;
}
private string _Title;
public string Title
{
get { return _Title; }
set { _Title = value; }
}
private Pages _MyPages = new Pages();
public Pages MyPages
{
get { return _MyPages; }
set { _MyPages = value; }
}
public Procedure(string number, string title)
{
_Number = number;
_Title = title;
}
public override string ToString()
{
return string.Format("{0} - {1}", Number, Title);
}
}
public override string ToString() => string.Format("{0} - {1}", Number, Title);
}
public partial class Procedures : List<Procedure>
{
// Sample data for a Procedure Number line
@@ -1161,77 +1138,34 @@ namespace Baseline
}
public partial class Page
{
private int _Number;
public int Number
{
get { return _Number; }
set { _Number = value; }
}
private Lines _MyLines = new Lines();
public int Number { get; set; }
public Lines MyLines
{
get { return _MyLines; }
set { _MyLines = value; }
}
public Page(int number)
{
_Number = number;
}
public override string ToString()
{
return string.Format("Page {0}", Number);
}
}
public Lines MyLines { get; set; } = new Lines();
public Page(int number) => Number = number;
public override string ToString() => string.Format("Page {0}", Number);
}
public partial class Pages : List<Page>
{
public void Add(int number)
{
Add(new Page(number));
}
}
public void Add(int number) => Add(new Page(number));
}
public partial class Line
{
private Procedure _MyProc;
public Procedure MyProc
public Procedure MyProc { get; set; }
public Page MyPage { get; set; }
public string Text { get; set; }
public Line(string text) => Text = text;
public Line(string text, Procedure myProc, Page myPage)
{
get { return _MyProc; }
set { _MyProc = value; }
Text = text;
MyProc = myProc;
MyPage = myPage;
}
private Page _MyPage;
public Page MyPage
{
get { return _MyPage; }
set { _MyPage = value; }
}
private string _Text;
public string Text
{
get { return _Text; }
set { _Text = value; }
}
public Line(string text)
{
_Text = text;
}
public Line(string text, Procedure myProc, Page myPage)
{
_Text = text;
_MyProc = myProc;
_MyPage = myPage;
}
public override string ToString()
{
return Text;
}
}
public override string ToString() => Text;
}
public partial class Lines : List<Line>
{
public void Add(string text)
{
Add(new Line(text));
}
}
public void Add(string text) => Add(new Line(text));
}
[Serializable]
public partial class IgnoreLine
{
@@ -1269,21 +1203,12 @@ namespace Baseline
public IgnoreLines()
{
}
public void Add(string text, Relation searchType, bool active)
{
Add(new IgnoreLine(text, searchType, active));
}
// Convert IgnoreLines to string (XML)
public override string ToString()
{
return GenericSerializer<IgnoreLines>.StringSerialize(this);
}
// Convert string to IgnoreLines
public static IgnoreLines Get(string xml)
{
return GenericSerializer<IgnoreLines>.StringDeserialize(xml);
}
}
public void Add(string text, Relation searchType, bool active) => Add(new IgnoreLine(text, searchType, active));
// Convert IgnoreLines to string (XML)
public override string ToString() => GenericSerializer<IgnoreLines>.StringSerialize(this);
// Convert string to IgnoreLines
public static IgnoreLines Get(string xml) => GenericSerializer<IgnoreLines>.StringDeserialize(xml);
}
/// <summary>
/// This is a simple serializer that takes a class and converts it to and from string (XML)
/// </summary>
@@ -1311,7 +1236,7 @@ namespace Baseline
string ss = s.Replace("encoding=\"utf-16\"", "");
XmlSerializer xs = new XmlSerializer(typeof(T));
UTF8Encoding enc = new UTF8Encoding();
Byte[] arrBytData = enc.GetBytes(ss);
byte[] arrBytData = enc.GetBytes(ss);
using (MemoryStream ms = new MemoryStream(arrBytData))
{
t = (T)xs.Deserialize(ms);
@@ -1325,12 +1250,9 @@ namespace Baseline
public class NonXsiTextWriter : XmlTextWriter
{
public NonXsiTextWriter(TextWriter w) : base(w) { }
public NonXsiTextWriter(Stream w, Encoding encoding)
: base(w, encoding)
{
this.Formatting = Formatting.Indented;
}
public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
public NonXsiTextWriter(Stream w, Encoding encoding)
: base(w, encoding) => Formatting = Formatting.Indented;
public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
bool _skip = false;
public override void WriteStartAttribute(string prefix, string localName, string ns)
{
@@ -1372,32 +1294,16 @@ namespace Baseline
public const short SWP_NOZORDER = 0X4;
public const int SWP_SHOWWINDOW = 0x0040;
private System.Diagnostics.Process _Process;
public System.Diagnostics.Process Process
{
get { return _Process; }
set { _Process = value; }
}
private int _X;
public int X
{
get { return _X; }
set { _X = value; }
}
private int _Y;
public int Y
{
get { return _Y; }
set { _Y = value; }
}
public ProcessLocation(System.Diagnostics.Process process, int x, int y)
public System.Diagnostics.Process Process { get; set; }
public int X { get; set; }
public int Y { get; set; }
public ProcessLocation(System.Diagnostics.Process process, int x, int y)
{
Process = process;
X = x;
Y = y;
}
private static Boolean FoxitSettingInfo = true;
private static bool FoxitSettingInfo = true;
/// <summary>
/// MoveIt() moves the window containing the PDF viewer to the right so the two pdf viewer windows will not overlap.
@@ -1418,11 +1324,8 @@ namespace Baseline
}
public class ProcessLocationQueue: Queue<ProcessLocation>
{
public void Add(System.Diagnostics.Process process, int x, int y)
{
Enqueue(new ProcessLocation(process,x,y));
}
public void ProcessNext()
public void Add(System.Diagnostics.Process process, int x, int y) => Enqueue(new ProcessLocation(process, x, y));
public void ProcessNext()
{
ProcessLocation pl = Dequeue();
pl.MoveIt();
-3
View File
@@ -120,9 +120,6 @@
<metadata name="tt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>306, 17</value>
</metadata>
<metadata name="tt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>306, 17</value>
</metadata>
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
+6 -26
View File
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Baseline
@@ -19,17 +12,7 @@ namespace Baseline
set {
_MyIgnore = value;
dgv.DataSource=null;
//dgvcSearchType.ValueType = typeof(Relation);
//dgvcSearchType.ValueMember = "Value";
//dgvcSearchType.DisplayMember = "Display";
//dgvcSearchType.DataSource = new Relation[] { Relation.Contains, Relation.StartsWith, Relation.EndsWith, Relation.Regex }
//.Select(x => new { Display = x.ToString(), Value = x })
//.ToList();
dgv.DataSource=value;
//dgvcSearchType.DataSource =
//new List<Relation>((Relation[]) Enum.GetValues(typeof(Relation)))
//.Select(x => new { Display=x.ToString(), Value=(int)x })
//.ToList();;
}
}
public frmSettings(IgnoreLines myIgnore)
@@ -46,19 +29,16 @@ namespace Baseline
col.ValueType = typeof(Relation);
}
private void dgv_DataError(object sender, DataGridViewDataErrorEventArgs e)
private void dgv_DataError(object sender, DataGridViewDataErrorEventArgs e) => Console.WriteLine("Here");
private void btnOK_Click(object sender, EventArgs e)
{
Console.WriteLine("Here");
}
private void btnOK_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
this.Close();
DialogResult = System.Windows.Forms.DialogResult.OK;
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Close();
DialogResult = System.Windows.Forms.DialogResult.Cancel;
Close();
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10 -9
View File
@@ -1,4 +1,5 @@
namespace VEPROMS
{
partial class dlgCheckOpenTabs
@@ -42,12 +43,12 @@ namespace VEPROMS
//
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelX1.Location = new System.Drawing.Point(23, 2);
this.labelX1.Location = new System.Drawing.Point(23, 5);
this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(363, 78);
this.labelX1.Size = new System.Drawing.Size(363, 90);
this.labelX1.TabIndex = 0;
this.labelX1.Text = "Would you like for PROMS to reopen the tabs that you had open during your last se" +
"ssion?";
"ssion?" + System.Environment.NewLine + System.Environment.NewLine + "NOTE: This will not apply to Word section tabs that were previously open.";
this.labelX1.WordWrap = true;
//
// cbRemember
@@ -56,20 +57,20 @@ namespace VEPROMS
//
//
this.cbRemember.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbRemember.Location = new System.Drawing.Point(23, 75);
this.cbRemember.Location = new System.Drawing.Point(23, 100);
this.cbRemember.Name = "cbRemember";
this.cbRemember.Size = new System.Drawing.Size(376, 47);
this.cbRemember.Size = new System.Drawing.Size(376, 55);
this.cbRemember.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbRemember.TabIndex = 1;
this.cbRemember.Text = "Check this box to not be prompted in the future when opening PROMS. \nNote that th" +
"ese settings can be adjusted at any time from the \nOPTIONS menu for PROMS.";
"ese settings can be adjusted at any time from the \nOPTIONS menu for PROMS.";
//
// btnOpenTabs
//
this.btnOpenTabs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnOpenTabs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnOpenTabs.DialogResult = System.Windows.Forms.DialogResult.Yes;
this.btnOpenTabs.Location = new System.Drawing.Point(23, 139);
this.btnOpenTabs.Location = new System.Drawing.Point(23, 165);
this.btnOpenTabs.Name = "btnOpenTabs";
this.btnOpenTabs.Size = new System.Drawing.Size(150, 42);
this.btnOpenTabs.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -82,7 +83,7 @@ namespace VEPROMS
this.btnNoTabs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnNoTabs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnNoTabs.DialogResult = System.Windows.Forms.DialogResult.No;
this.btnNoTabs.Location = new System.Drawing.Point(216, 139);
this.btnNoTabs.Location = new System.Drawing.Point(216, 165);
this.btnNoTabs.Name = "btnNoTabs";
this.btnNoTabs.Size = new System.Drawing.Size(150, 42);
this.btnNoTabs.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -94,7 +95,7 @@ namespace VEPROMS
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(411, 193);
this.ClientSize = new System.Drawing.Size(411, 220);
this.ControlBox = false;
this.Controls.Add(this.btnNoTabs);
this.Controls.Add(this.btnOpenTabs);
+34 -40
View File
@@ -1,23 +1,15 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Configuration;
using System.Reflection;
using VEPROMS.CSLA.Library;
//using Csla;
using DevComponents;
using DevComponents.DotNetBar;
using DevComponents.DotNetBar.Rendering;
using VEPROMS.Properties;
using Volian.Controls.Library;
using DescriptiveEnum;
using Volian.Base.Library;
using Volian.Print.Library;
using JR.Utils.GUI.Forms;
@@ -1610,7 +1602,7 @@ namespace VEPROMS
displayRO.MyROFST = SelectedROFst;
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in
// true to LoadTree
if (!_WeAreExitingPROMS) displayRO.LoadTree(true);
if (!_WeAreExitingPROMS) displayRO.LoadTree(this,true);
}
}
@@ -1846,7 +1838,7 @@ namespace VEPROMS
// should be closed or if we should exit PROMS or just Cancel to continue working
if (tc._MyDisplayTabItems.Count < 1) // If all thabs are closed in the editor will indicate that in the database.
{
VEPROMS.CSLA.Library.Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
}
if (!_WeAreExitingPROMS && !ClosingWithError && tc.SelectedDisplayTabItem != null && tc._MyDisplayTabItems.Count > 0)
{
@@ -1864,7 +1856,7 @@ namespace VEPROMS
return;
}
string stk = Volian.Base.Library.vlnStackTrace.StackToString();
string stk = vlnStackTrace.StackToString();
if (!stk.Contains("Exception"))
{
@@ -1872,33 +1864,28 @@ namespace VEPROMS
// B2019-071 we will now close one or all of the tabs (even step editor ones)
if (_WeAreExitingPROMS)
{
string DisplayTabID = "";
int pos;
int TabItemID;
string DisplayTabName = "";
int cnt = 0;
// Deactivate previous procedure tab state by user
VEPROMS.CSLA.Library.Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
// Save current procedure tab state
//B2024-082 Remember Tabs Not opening in correct order
int cnt = 0;
foreach (DisplayTabItem dti in tc.MyBar.Items)
{
cnt++;
DisplayTabID = dti.MyKey;
TabItemID = dti.MyItemInfo.ItemID;
DisplayTabName = dti.ToString();
Item.AddDisplayTabsState(TabItemID, DisplayTabID, DisplayTabName, MySessionInfo.UserID, cnt);
ItemInfo itminfo = dti.MyItemInfo;
string DisplayTabID = dti.MyKey;
string DisplayTabName = dti.ToString();
// B2026-074 if a Word section, save the ItemID of the entire Word section
// else if a Step Editor section, save the ItemID of the step part the user was on
int TabItemID = itminfo.HasWordContent ? itminfo.ItemID : dti.MyStepTabPanel.MyStepTabRibbon.MyEditItem.MyItemInfo.ItemID;
Item.AddDisplayTabsState(TabItemID, DisplayTabID, DisplayTabName, MySessionInfo.UserID, cnt);
}
}
int n = tc._MyDisplayTabItems.Count;
while (n-- > 0 && tc._MyDisplayTabItems.Count > 0)
{
tc.CloseTabItem(tc.SelectedDisplayTabItem);
// B2019-071 close just the current tab and continue working
if (!dctoe.ExitPROMS)
{
@@ -2543,13 +2530,13 @@ namespace VEPROMS
}
// Add retrieve displaytabs state here.
openDisplaytabstate();
OpenDisplaytabstate();
}
public void openDisplaytabstate()
private void OpenDisplaytabstate()
{
// Retrieve edit tab state from database.
DataTable DisPlayTabState = VEPROMS.CSLA.Library.Item.GetDisplayTabs(VlnSettings.UserID);
DataTable DisPlayTabState = Item.GetDisplayTabs(VlnSettings.UserID);
//CSM - C2024-031 - Getting User Settings
//and set checkboxes based on what they are set to
@@ -2569,17 +2556,23 @@ namespace VEPROMS
usersettings.SetUserSettings(true, result == DialogResult.Yes);
}
if (result == DialogResult.Yes)
{
// B2026-074 added flag (LoadingSavedProcTabs) to supress unnecessary event calls
// this will help prevent PROMS from getting stuck continuously looping through the same events
// when Word procedure tabs are restored.
// C2026-053 leaving this flag in her for now should we decide to trouble-shoot reopening of Word tabs later on.
tc.LoadingSavedProcTabs = true; // we check for this flag in DSOTabPanel.cs when opening Word sections
foreach (DataRow TabState in DisPlayTabState.Rows)
{
int _ItemID = (int)TabState["ItemID"];
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
// Open procedure in the editor.
if (_Procedure == null) continue; //skip and continue with foreach
// C2026-053 Open procedure tab but only if it's NOT a Word section
// Needed to disable opening saved Word sections - at least for now.
// We were running into performace and random hanging issues with the Word tabs - maybe windows event related.
if (_Procedure == null || _Procedure.HasWordContent) continue; //skip and continue with foreach
OpenItem(_Procedure);
if (tc.MyEditItem == null) continue; // skip and continue with foreach
if (tc.MyEditItem == null) continue; // skip and continue with foreach
// SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work.
SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel;
@@ -2594,6 +2587,7 @@ namespace VEPROMS
SpellChecker.MyEditItem = tc.MyEditItem; //B2025-043 Remember Tabs is not setting the EditItem for the active window causing a PROMS crash when Spell Check
}
}
tc.LoadingSavedProcTabs = false;
}
}
}
@@ -4374,7 +4368,7 @@ namespace VEPROMS
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null :
SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.LoadTree(); //B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.LoadTree(this); //B2022-026 RO Memory reduction coding (Jakes Merge)
}
#endregion
@@ -4528,7 +4522,7 @@ namespace VEPROMS
// need this to update RO Tree after UpdateRofst (B2015-226)
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.MyROFST = SelectedROFst;
displayRO.LoadTree();
displayRO.LoadTree(this);
// resetting the MyROFSTLookup for the search & reports panels will refresh the RO trees after UpdateRofst in each of those panels (B2015-226)
if (SelectedDVI != null)
@@ -4603,7 +4597,7 @@ namespace VEPROMS
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (!_WeAreExitingPROMS && displayRO.LoadTree(true))
if (!_WeAreExitingPROMS && displayRO.LoadTree(this,true))
{
SelectedROFst = displayRO.MyROFST;
}
@@ -4723,7 +4717,7 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.MyRTB = null;
displayRO.LoadTree();
displayRO.LoadTree(this);
}
infotabTags.Visible = false;
@@ -4810,7 +4804,7 @@ namespace VEPROMS
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (!_WeAreExitingPROMS && displayRO.LoadTree())
if (!_WeAreExitingPROMS && displayRO.LoadTree(this))
{
SelectedROFst = displayRO.MyROFST;
}
@@ -4843,7 +4837,7 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.SetFindDocROButton(false);
if (!_WeAreExitingPROMS) displayRO.LoadTree();
if (!_WeAreExitingPROMS) displayRO.LoadTree(this);
//C2019-036 View Only mode work with Checked Out Procedures
//In View Only Mode - Step Properties should be disabled
@@ -4864,7 +4858,7 @@ namespace VEPROMS
displayRO.ROTypeFilter = E_ROValueType.All; // allow all RO types for Word attachments (but fix)
displayRO.SetFindDocROButton(true);
displayRO.LoadTree();
displayRO.LoadTree(this);
}
}
@@ -4996,7 +4990,7 @@ namespace VEPROMS
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (displayRO.LoadTree())
if (displayRO.LoadTree(this))
{
SelectedROFst = displayRO.MyROFST;
}
@@ -5553,7 +5553,10 @@ namespace VEPROMS.CSLA.Library
// Before checking for anything, if the DisplayNumber starts with 'ATTACHMENT ', don't use that in the Section
// prefix for the tabstring.
// F2023-112 - added flag to use entire section number in the step tab - Vogtle 3&4 Background format (VEGPBckStp)
string attNum = (ActiveSection.DisplayNumber.ToUpper().StartsWith("ATTACHMENT ") && !FormatStepData.TabData.UseEntireSectionNum) ? ActiveSection.DisplayNumber.Substring(11) : ActiveSection.DisplayNumber;
// F2026-021 - made the parsing of the section number generic instead of only parsing if the section number properties
// value started with the word "Attachment ". We now look for the first space to determine the section number/letter
int numidx = ActiveSection.DisplayNumber.IndexOf(" ");
string attNum = (numidx > -1 && (ActiveSection.DisplayNumber.Length > numidx + 1) && !FormatStepData.TabData.UseEntireSectionNum) ? ActiveSection.DisplayNumber.Substring(numidx + 1) : ActiveSection.DisplayNumber;
Match m = Regex.Match(attNum, @"[a-zA-Z]"); // for alpha, use non-touched displaynumber
int indx = -1;
if (m.Success)
+177 -378
View File
@@ -12,47 +12,14 @@ namespace VEPROMS.CSLA.Library
private static XmlElement mydocele;
public vlnFormatDocument(IFormatOrFormatInfo myFormat)
{
_MyFormat = myFormat;
MyFormat = myFormat;
LoadXml(MyFormat.Data);
mydocele = this.DocumentElement;
mydocele = DocumentElement;
}
private IFormatOrFormatInfo _MyFormat;
public IFormatOrFormatInfo MyFormat
public IFormatOrFormatInfo MyFormat { get; set; }
public static XmlNode LookupSingleNode(XmlNode xmlNode, string path)
{
get { return _MyFormat; }
set { _MyFormat = value; }
}
public static XmlNode LookupSingleNode(XmlNode xmlNode, string path)
{
//original:
//if (xmlNode == null) return null;
//XmlNode xn = xmlNode.SelectSingleNode(path);
//if (xn != null) return xn;
//if (xmlNode.Name == "Step") xn = LookupSingleStepNode(xmlNode, path);
//if (xn != null) return xn;
//if (path.StartsWith("Font")) return LookupSingleFontNode(xmlNode, path);
//return InheritLookup(xmlNode, path);
/* RHM 20090821 -
if (path.StartsWith("Font"))
{
XmlNode xn = null;
if (xmlNode != null)
{
xn = xmlNode.SelectSingleNode(path);
// RHM 2008-12-15 - Added logic to keep looking if a blank attribute is found
if (xn != null && xn is XmlAttribute && (xn as XmlAttribute).Value != "") return xn;
//if (xn != null) return xn;
}
else
{
xmlNode = LookupSingleNode(mydocele.FirstChild, "/PlantFormat/FormatData");
}
if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleNode {0},{1}", xmlNode.Name == "Step" ? "Step." + xmlNode.Attributes["Type"].Value : xmlNode.Name, path);
return LookupSingleFontNode(xmlNode, path);
}
else
{
*/
if (xmlNode == null) return null;
XmlNode xn = xmlNode.SelectSingleNode(path);
if (xmlNode.Name == "Box") return xn; // if box, don't do inheritance.
@@ -72,7 +39,6 @@ namespace VEPROMS.CSLA.Library
if (xn != null) return xn;
if (path.StartsWith("Font")) return LookupSingleFontNode(xmlNode, path); // Then do Font Inheritance
return InheritLookup(xmlNode, path, false);
// }
}
public static XmlNode LookupSingleFontNode(XmlNode xmlNode, string path)
{
@@ -108,29 +74,15 @@ namespace VEPROMS.CSLA.Library
if (xmlNode == null) return null;
XmlNode xn = xmlNode.SelectSingleNode(path);
XmlNode tmpNode = xmlNode;
XmlNode tmpNode2 = xmlNode;
XmlNode tmpNode2 = xmlNode;
while (xn == null) //Walk-up the format tree to find a step node
{
//if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleStepNode -> Loop {0},{1}", xmlNode.Name == "Step" ? "Step." + xmlNode.Attributes["Type"].Value : xmlNode.Name, path);
tmpNode = xmlNode;
// RHM 20090831 Try doing a lookup of the parent. If no parent, go back to the original and do an inheritance lookup
XmlAttribute attr = xmlNode.Attributes["ParentType"];
//if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleStepNode -> Loop {0},{1}", xmlNode.Name == "Step" ? "Step." + xmlNode.Attributes["Type"].Value : xmlNode.Name, path);
// RHM 20090831 Try doing a lookup of the parent. If no parent, go back to the original and do an inheritance lookup
XmlAttribute attr = xmlNode.Attributes["ParentType"];
if (attr == null || attr.Value == string.Empty) // Cannot find ParentType so do an InheritanceLookup
return InheritLookup(tmpNode2, path, true);
//return InheritLookup(xmlNode, path, false);
xmlNode = xmlNode.ParentNode.SelectSingleNode(string.Format("Step[@Type='{0}']", xmlNode.Attributes["ParentType"].InnerText));
// Based upon our current data - the following conditions are never met.
//if (xmlNode == null && path.StartsWith("Font"))
//{
// //if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleStepNode -> Font {0},{1}", tmpNode.Name == "Step" ? "Step." + tmpNode.Attributes["Type"].Value : tmpNode.Name, path);
// return LookupSingleFontNode(tmpNode, path);
//}
//if (xmlNode == null)
//{
// //if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleStepNode -> Font {0},{1}", tmpNode2.Name == "Step" ? "Step." + tmpNode2.Attributes["Type"].Value : tmpNode2.Name, path);
// return InheritLookup(tmpNode2, path, true);
//}
xn = xmlNode.SelectSingleNode(path);
}
return xn;
@@ -145,38 +97,20 @@ namespace VEPROMS.CSLA.Library
}
public static string Lookup(XmlNode xmlNode, string path)
{
//if (xmlNode == null) return null;
XmlNode xn = LookupSingleNode(xmlNode, path);
//if (xn == null) xn = InheritLookup(xmlNode, path);
if (xn == null) return null;
return xn.InnerText;
}
//public static string StepLookup(XmlNode xmlNode, string path)
//{
// //if (xmlNode == null) return null;
// XmlNode xn = LookupSingleStepNode(xmlNode, path);
// //if (xn == null) xn = InheritLookup(xmlNode, path);
// if (xn == null) return null;
// return xn.InnerText;
//}
public static T EnumLookup<T>(XmlNode xmlNode, string path)
return xn?.InnerText;
}
public static T EnumLookup<T>(XmlNode xmlNode, string path)
{
string str = Lookup(xmlNode,path);
if (str == null) return default(T);
return (T)Enum.Parse(typeof(T), str);
}
public static int? IntLookup(XmlNode xmlNode, string path)
return str == null ? default : (T)Enum.Parse(typeof(T), str);
}
public static int? IntLookup(XmlNode xmlNode, string path)
{
//if (xmlNode == null) return null;
//XmlNode xn = LookupSingleNode(xmlNode, path);
//if (xn == null) xn = InheritLookup(xmlNode, path);
//if (xn == null) return null;
//return int.Parse(xn.InnerText);
string str = Lookup(xmlNode, path);
if (str == null) return null;
return int.Parse(str);
}
public static int SiblingCount(XmlNode xmlNode)
return str == null ? null : (int?)int.Parse(str);
}
public static int SiblingCount(XmlNode xmlNode)
{
int retval = 0;
string nodeName = xmlNode.Name;
@@ -189,22 +123,32 @@ namespace VEPROMS.CSLA.Library
public static string Path(XmlNode xmlNode)
{
// Walk the path
string parentPath = (xmlNode.ParentNode == xmlNode.OwnerDocument ? "" : Path(xmlNode.ParentNode));
string parentPath = xmlNode.ParentNode == xmlNode.OwnerDocument ? "" : Path(xmlNode.ParentNode);
// Count Siblings with the Same Name
int sibCount = SiblingCount(xmlNode);
return string.Format("{0}/{1}[{2}]", parentPath, xmlNode.Name, sibCount);
}
public static XmlNode InheritLookup(XmlNode xmlNode, string path, bool stepLookup)
//B2026-077 – Update Format inheritance to use index id instead of position/order.
public static string PathByIndex(XmlNode xmlNode)
{
if (xmlNode.Name == "TransTypes" || xmlNode.Name == "Step")
{
string parentPath = xmlNode.ParentNode == xmlNode.OwnerDocument ? "" : Path(xmlNode.ParentNode);
string Indx = xmlNode.Attributes["Index"].Value;
return $@"{parentPath}/{xmlNode.Name}[@Index='{Indx}']";
}
else
{
return Path(xmlNode);
}
}
public static XmlNode InheritLookup(XmlNode xmlNode, string path, bool stepLookup)
{
//stepLookup = false; // 8/2 change for inheritance
if (xmlNode == null) return null;// No path to match
string xPath = Path(xmlNode);// Build xPath from xmlNode
if (xmlNode.Name == "TransTypes")
{
string TransIndex = xmlNode.Attributes["Index"].Value;
xPath = System.Text.RegularExpressions.Regex.Replace(xPath, @"\[[0-9]*\]$", @"[@Index='" + TransIndex + @"']");
}
vlnFormatDocument fd = (vlnFormatDocument)(xmlNode.OwnerDocument);//First Get the vlnFormatDocument - This also ties it to a FormatInfo object
string xPath = PathByIndex(xmlNode);// Build xPath from xmlNode
vlnFormatDocument fd = (vlnFormatDocument)xmlNode.OwnerDocument;//First Get the vlnFormatDocument - This also ties it to a FormatInfo object
while(fd.MyFormat.MyIParent != null)
{
fd = fd.MyFormat.MyIParent.PlantFormat.XmlDoc;// Get the parents vlnFormatDocument
@@ -215,8 +159,8 @@ namespace VEPROMS.CSLA.Library
else xp = fd.SelectSingleNode(xPath);// Get the related node
if (xp != null)
{
XmlNode xn = null;
if (stepLookup)
XmlNode xn;
if (stepLookup)
{
//if (path.Contains("Font")) Console.WriteLine("vlnFormatItem.SelectSingleNode {0},{1}", xp.Name == "Step" ? "Step." + xp.Attributes["Type"].Value : xp.Name, path);
xn = LookupSingleStepNode(xp, path);
@@ -233,14 +177,14 @@ namespace VEPROMS.CSLA.Library
{
if (xmlNode == null) return null;// No path to match
string xPath = Path(xmlNode);// Build xPath from xmlNode
vlnFormatDocument fd = (vlnFormatDocument)(xmlNode.OwnerDocument);//First Get the vlnFormatDocument - This also ties it to a FormatInfo object
vlnFormatDocument fd = (vlnFormatDocument)xmlNode.OwnerDocument;//First Get the vlnFormatDocument - This also ties it to a FormatInfo object
while (fd.MyFormat.MyIParent != null)
{
fd = fd.MyFormat.MyIParent.PlantFormat.XmlDoc;// Get the parents vlnFormatDocument
if (fd != null)
{
XmlNode xp = fd.SelectSingleNode(xPath);// Get the related node
if (xp != null)
if (xp != null)
{
XmlNodeList xl = xp.SelectNodes(path);
if (xl != null && xl.Count > 0)
@@ -256,100 +200,41 @@ namespace VEPROMS.CSLA.Library
[TypeConverter(typeof(ExpandableObjectConverter))]
public class vlnFormatItem
{
public vlnFormatItem(XmlNode xmlNode)
{
_XmlNode = xmlNode;
}
public vlnFormatItem() { }
XmlNode _XmlNode;
internal XmlNode XmlNode
{
get { return _XmlNode; }
set { _XmlNode = value; }
}
private IFormatOrFormatInfo _MyFormat;
public vlnFormatItem(XmlNode xmlNode) => XmlNode = xmlNode;
public vlnFormatItem() { }
internal XmlNode XmlNode { get; set; }
private IFormatOrFormatInfo _MyFormat;
public IFormatOrFormatInfo MyFormat
{
get
{
if (_MyFormat == null)
{
vlnFormatDocument doc = (XmlNode.OwnerDocument) as vlnFormatDocument;
if(doc != null)
_MyFormat = doc.MyFormat;
}
if (XmlNode.OwnerDocument is vlnFormatDocument doc)
_MyFormat = doc.MyFormat;
}
return _MyFormat;
}
}
private IFormatOrFormatInfo _MyParentFormat;
public IFormatOrFormatInfo MyParentFormat
public IFormatOrFormatInfo MyParentFormat => MyFormat.MyIParent;
public virtual string GetPDDisplayName() => ToString();
public virtual string GetPDName() => ToString();
public virtual string GetPDDescription() => ToString();
public virtual string GetPDCategory() => ToString();
public XmlNodeList SelectNodes(string path) => vlnFormatDocument.LookupNodes(XmlNode, path);
public XmlNode SelectSingleNode(string path)
{
get
{
return MyFormat.MyIParent;
}
}
public virtual string GetPDDisplayName()
{ return ToString(); }
public virtual string GetPDName()
{ return ToString(); }
public virtual string GetPDDescription()
{ return ToString(); }
public virtual string GetPDCategory()
{ return ToString(); }
public XmlNodeList SelectNodes(string path)
{
return vlnFormatDocument.LookupNodes(_XmlNode, path);
}
public XmlNode SelectSingleNode(string path)
{
//AdjustLookup(_XmlNode, path);
//if(path.Contains("Font")) Console.WriteLine("vlnFormatItem.SelectSingleNode {0},{1}", _XmlNode.Name == "Step" ? "Step." + _XmlNode.Attributes["Type"].Value : _XmlNode.Name, path);
return vlnFormatDocument.LookupSingleNode(_XmlNode, path);
return vlnFormatDocument.LookupSingleNode(XmlNode, path);
}
//public static string _LookUpNode;
//private static void AdjustLookup(XmlNode xmlNode,string path)
//{
// if (xmlNode.Name == "Step")
// {
// XmlAttribute attr = xmlNode.Attributes["Type"];
// if (attr != null) _LookUpNode = attr.Value;
// //Console.WriteLine("AdjustLookup Type = {0}/{1}", _LookUpNode, path);
// }
// else
// {
// //Console.WriteLine("AdjustLookup {0}", xmlNode.Name);
// }
//}
public XmlNode SelectSingleFontNode(string path)
{
return vlnFormatDocument.LookupSingleFontNode(_XmlNode, path);
}
public string Lookup(string path)
{
return vlnFormatDocument.Lookup(_XmlNode, path);
}
public string Lookup(string path, ref string local)
{
return (local != null? local : local = Lookup(path));
}
//public string StepLookup(string path)
//{
// return vlnFormatDocument.StepLookup(_XmlNode, path);
//}
public int? IntLookup(string path)
{
return vlnFormatDocument.IntLookup(_XmlNode, path);
}
public int? IntLookup(string path, ref int? local)
{
return (local != null ? local : local = IntLookup(path));
}
public T EnumLookup<T>(string path)
{
return vlnFormatDocument.EnumLookup<T>(_XmlNode, path);
}
public bool LazyLoad(ref LazyLoad<bool> ll, string xPath)
public XmlNode SelectSingleFontNode(string path) => vlnFormatDocument.LookupSingleFontNode(XmlNode, path);
public string Lookup(string path) => vlnFormatDocument.Lookup(XmlNode, path);
public string Lookup(string path, ref string local) => local ?? (local = Lookup(path));
public int? IntLookup(string path) => vlnFormatDocument.IntLookup(XmlNode, path);
public int? IntLookup(string path, ref int? local) => local != null ? local : local = IntLookup(path);
public T EnumLookup<T>(string path) => vlnFormatDocument.EnumLookup<T>(XmlNode, path);
public bool LazyLoad(ref LazyLoad<bool> ll, string xPath)
{
if (ll == null)
{
@@ -358,12 +243,9 @@ namespace VEPROMS.CSLA.Library
}
return ll.Value;
}
protected static bool RetrieveBool(XmlNode xn)
{
return xn != null && xn.InnerText.ToUpper() == "TRUE";
}
// a LaxyLoad that allows you to pass in the default setting
public bool LazyLoad(ref LazyLoad<bool> ll, string xPath, bool defaultReturn)
protected static bool RetrieveBool(XmlNode xn) => xn != null && xn.InnerText.ToUpper() == "TRUE";
// a LazyLoad that allows you to pass in the default setting
public bool LazyLoad(ref LazyLoad<bool> ll, string xPath, bool defaultReturn)
{
if (ll == null)
{
@@ -372,12 +254,9 @@ namespace VEPROMS.CSLA.Library
}
return ll.Value;
}
// if nothing is set for this node, then use the passed in default value
protected static bool RetrieveBool(XmlNode xn, bool defaultReturn)
{
return (xn != null) ? xn.InnerText.ToUpper() == "TRUE" : defaultReturn;
}
public string LazyLoad(ref LazyLoad<string> ll, string xPath)
// if nothing is set for this node, then use the passed in default value
protected static bool RetrieveBool(XmlNode xn, bool defaultReturn) => (xn != null) ? xn.InnerText.ToUpper() == "TRUE" : defaultReturn;
public string LazyLoad(ref LazyLoad<string> ll, string xPath)
{
if (ll == null)
{
@@ -386,16 +265,13 @@ namespace VEPROMS.CSLA.Library
}
return ll.Value;
}
protected static string RetrieveString(XmlNode xn)
{
return xn != null ? xn.InnerText : null;
}
public string MyPath
protected static string RetrieveString(XmlNode xn) => xn?.InnerText;
public string MyPath
{
get
{
StringBuilder sb = new StringBuilder();
XmlNode node = _XmlNode;
XmlNode node = XmlNode;
string prefix = "";
while (node != null)
{
@@ -429,14 +305,13 @@ namespace VEPROMS.CSLA.Library
int? value = null;
if (xn != null)
{
int iValue = 0;
if (!int.TryParse(xn.InnerText, out iValue))
{
if (xn.InnerText == "") return null;
Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to int?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText));
throw (new Exception(string.Format("{0} = '{1}' could not be converted to int?", xPath, xn.InnerText)));
}
value = iValue;
if (!int.TryParse(xn.InnerText, out int iValue))
{
if (xn.InnerText == "") return null;
Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to int?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText));
throw new Exception(string.Format("{0} = '{1}' could not be converted to int?", xPath, xn.InnerText));
}
value = iValue;
}
return value;
}
@@ -445,13 +320,12 @@ namespace VEPROMS.CSLA.Library
float? value = null;
if (xn != null)
{
float fValue = 0;
if (!float.TryParse(xn.InnerText, out fValue))
{
Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to float?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText));
throw (new Exception(string.Format("{0} = '{1}' could not be converted to float?", xPath, xn.InnerText)));
}
value = fValue;
if (!float.TryParse(xn.InnerText, out float fValue))
{
Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to float?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText));
throw new Exception(string.Format("{0} = '{1}' could not be converted to float?", xPath, xn.InnerText));
}
value = fValue;
}
return value;
}
@@ -460,9 +334,8 @@ namespace VEPROMS.CSLA.Library
{
if (ll == null)
{
XmlNode xn = this._XmlNode;
xn = SelectSingleNode(xPath);
if (xn == null)
XmlNode xn = SelectSingleNode(xPath);
if (xn == null)
ll = new LazyLoad<T?>(null);
else if (xn.Value == "")// No value specified - Use zero value if it is defined - GetName returns a null if it is not defined
ll = new LazyLoad<Nullable<T>>(Enum.GetName(typeof(T), 0) != null ? (Nullable<T>) Enum.Parse(typeof(T), "0") : null);
@@ -497,17 +370,10 @@ namespace VEPROMS.CSLA.Library
#region LazyLoad
public class LazyLoad<T>
{
public LazyLoad(T value)
{
_Value = value;
}
private T _Value;
public T Value
{
get { return _Value; }
set { _Value = value; }
}
}
public LazyLoad(T value) => Value = value;
public T Value { get; set; }
}
#endregion
#region vlnFormatList, new()
public class vlnFormatList<T> : List<T>, ICustomTypeDescriptor
@@ -522,9 +388,11 @@ namespace VEPROMS.CSLA.Library
_XmlNodeList = value;
foreach (XmlNode xn in _XmlNodeList)
{
T tt = new T();
tt.XmlNode = xn;
Add(tt);
T tt = new T
{
XmlNode = xn
};
Add(tt);
}
}
}
@@ -546,7 +414,7 @@ namespace VEPROMS.CSLA.Library
XmlNode node = _XmlNodeList[0]; // Get the first node in a list
vlnFormatDocument doc = null;
if (node != null)
doc = (node.OwnerDocument) as vlnFormatDocument; // Get the owner document as a vlnFormatDocument
doc = node.OwnerDocument as vlnFormatDocument; // Get the owner document as a vlnFormatDocument
if (doc != null)
_MyFormat = doc.MyFormat; // Get the Format associated with the vlnFormatDocument
}
@@ -557,36 +425,24 @@ namespace VEPROMS.CSLA.Library
_MyFormat = value;
}
}
#region ICustomTypeDescriptor
public String GetClassName()
{ return TypeDescriptor.GetClassName(this, true); }
public AttributeCollection GetAttributes()
{ return TypeDescriptor.GetAttributes(this, true); }
public String GetComponentName()
{ return TypeDescriptor.GetComponentName(this, true); }
public TypeConverter GetConverter()
{ return TypeDescriptor.GetConverter(this, true); }
public EventDescriptor GetDefaultEvent()
{ return TypeDescriptor.GetDefaultEvent(this, true); }
public PropertyDescriptor GetDefaultProperty()
{ return TypeDescriptor.GetDefaultProperty(this, true); }
public object GetEditor(Type editorBaseType)
{ return TypeDescriptor.GetEditor(this, editorBaseType, true); }
public EventDescriptorCollection GetEvents(Attribute[] attributes)
{ return TypeDescriptor.GetEvents(this, attributes, true); }
public EventDescriptorCollection GetEvents()
{ return TypeDescriptor.GetEvents(this, true); }
public object GetPropertyOwner(PropertyDescriptor pd)
{ return this; }
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{ return GetProperties(); }
public virtual PropertyDescriptorCollection GetProperties()
#region ICustomTypeDescriptor
public string GetClassName() => TypeDescriptor.GetClassName(this, true);
public AttributeCollection GetAttributes() => TypeDescriptor.GetAttributes(this, true);
public string GetComponentName() => TypeDescriptor.GetComponentName(this, true);
public TypeConverter GetConverter() => TypeDescriptor.GetConverter(this, true);
public EventDescriptor GetDefaultEvent() => TypeDescriptor.GetDefaultEvent(this, true);
public PropertyDescriptor GetDefaultProperty() => TypeDescriptor.GetDefaultProperty(this, true);
public object GetEditor(Type editorBaseType) => TypeDescriptor.GetEditor(this, editorBaseType, true);
public EventDescriptorCollection GetEvents(Attribute[] attributes) => TypeDescriptor.GetEvents(this, attributes, true);
public EventDescriptorCollection GetEvents() => TypeDescriptor.GetEvents(this, true);
public object GetPropertyOwner(PropertyDescriptor pd) => this;
public PropertyDescriptorCollection GetProperties(Attribute[] attributes) => GetProperties();
public virtual PropertyDescriptorCollection GetProperties()
{
// Create a collection object to hold property descriptors
PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null);
// Iterate the list
int i = 0;
for (i = 0; i < this.Count; i++)
// Iterate the list
for (int i = 0; i < Count; i++)
{
// Create a property descriptor for the item and add to the property descriptor collection
pds.Add(new vlnPropertyDescriptor<vlnFormatList<T>, T>(this, i));
@@ -601,13 +457,10 @@ namespace VEPROMS.CSLA.Library
public class vlnIndexedFormatList<T> : vlnFormatList<T>, ICustomTypeDescriptor
where T : vlnFormatItem,IVlnIndexedFormatItem, new()
{
public vlnIndexedFormatList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList)
{
MyFormat = myFormat;
}
public vlnIndexedFormatList() : base() { }
public virtual vlnIndexedFormatList<T> InheritedList { get { return null; } }
public new T this[int index]
public vlnIndexedFormatList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList) => MyFormat = myFormat;
public vlnIndexedFormatList() : base() { }
public virtual vlnIndexedFormatList<T> InheritedList => null;
public new T this[int index]
{
get
{
@@ -620,8 +473,6 @@ namespace VEPROMS.CSLA.Library
if (ttlParent != null)
return ttlParent[index];
return null;
// None found - Can I find it in another format?
return null;
}
}
public int MaxIndex
@@ -657,36 +508,25 @@ namespace VEPROMS.CSLA.Library
return max;
}
}
#region ICustomTypeDescriptor
public String GetClassName()
{ return TypeDescriptor.GetClassName(this, true); }
public AttributeCollection GetAttributes()
{ return TypeDescriptor.GetAttributes(this, true); }
public String GetComponentName()
{ return TypeDescriptor.GetComponentName(this, true); }
public TypeConverter GetConverter()
{ return TypeDescriptor.GetConverter(this, true); }
public EventDescriptor GetDefaultEvent()
{ return TypeDescriptor.GetDefaultEvent(this, true); }
public PropertyDescriptor GetDefaultProperty()
{ return TypeDescriptor.GetDefaultProperty(this, true); }
public object GetEditor(Type editorBaseType)
{ return TypeDescriptor.GetEditor(this, editorBaseType, true); }
public EventDescriptorCollection GetEvents(Attribute[] attributes)
#region ICustomTypeDescriptor
public new string GetClassName() => TypeDescriptor.GetClassName(this, true);
public new AttributeCollection GetAttributes() => TypeDescriptor.GetAttributes(this, true);
public new string GetComponentName() => TypeDescriptor.GetComponentName(this, true);
public new TypeConverter GetConverter() => TypeDescriptor.GetConverter(this, true);
public new EventDescriptor GetDefaultEvent() => TypeDescriptor.GetDefaultEvent(this, true);
public new PropertyDescriptor GetDefaultProperty() => TypeDescriptor.GetDefaultProperty(this, true);
public new object GetEditor(Type editorBaseType) => TypeDescriptor.GetEditor(this, editorBaseType, true);
public new EventDescriptorCollection GetEvents(Attribute[] attributes)
{ return TypeDescriptor.GetEvents(this, attributes, true); }
public EventDescriptorCollection GetEvents()
{ return TypeDescriptor.GetEvents(this, true); }
public object GetPropertyOwner(PropertyDescriptor pd)
{ return this; }
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{ return GetProperties(); }
public virtual PropertyDescriptorCollection GetProperties()
public new EventDescriptorCollection GetEvents() => TypeDescriptor.GetEvents(this, true);
public new object GetPropertyOwner(PropertyDescriptor pd) => this;
public new PropertyDescriptorCollection GetProperties(Attribute[] attributes) => GetProperties();
public new virtual PropertyDescriptorCollection GetProperties()
{
// Create a collection object to hold property descriptors
PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null);
// Iterate the list
int i = 0;
for (i = 0; i < this.Count; i++)
for (int i = 0; i < Count; i++)
{
// Create a property descriptor for the item and add to the property descriptor collection
pds.Add(new vlnPropertyDescriptor<vlnFormatList<T>, T>(this, i));
@@ -701,14 +541,11 @@ namespace VEPROMS.CSLA.Library
public class vlnNamedFormatList<T> : vlnFormatList<T>, ICustomTypeDescriptor
where T : vlnFormatItem, IVlnNamedFormatItem, new()
{
public vlnNamedFormatList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat)
: base(xmlNodeList)
{
MyFormat = myFormat;
}
public vlnNamedFormatList() : base() { }
public virtual vlnNamedFormatList<T> InheritedList { get { return null; } }
public new T this[string name]
public vlnNamedFormatList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat)
: base(xmlNodeList) => MyFormat = myFormat;
public vlnNamedFormatList() : base() { }
public virtual vlnNamedFormatList<T> InheritedList => null;
public T this[string name]
{
get
{
@@ -721,8 +558,6 @@ namespace VEPROMS.CSLA.Library
if (ttlParent != null)
return ttlParent[name];
return null;
// None found - Can I find it in another format?
return null;
}
}
public new T this[int index]
@@ -735,47 +570,27 @@ namespace VEPROMS.CSLA.Library
if (ttlParent != null)
return ttlParent[index];
return null;
// None found - Can I find it in another format?
return null;
}
}
public new int Count
{
get
{
return base.Count;
}
}
#region ICustomTypeDescriptor
public String GetClassName()
{ return TypeDescriptor.GetClassName(this, true); }
public AttributeCollection GetAttributes()
{ return TypeDescriptor.GetAttributes(this, true); }
public String GetComponentName()
{ return TypeDescriptor.GetComponentName(this, true); }
public TypeConverter GetConverter()
{ return TypeDescriptor.GetConverter(this, true); }
public EventDescriptor GetDefaultEvent()
{ return TypeDescriptor.GetDefaultEvent(this, true); }
public PropertyDescriptor GetDefaultProperty()
{ return TypeDescriptor.GetDefaultProperty(this, true); }
public object GetEditor(Type editorBaseType)
{ return TypeDescriptor.GetEditor(this, editorBaseType, true); }
public EventDescriptorCollection GetEvents(Attribute[] attributes)
{ return TypeDescriptor.GetEvents(this, attributes, true); }
public EventDescriptorCollection GetEvents()
{ return TypeDescriptor.GetEvents(this, true); }
public object GetPropertyOwner(PropertyDescriptor pd)
{ return this; }
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{ return GetProperties(); }
public virtual PropertyDescriptorCollection GetProperties()
public new int Count => base.Count;
#region ICustomTypeDescriptor
public new string GetClassName() => TypeDescriptor.GetClassName(this, true);
public new AttributeCollection GetAttributes() => TypeDescriptor.GetAttributes(this, true);
public new string GetComponentName() => TypeDescriptor.GetComponentName(this, true);
public new TypeConverter GetConverter() => TypeDescriptor.GetConverter(this, true);
public new EventDescriptor GetDefaultEvent() => TypeDescriptor.GetDefaultEvent(this, true);
public new PropertyDescriptor GetDefaultProperty() => TypeDescriptor.GetDefaultProperty(this, true);
public new object GetEditor(Type editorBaseType) => TypeDescriptor.GetEditor(this, editorBaseType, true);
public new EventDescriptorCollection GetEvents(Attribute[] attributes) => TypeDescriptor.GetEvents(this, attributes, true);
public new EventDescriptorCollection GetEvents() => TypeDescriptor.GetEvents(this, true);
public new object GetPropertyOwner(PropertyDescriptor pd) => this;
public new PropertyDescriptorCollection GetProperties(Attribute[] attributes) => GetProperties();
public new virtual PropertyDescriptorCollection GetProperties()
{
// Create a collection object to hold property descriptors
PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null);
// Iterate the list
int i = 0;
for (i = 0; i < this.Count; i++)
for (int i = 0; i < Count; i++)
{
// Create a property descriptor for the item and add to the property descriptor collection
pds.Add(new vlnPropertyDescriptor<vlnFormatList<T>, T>(this, i));
@@ -793,16 +608,16 @@ namespace VEPROMS.CSLA.Library
{
private string Plural(string name)
{
if (name.EndsWith("y")) return name.Substring(0, name.Length - 1) + "ies";
if (name.EndsWith("ss")) return name + "es";
else return name + "s";
if (name.EndsWith("y")) return $"{name.Substring(0, name.Length - 1)}ies";
if (name.EndsWith("ss")) return $"{name}es";
else return $"{name}s";
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is T)
if (destType == typeof(string) && value is T vart)
{
// Return department and department role separated by comma.
return ((T)value).Count.ToString() + " " + (((T)value).Count == 1 ? typeof(C).Name : Plural(typeof(C).Name));
return $"{vart.Count} {(vart.Count == 1 ? typeof(C).Name : Plural(typeof(C).Name))}";
}
return base.ConvertTo(context, culture, value, destType);
}
@@ -815,17 +630,16 @@ namespace VEPROMS.CSLA.Library
{
private string Plural(string name)
{
if (name.EndsWith("y")) return name.Substring(0, name.Length - 1) + "ies";
if (name.EndsWith("ss")) return name + "es";
if (name.EndsWith("x")) return name + "es";
else return name + "s";
}
if (name.EndsWith("y")) return $"{name.Substring(0, name.Length - 1)}ies";
if (name.EndsWith("ss")) return $"{name}es";
return name.EndsWith("x") ? $"{name}es" : $"{name}s";
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is T)
if (destType == typeof(string) && value is T vart)
{
// Return department and department role separated by comma.
return ((T)value).MaxIndex.ToString() + " " + (((T)value).MaxIndex == 1 ? typeof(C).Name : Plural(typeof(C).Name));
return $"{vart.MaxIndex} {(vart.MaxIndex == 1 ? typeof(C).Name : Plural(typeof(C).Name))}";
}
return base.ConvertTo(context, culture, value, destType);
}
@@ -837,38 +651,23 @@ namespace VEPROMS.CSLA.Library
where C : vlnFormatItem, new()
{
protected C _Item = null;
public vlnPropertyDescriptor(T itemList, int index)
: base("#" + index.ToString(), null)
{
_Item = itemList[index];
}
public override bool CanResetValue(object component)
{ return true; }
public override Type ComponentType
{ get { return _Item.GetType(); } }
public override object GetValue(object component)
{ return _Item; }
public override bool IsReadOnly
{ get { return true; } }
public override Type PropertyType
{ get { return _Item.GetType(); } }
public override void ResetValue(object component)
public vlnPropertyDescriptor(T itemList, int index)
: base("#" + index.ToString(), null) => _Item = itemList[index];
public override bool CanResetValue(object component) => true;
public override Type ComponentType => _Item.GetType();
public override object GetValue(object component) => _Item;
public override bool IsReadOnly => true;
public override Type PropertyType => _Item.GetType();
public override void ResetValue(object component)
{ ;}
public override bool ShouldSerializeValue(object component)
{ return true; }
public override void SetValue(object component, object value)
public override bool ShouldSerializeValue(object component) => true;
public override void SetValue(object component, object value)
{ /*_Item = value*/;}
//public override AttributeCollection Attributes
//{ get { return new AttributeCollection(null); } }
public override string DisplayName
{ get { return _Item.GetPDDisplayName(); } }
public override string Description
{ get { return _Item.GetPDDescription(); } }
public override string Name
{ get { return _Item.GetPDName(); } }
public override string Category
{ get { return _Item.GetPDCategory(); } }
} // Class
public override string DisplayName => _Item.GetPDDisplayName();
public override string Description => _Item.GetPDDescription();
public override string Name => _Item.GetPDName();
public override string Category => _Item.GetPDCategory();
} // Class
#endregion
}
+27 -9
View File
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Text;
namespace Volian.Base.Library
{
@@ -148,16 +148,34 @@ namespace Volian.Base.Library
public static class BaselineMetaFile
{
private static DebugPrint _MyDebugPrint = new DebugPrint();
public static void Open(string fileName)
{ _MyDebugPrint.Open(fileName); }
private static DebugPrint _MyDebugPrint_Truncated = new DebugPrint();
public static void Open(string fileName)
{ _MyDebugPrint.Open(fileName);
_MyDebugPrint_Truncated.Open(fileName.Replace(".txt", "_Truncated.txt"));
}
public static void Close()
{ _MyDebugPrint.Close(); }
public static void Write(string format, params object[] args)
{ _MyDebugPrint.Write(format, args); }
{
_MyDebugPrint.Close();
_MyDebugPrint_Truncated.Close();
}
public static void WriteLine(string format, params object[] args)
{ _MyDebugPrint.WriteLine(format, args); }
public static void Show()
{ _MyDebugPrint.Show(); }
{
_MyDebugPrint_Truncated.WriteLine(format, args);
_MyDebugPrint.WriteLine(format, args);
}
public static void WriteLineTruncate(string format, params object[] args)
{
_MyDebugPrint_Truncated.WriteLine(format, args);
}
public static void WriteLineLegacy(string format, params object[] args)
{
_MyDebugPrint.WriteLine(format, args);
}
public static void Show()
{ _MyDebugPrint.Show();
_MyDebugPrint_Truncated.Show();
}
public static bool IsOpen
{ get { return _MyDebugPrint.IsOpen; } }
private static bool _IncludeWordSecText = true;
+2 -6
View File
@@ -1,12 +1,7 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Controls.Library;
using System.Reflection;
using LBWordLibrary;
using JR.Utils.GUI.Forms;
@@ -607,7 +602,8 @@ namespace Volian.Controls.Library
if (_In_DSOTabPanel_Enter) return;
//vlnStackTrace.ShowStack("DSOTabPanel_Enter {0} DocID {1} Index {2} {3}",_In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName);
_In_DSOTabPanel_Enter = true;
if (MyDisplayTabItem.MyItemInfo != null)
// B2026-074 only do this if we are not restoring save procedure tabs
if (MyDisplayTabItem.MyItemInfo != null && !_MyDisplayTabControl.LoadingSavedProcTabs)
_MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo));
_MyEdWord.Focus();
_In_DSOTabPanel_Enter = false;
+2 -3
View File
@@ -7,7 +7,6 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
@@ -622,7 +621,7 @@ namespace Volian.Controls.Library
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// changed to return true if the RO FST got updated
public bool LoadTree(bool forceReload = false)
public bool LoadTree(IWin32Window mainForm, bool forceReload = false)
{
bool updatedROs = false;
@@ -653,7 +652,7 @@ namespace Volian.Controls.Library
}
else if (changedDocVersion && !askedAboutchangedDocVersion && !ROWorkingDraftAsk.ContainsWorkingDraft(_docVersionInfo.VersionID))
{
if (MessageBox.Show($"There exists a newer ROFST for this RO database that was loaded for other sets.\r\n\r\nDo you want to update this set's ROs to be consistent/use the latest loaded ROFST?", "Load ROs", MessageBoxButtons.YesNo) == DialogResult.Yes)
if (MessageBox.Show(mainForm,$"There exists a newer ROFST for this RO database that was loaded for other sets.\r\n\r\nDo you want to update this set's ROs to be consistent/use the latest loaded ROFST?", "Load ROs", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
InitialProgressBarMessage = "Updating ROs";
+1 -1
View File
@@ -747,7 +747,7 @@ namespace Volian.Controls.Library
this.cbxFndUnLnkROVals.Margin = new System.Windows.Forms.Padding(2);
this.cbxFndUnLnkROVals.Name = "cbxFndUnLnkROVals";
this.cbxFndUnLnkROVals.Size = new System.Drawing.Size(176, 19);
this.superTooltip1.SetSuperTooltip(this.cbxFndUnLnkROVals, new DevComponents.DotNetBar.SuperTooltipInfo("Find Linked Values", "", "Finding unlinked values does the search for a specific RO.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(this.cbxFndUnLnkROVals, new DevComponents.DotNetBar.SuperTooltipInfo("Find Unlinked Values", "", "Finding unlinked values does the search for a specific RO.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.cbxFndUnLnkROVals.TabIndex = 2;
this.cbxFndUnLnkROVals.Text = "Find Unlinked Values of Selected RO";
//
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Controls.Library;
using DevComponents.DotNetBar;
using JR.Utils.GUI.Forms;
using Volian.Base.Library;
@@ -59,6 +56,9 @@ namespace Volian.Controls.Library
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
// B2026-074 added flag to use when restoring saved procedure tabs
public bool LoadingSavedProcTabs { get; set; } = false;
private static bool _SyncronizeEnahnced = false;
public static bool SyncronizeEnhanced
{
@@ -1282,6 +1282,7 @@ namespace Volian.Controls.Library
get { return _SyncEnhancedDocuments; }
set { _SyncEnhancedDocuments = value; }
}
public void HandleChangeId(ItemInfo myItemInfo, DisplayTabItem pg)
{
if (myItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds)
+11 -1
View File
@@ -1418,7 +1418,11 @@ namespace Volian.Print.Library
float yoff = 0;
if (_MyHelper.DidFirstPageDocStyle) yoff = origYoff - (float)mySection.MyDocStyle.Layout.TopMargin;
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);
Volian.Base.Library.BaselineMetaFile.WriteLineLegacy("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber, "truncate_false");
Volian.Base.Library.BaselineMetaFile.WriteLineTruncate("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, Truncate(locEndOfWordDoc, 2), Truncate(pdfSize, 2), (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);
AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0) + yoff);
// B2019-102 Handle PDF Destinations for Word Sections
if (ii == 0 && _MyHelper.MyPromsPrinter.SaveLinks)
@@ -1533,6 +1537,12 @@ namespace Volian.Print.Library
}
ProfileTimer.Pop(profileDepth);
}
public static float Truncate(float value, int digits)
{
double mult = Math.Pow(10.0, digits);
double result = Math.Truncate(mult * value) / mult;
return (float)result;
}
// B2019-152: AddMergedLandscapePage adds entries to the dictionary that keeps track of what pages in a pdf are landscape
// so that if merge is done, the pages that are landscaped can have landscaped page numbers placed on them
public static void AddMergedLandscapePage(VlnSvgPageHelper _MyHelper, string PDFFile)