B2022-083: Support Conditional RO Values

This commit is contained in:
Jake 2022-07-26 20:01:25 +00:00
parent 439cf9de7a
commit d327ab08af
16 changed files with 2670 additions and 1743 deletions

View File

@ -198,7 +198,8 @@ namespace LBWordLibrary
}
public String Text
{
get { return (GetProperty("Text").ToString()); }
//B2022-083: Support Conditional RO Values
get { return Convert.ToString(GetProperty("Text")); }
set { SetProperty("Text", value); }
}
public LBWdSelectionType Type

View File

@ -197,11 +197,13 @@ namespace VEPROMS
{
OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure);
pi.MyDocVersion.DocVersionConfig.SelectedSlave = _MyDocVersion.DocVersionConfig.SelectedSlave;
if (clbMore.Items.Contains(pi.DisplayNumber))
{
if (!dpl.Contains(pi.DisplayNumber)) dpl.Add(pi.DisplayNumber); //C2020-036 add to duplicate proc number list
continue;
}
// B2018-083: check for null MySessionInfo.
if (oi != null && MySessionInfo != null && oi.SessionID != MySessionInfo.SessionID)
{
@ -210,17 +212,22 @@ namespace VEPROMS
}
else
clbMore.Items.Add(pi.DisplayNumber);
tmpProcedures.Add(pi.DisplayNumber, pi);
}
}
}
if (dpl.Count > 0) return false; // C2018-025 cannot load list of procedure - duplicate proc numbers
for (int i = 0; i < clbMore.Items.Count; i++)
{
ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[i].ToString());
clbMore.SetItemChecked(i, _MyApproval.ProcedureExists(pi));
}
lblMore.Text = string.Format("{0} Procedures, {1} Selected", clbMore.Items.Count, clbMore.CheckedItems.Count);
return true;
}
@ -247,20 +254,23 @@ namespace VEPROMS
setupLablesAndSwitches(); // C2018-008 redesign of user interface
SetupMyApproval();
}
private Dictionary<string, ProcedureInfo> tmpProcedures = new Dictionary<string, ProcedureInfo>();
private ProcedureInfo GetProcedureInfoByKey(string key)
{
private ProcedureInfo GetProcedureInfoByKey(string key)
{
if (key.Contains(" Checked out to "))
key = key.Substring(0, key.IndexOf(" Checked out to "));
// B2019-048: after running consistency check - inconsistency text was added to string in dialog. Remove that text
// if in key so that it can be used to find procedure in procedure list (was crashing):
if (key.Contains(" - ("))
key = key.Substring(0, key.LastIndexOf(" - ("));
if (tmpProcedures.ContainsKey(key))
return tmpProcedures[key];
else
return tmpProcedures[GetDisplayNumberOnly(key)];
}
return tmpProcedures[key];
else
return tmpProcedures[GetDisplayNumberOnly(key)];
}
public dlgApproveProcedure(DocVersionInfo myDocVersion, bool selectSome, frmVEPROMS myFrmVEPROMS) // approve some procedures
{
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
@ -280,7 +290,8 @@ namespace VEPROMS
InitializePanelSelect();
_initializing = false;
}
public dlgApproveProcedure(ProcedureInfo myProcedure, frmVEPROMS myFrmVEPROMS) // approve sigle (selected from tree view)
public dlgApproveProcedure(ProcedureInfo myProcedure, frmVEPROMS myFrmVEPROMS) // approve single (selected from tree view)
{
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
_MyApproval = new ApprovalInfo(myFrmVEPROMS);// Save frmVEPROMS for Import to shutoff SessionPing
@ -332,6 +343,7 @@ namespace VEPROMS
approvalProcedureBindingSource.ResetBindings(false);
//this.ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
}
private string GetMaxRevNumber()
{
string mrn = string.Empty;
@ -343,6 +355,7 @@ namespace VEPROMS
}
return mrn;
}
void dlgApproveProcedure_ConsistencyPrintRequest(object sender, ConsistencyReportArgs args)
{
foreach (ProcedureInfo pi in args.MyItems)
@ -350,6 +363,7 @@ namespace VEPROMS
PDFConsistencyCheckReport rpt = new PDFConsistencyCheckReport(args.ReportName, args.MyItems, args.MyDocVersion); //B2020-020 needed to pass in DocVersion to get paper size from format
rpt.BuildReport();
}
private void SetupComboBoxes()
{
RevTypes rt = new RevTypes();
@ -362,6 +376,7 @@ namespace VEPROMS
revTypeBindingSource.DataSource = rt;
stageInfoBindingSource.DataSource = StageInfoList.Get();
}
private void btnApprove_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
@ -369,6 +384,7 @@ namespace VEPROMS
this.DialogResult = DialogResult.None;
this.Cursor = Cursors.Default;
}
// C2018-008 redesign of user interface
// -- Note that the Revison Type data source is still connected (revTypeBindingSource) - commented out for documentatin purposes
//private void cmbRevisionType_SelectedIndexChanged(object sender, EventArgs e)
@ -376,11 +392,13 @@ namespace VEPROMS
// RevType rt = cmbRevisionType2.SelectedItem as RevType;
// _MyApproval.RevType = rt.TypeID;
//}
private void cmbRevisionStage_SelectedIndexChanged(object sender, EventArgs e)
{
StageInfo si = cmbRevisionStage2.SelectedItem as StageInfo;
_MyApproval.RevStage = si.StageID;
}
private void clbMore_ItemCheck(object sender, ItemCheckEventArgs e)
{
ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[e.Index].ToString());
@ -397,6 +415,7 @@ namespace VEPROMS
btnCheckMore.Enabled = true;
}
}
private void UpdateMyApproval()
{
SetupComboBoxes();
@ -419,10 +438,12 @@ namespace VEPROMS
SetupMyApproval();
RefreshCount(); // B2021-015: select/clear all not populating left panel & count not refreshed.
}
private void btnCheck_Click(object sender, EventArgs e)
{
UpdateClbMore();
}
private ItemInfoList _MyItemInfoList;
private void UpdateClbMore()
{
@ -510,18 +531,21 @@ namespace VEPROMS
}
Application.DoEvents();
}
private void btnAll_Click(object sender, EventArgs e)
{
for (int i = 0; i < clbMore.Items.Count; i++)
clbMore.SetItemChecked(i, true);
UpdateMyApproval(); // B2021-015: select/clear all not populating left panel & count not refreshed.
}
private void btnClear_Click(object sender, EventArgs e)
{
for (int i = 0; i < clbMore.Items.Count; i++)
clbMore.SetItemChecked(i, false);
UpdateMyApproval(); // B2021-015: select/clear all not populating left panel & count not refreshed.
}
private int _LastIndex = -1;
private void clbMore_MouseMove(object sender, MouseEventArgs e)
{
@ -563,6 +587,7 @@ namespace VEPROMS
s = s.Substring(0, d); //B2018-109 remvoed the call ".Trim()". had a procedure that began with a space and was being used as such everywhere else in the approveal logic
return s;
}
private bool _DoingConsistencyCheck = false; // C2018-008 redesign of user interface
private void btnCheckMore_Click(object sender, EventArgs e)
{
@ -574,6 +599,7 @@ namespace VEPROMS
btnCheckMore.Enabled = false;
}
private void btnReportMore_Click(object sender, EventArgs e)
{
OnConsistencyPrintRequest(new ConsistencyReportArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MyConsistency.pdf", _MyItemInfoList, _MyDocVersion)); //B2020-020 needed to pass in DocVersion to get paper size from format

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,7 @@ namespace VEPROMS.CSLA.Library
}
}
}
public partial class DVEnhancedDocument
{
private string _Name;
@ -114,6 +115,7 @@ namespace VEPROMS.CSLA.Library
return string.Format("{0}.ItemID={1}", Name,VersionID);
}
}
[Serializable]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class DocVersionConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
@ -123,6 +125,7 @@ namespace VEPROMS.CSLA.Library
{
_MyEnhancedDocuments = null;
}
public void RemoveEnhancedLink(int dvid)
{
// from this config, remove the link to the input dvid (DocVersionId:
@ -130,6 +133,7 @@ namespace VEPROMS.CSLA.Library
if (xnx == null) return; // B2020-069: check for null reference before accessing xnx.
xnx.ParentNode.RemoveChild(xnx);
}
private DVEnhancedDocuments _MyEnhancedDocuments = null;
public DVEnhancedDocuments MyEnhancedDocuments
{
@ -143,15 +147,16 @@ namespace VEPROMS.CSLA.Library
}
set { _MyEnhancedDocuments = value; }
}
public void SaveDVEnhancedDocuments()
{
// get all of the current enhanced links from datastructure in code. This list may have been
// get all of the current enhanced links from data structure in code. This list may have been
// modified by adding items during code execution by associating source <--> background etc.
DVEnhancedDocuments edsToAdd = new DVEnhancedDocuments();
foreach (DVEnhancedDocument ed in MyEnhancedDocuments)
edsToAdd.Add(ed);
// from the existing list in xml, remove any that are in the 'editted (edsToAdd) list
// from the existing list in xml, remove any that are in the 'edited (edsToAdd) list
// so that what remains are those that need added to xml that will then be written to database
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
{
@ -192,12 +197,14 @@ namespace VEPROMS.CSLA.Library
xa.Value = edadd.PdfToken;
}
}
#region DynamicTypeDescriptor
internal override bool IsReadOnly
{
get { return _DocVersion == null; }
}
#endregion
#region XML
private XMLProperties _Xp;
private XMLProperties Xp
@ -205,6 +212,7 @@ namespace VEPROMS.CSLA.Library
get { return _Xp; }
}
#endregion
#region Constructors
//PROPGRID: Hide ParentLookup
[Browsable(false)]
@ -230,6 +238,7 @@ namespace VEPROMS.CSLA.Library
_Xp = new XMLProperties(xml);
if (docVersion.MyDocVersionInfo.MyFolder != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);
}
private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args)
{
if (args.AncestorLookup || ParentLookup)
@ -242,6 +251,7 @@ namespace VEPROMS.CSLA.Library
}
return string.Empty;
}
//private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args)
//{
// if (args.AncestorLookup || ParentLookup)
@ -282,6 +292,7 @@ namespace VEPROMS.CSLA.Library
_Xp[group, item] = newvalue;
}
#endregion
#region Local Properties
[Category("General")]
[DisplayName("Name")]
@ -360,6 +371,7 @@ namespace VEPROMS.CSLA.Library
set { _SaveChangesToDocVersionConfig = value; }
}
#endregion
#region ToString
public override string ToString()
{
@ -368,6 +380,7 @@ namespace VEPROMS.CSLA.Library
return s;
}
#endregion
//<Config><RODefaults Setpoint="SP1" Graphics="IG1" ROPATH="g:\ops\vehlp\ro" /><PrintSettings ChangeBar="3" ChangeBarLoc="1" ChangeBarText="3" numcopies="1" Watermark="1" userformat=" " disableduplex="False" /><format plant="OHLP" /></Config>
#region RODefaults // From proc.ini
@ -446,6 +459,7 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
#region PrintSettingsCategory // From curset.dat
[Category("Print Settings")]
//PROPGRID: Hide Printer
@ -1466,6 +1480,7 @@ namespace VEPROMS.CSLA.Library
}
#endregion
#endregion
#region Unit // From PROC.INI
//MultiUnitCount
[Category("Unit")]
@ -1479,6 +1494,8 @@ namespace VEPROMS.CSLA.Library
return _Xp.XmlContents.SelectNodes("//Slave").Count;
}
}
private int _SelectedSlave = 0;
//[Browsable(false)]
public int SelectedSlave
@ -1560,8 +1577,10 @@ namespace VEPROMS.CSLA.Library
get
{
string s = GetCombinedSlaveValue("Name") ?? _Xp["Unit", "Name"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Name"];
return s;
}
set
@ -1570,9 +1589,11 @@ namespace VEPROMS.CSLA.Library
_Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Name"] = value; // save selected value
else
_Xp["Unit", "Name"] = value;
OnPropertyChanged("Unit_Name");
}
}
[Category("Unit")]
[DisplayName("Other Unit Name")]
[RefreshProperties(RefreshProperties.All)]
@ -2369,4 +2390,4 @@ OnPropertyChanged("Default_BkColor");
}
#endregion
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -317,6 +317,7 @@ namespace VEPROMS.CSLA.Library
AssociationConfig ac = new AssociationConfig(associationInfo);
return ac.ROUpdate_LoadingFigures;
}
#region SearchPaths
public string _SearchDVPath;
public string SearchDVPath
@ -330,6 +331,7 @@ namespace VEPROMS.CSLA.Library
}
public string SearchPath { get { return ""; } }
#endregion
#region UnlinkEnhancedDocVersion
// Unlink (clear) enhanced from source for this docversion. Refresh all related cache items.
public void DoUnlinkEnhancedDocVersion()
@ -371,6 +373,7 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion UnlinkEnhanced
#region DocVersion Config
[NonSerialized]
private DocVersionConfig _DocVersionConfig;
@ -381,7 +384,9 @@ namespace VEPROMS.CSLA.Library
_DocVersionConfig = null;
}
#endregion
#region MOVE TO DOCVERSION CONFIG
private string GetProfile(string grp, string nam)
{
return GetProfile(grp, nam, false);
@ -409,20 +414,25 @@ namespace VEPROMS.CSLA.Library
public string UnitSpecific(string str, int len, ItemInfo ii)
{
ProcedureInfo pi = ii as ProcedureInfo;
if (pi == null) // B2022-004: Don't crash if Proc PC/PC (ii is from a list, so wasn't an ItemInfo)
{
pi = ProcedureInfo.Get(ii.ItemID);
}
if (pi == null) return "";
string unitdes = "ID";
string prefix = null;
string fromunitdes = null;
str = ItemInfo.ConvertToDisplayText(pi.MyContent.Number);
bool hastoken = false;
// Determine if there is a token in the procedure number data, default is ID
if (str.ToUpper().Contains(@"<U"))
{
hastoken = true;
if (str.ToUpper().IndexOf(@"<U-") > -1)
{
try
@ -438,6 +448,7 @@ namespace VEPROMS.CSLA.Library
}
}
}
if (unitdes == "NUMBER")
fromunitdes = DocVersionConfig.Unit_Number;
else if (unitdes == "ID")
@ -468,8 +479,7 @@ namespace VEPROMS.CSLA.Library
string[] units = mstr.Split(",".ToCharArray());
string[] fromdata = fromunitdes.Split(",".ToCharArray());
// SelectedSlave is > 0 if a unit has been selected, for example from print or approve. It represents that index into
// the list of units.
// SelectedSlave is > 0 if a unit has been selected, for example from print or approve. It represents that index into the list of units.
if (DocVersionConfig.SelectedSlave > 0)
{
prefix = units[0].Replace("#", "");
@ -482,12 +492,13 @@ namespace VEPROMS.CSLA.Library
// 1) [] (square brackets) are placed around any prefixes determined from the <U> token or the Procedure Number data on
// the working draft properties. If None, i.e. no units, are applicable, as selected from the Step Properties/Applicability tab.
// there will be no text between the brackets to represent no applicability
// 2) , (commas) are used as a delimeter. Only have 1 comma separating the prefix, there may be no text if some units are
// 2) , (commas) are used as a delimiter. Only have 1 comma separating the prefix, there may be no text if some units are
// not applicable, but code exists here so that ',,,' does not appear in the treenode
// 3) don't duplicate resolved text, for example if NUMBER is used, and prefix text would be '[A,A,B,C,C]', only show '[A,B,C]'
bool sometext = false; // flag to use since don't want ',,,,,' before number
List<string> prefs = new List<string>();
for (int i = 1; i <= UnitNames.Length; i++)
{
bool procAppl = pi.ApplInclude(i);
@ -502,10 +513,13 @@ namespace VEPROMS.CSLA.Library
}
if (procAppl && tokRepAndPrefix != "") prefix = prefix + (prefix == null ? tokRepAndPrefix : (prefix != null && prefix.Length > 0 && prefix[prefix.Length - 1] != ',' ? "," : "") + tokRepAndPrefix);
}
str = Regex.Replace(str, @"\<[uU]-[a-zA-Z]+\>", "");
str = Regex.Replace(str, @"\<[uU]\>", "");
return (!sometext) ? str: "[" + prefix + "]" + str;
}
public string UnitSpecific(string str, int len)
{
@ -536,11 +550,6 @@ namespace VEPROMS.CSLA.Library
retvalu = str;
else if (pnum[0] == '!')
{
// look for mstr in SET.INI
// GetPrivateProfileString("replace", mstr, mstr, tonum, 24, "set.ini");
// TODO: NOT SURE IF SET.INI AND PROC.INI HAVE UNIQUE GROUP NAMES!!!!!!!
//mstr = GetProfile("Replace", mstr);
mstr = GetProfile("Replace", mstr, true); // true allow it to return a null if not found
if (mstr == null) retvalu = str; // no replacement, use procedure number as is
}
@ -580,20 +589,19 @@ namespace VEPROMS.CSLA.Library
public string Evaluate(string str, int len)
{
string retval = null;
string swhir = "PSU"; /* order inwhich to check */
string swhir = "PSU"; /* order in which to check */
string pn;
if (str.Length > 1 && str[1] == '-')
{
int swptr = swhir.IndexOf((str.ToUpper())[0]);
//char swchar = '';
//if (swptr != -1)
// swchar = swhir[swptr];
string sav = str.Substring(len);
str = str.Substring(0, len);
string substr = str.Substring(2);
substr = substr.Replace(" ", "");
while (swptr >= 0 && swptr < swhir.Length && retval == null) //retval.Equals(string.Empty))
while (swptr >= 0 && swptr < swhir.Length && retval == null)
{
switch (swhir[swptr])
{
@ -607,10 +615,6 @@ namespace VEPROMS.CSLA.Library
retval = this.DocVersionConfig.Unit_Number;
if (substr.ToLower() == "text")
retval = this.DocVersionConfig.Unit_Text;
//retval = this.DocVersionConfig.Other_Unit_ID;
//retval = this.DocVersionConfig.Other_Unit_Name;
//retval = this.DocVersionConfig.Other_Unit_Number;
//retval = this.DocVersionConfig.Other_Unit_Text;
break;
case 'S':
//retval = GetProfile("Procedure_Set", substr, true);
@ -639,60 +643,54 @@ namespace VEPROMS.CSLA.Library
{
retval = this.DocVersionConfig.Unit_ID;
}
// if the return value is empty, then the resulting
// evaluation should repeat the token string including
// the braces. - the beginning brace is not passed in.
//if (retval.Equals(string.Empty))
//{
// retval = (char*)mallocq(len + 3);
// strncpy(retval, str - 1, len + 2);
//}
if (retval == null)
retval = string.Format("<{0}>", str.Substring(0, len));
return retval;
}
public string ProcessDocVersionSpecificInfo(string rawvalue)
{
string str = rawvalue;
string rtnstr = "";
string rtnstr = string.Empty;
int l = rawvalue.Length;
while (l > 0)
{
int ptr = str.IndexOf('<'); //nextDelimiter("<", str, l);
int cptr = (ptr == -1) ? -1 : str.IndexOf('>'); //nextDelimiter(">", ptr, strlen(ptr));
int ptr = str.IndexOf('<');
int cptr = (ptr == -1) ? -1 : str.IndexOf('>');
// jsj 2/5/10 added "|| (ptr > cptr)" to fix bug where rawvalue = "Insert token for ->Step<- to transition back to."
if (ptr == -1 || (ptr > -1 && ((cptr == -1) || (ptr > cptr))))
{
//add(new seText(str, l));
//str += l;
rtnstr += str;
l = 0; // jump out of while loop
}
else
{
int cnt = ptr;
if (cnt > 0)
{
//add(new seText(str, cnt));
rtnstr += str.Substring(0, cnt);
l -= cnt;
str = str.Substring(ptr);
}
ptr = str.IndexOf('>') + 1; //nextDelimiter(">", str, l) + 1;
cnt = ptr; //(int)(ptr - str);
//add(new seUser(str + 1, cnt - 2));
ptr = str.IndexOf('>') + 1;
cnt = ptr;
rtnstr += Evaluate(str.Substring(1, cnt - 2), cnt - 2);
l -= cnt;
str = str.Substring(ptr); //ptr;
str = str.Substring(ptr);
}
}
return rtnstr;
}
#endregion
ItemInfoList _Procedures = null;

File diff suppressed because it is too large Load Diff

View File

@ -1232,6 +1232,10 @@ namespace VEPROMS.CSLA.Library
return (MyPrevious == null);
}
}
public bool IsAutoTOCSection
{
get
@ -2615,6 +2619,7 @@ namespace VEPROMS.CSLA.Library
}
}
}
RefreshFields(enhii); // B2021-042: Crash on link/unlink/link - refresh cache
}
catch (Exception ex)
@ -2672,6 +2677,7 @@ namespace VEPROMS.CSLA.Library
return dtext;
}
}
internal int _SearchAnnotationID;
public int SearchAnnotationID
{

View File

@ -6,6 +6,7 @@ using System.Data.SqlClient;
using Csla;
using Csla.Data;
using Csla.Validation;
using System.Diagnostics;
namespace VEPROMS.CSLA.Library
{
@ -117,12 +118,15 @@ namespace VEPROMS.CSLA.Library
public static PdfInfo Get(ItemInfo sect, bool ovrride)
{
int count = 0;
while (count < 2)
{
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
PdfInfo myPdf = null;
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
if (sc != null && sc.Section_WordMargin == "Y")
{
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0);
@ -132,15 +136,19 @@ namespace VEPROMS.CSLA.Library
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth);
}
// ovrride forces the the printing of the word seciton, which creates a word file with resolved ROs, which is saved for an approved export
if (!ovrride || (ovrride && count ==1))
// override forces the printing of the word section, which creates a word file with resolved ROs, which is saved for an approved export
if (!ovrride || (ovrride && count == 1))
{
if (myPdf != null) return myPdf;
if (count > 0) return null; // Could not find or create a pdf
}
MSWordToPDF.SetDocPdf(sect.MyContent.MyEntry.MyDocument, sect);
count++;
}
return null;
}
}

View File

@ -321,7 +321,7 @@ namespace VEPROMS.CSLA.Library
if (tmp == null)
{
tmp = DataPortal.Fetch<PdfInfo>(new PKCriteria(docID, debugStatus, topRow, pageLength, leftMargin, pageWidth));
AddToCache(tmp);
if (tmp.DocID > 0) AddToCache(tmp);
}
if (tmp.ErrorMessage == "No Record Found")
{

View File

@ -65,7 +65,7 @@ namespace Volian.Base.Library
{
try
{
// delete any docs. If it fails, just go on to the next one becase
// delete any docs. If it fails, just go on to the next one because
// it may be open from another process.
if(fi.LastWriteTimeUtc < DateTime.Now.AddDays(-2.0))
fi.Delete();
@ -86,7 +86,7 @@ namespace Volian.Base.Library
{
try
{
// delete any docs. If it fails, just go on to the next one becase
// delete any docs. If it fails, just go on to the next one because
// it may be open from another process.
fi.Delete();
}

View File

@ -81,7 +81,7 @@ namespace Volian.Controls.Library
public bool RoTreeNeedsReloaded
{
get { return (MyROFST != null && _currRofstID != null && MyROFST.ROFstID != (int)_currRofstID) || (MyDvi != null && _currDocVersionID != null && MyDvi.VersionID != (int)_currDocVersionID) ; }
get { return (MyROFST != null && _currRofstID != null && MyROFST.ROFstID != (int)_currRofstID) || (MyDvi != null && _currDocVersionID != null && MyDvi.VersionID != (int)_currDocVersionID); }
}
public ROFstInfo MyROFST
@ -110,7 +110,7 @@ namespace Volian.Controls.Library
if (!_isInitializedRofstID && IsRofstValid)
{
_currRofstID = (IsRofstValid) ? (int?)_myROFST.RODbID : null;
_currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
}
}
}
@ -142,15 +142,7 @@ namespace Volian.Controls.Library
public E_ROValueType ROTypeFilter
{
get { return _roTypeFilter; }
set
{
_roTypeFilter = value;
//if (!Visible) return; // don't reset anything if the form is invisible.
//_roTypeFilter = value;
// LoadTree();
}
set {_roTypeFilter = value; }
}
public RoUsageInfo CurROLink
@ -188,13 +180,6 @@ namespace Volian.Controls.Library
get { return _myRTB; }
set
{
//if (_myRTB != null)
//{
// MyRTB.LinkChanged -= new StepRTBLinkEvent(MyRTB_LinkChanged);
// MyRTB.SelectionChanged -= new EventHandler(MyRTB_SelectionChanged);
//}
if (value == null)
{
_myRTB = value;
@ -318,11 +303,6 @@ namespace Volian.Controls.Library
_searchTimer.Stop();
_searchTimer.Start();
//if (!string.IsNullOrEmpty(MyRTB.SelectedText))
//{
// _searchTimer.Start();
//}
_timeActivity.Close();
}
@ -373,25 +353,24 @@ namespace Volian.Controls.Library
if (chld.value != null)
{
RoUsageInfo SavROLink = null;
if (_savCurROLink != null) SavROLink = _savCurROLink;
lbROId.Text = chld.appid;
// Allow the user to select a different return value.
string childroid = string.Format("{0}{1}", chld.roid.ToLower(), "0000").Substring(0, 16);
string childroid = ROFSTLookup.FormatRoidKey(chld.roid, true);
//B2017-245 Disable SaveRO button for Procedures and Sections
//B2020-049: Save button not enabled on Word docs, only if a procedure was opened first and immediately after the word document
// section is opened (added 'IsInWorDoc')
btnSaveRO.Enabled = (IsInWordDoc || (!IsNotStep && !IsEnhancedStep)) && UserInfo.CanEdit(MyUserInfo, MyDvi) && ((_savCurROLink == null) || !(childroid.Equals(SavROLink.ROID.ToLower()))); //added security check (UserInfo.CanEdit)
btnCancelRO.Enabled = (_savCurROLink != null && childroid != SavROLink.ROID.ToLower());
btnSaveRO.Enabled = (IsInWordDoc || (!IsNotStep && !IsEnhancedStep)) && UserInfo.CanEdit(MyUserInfo, MyDvi) && ((SavROLink == null) || !(childroid.Equals(SavROLink.ROID.ToUpper()))); //added security check (UserInfo.CanEdit)
btnCancelRO.Enabled = (_savCurROLink != null && (SavROLink != null && childroid != SavROLink.ROID.ToUpper()));
btnGoToRO.Enabled = UserInfo.CanEditROs(MyUserInfo, MyDvi); // Writers and Reviewers cannot edit ROs (run the RO Editor)
switch (chld.type)
{
case 1: // standard (regular) text RO type
string roval = chld.value.Replace(@"\u160?", " ");
roval = GetPCDefaultValue(roval); // C2021-026 get the default RO value from P/C RO value information
tbROValue.Text = roval;
tbROValue.Text = chld.value;
btnPreviewRO.Enabled = false;
if (chld.roid.StartsWith("FFFF")) btnGoToRO.Enabled = false;
break;
@ -530,7 +509,7 @@ namespace Volian.Controls.Library
ROFSTLookup.rochild roch = (ROFSTLookup.rochild)obj;
_selectedRoidBeforeRoEditor = roch.roid;
string args = "\"" + MyROFST.MyRODb.FolderPath + "\" " + roch.roid.ToLower();
string args = "\"" + MyROFST.MyRODb.FolderPath + "\" " + roch.roid.Substring(0,12).ToLower();
// C2017-003: ro data in sql server, check for sql connection string
if (MyROFST.MyRODb.DBConnectionString != "cstring") args = args + " \"" + MyROFST.MyRODb.DBConnectionString + "\"";
@ -574,8 +553,6 @@ namespace Volian.Controls.Library
{
if (MyROFST == null)
{
//_curROFST = null;
//_curROFSTLookup = null;
tvROFST.Nodes.Clear();
lbFound.Visible = false;
return;
@ -599,6 +576,7 @@ namespace Volian.Controls.Library
_currRofstID = (int?)MyROFST.ROFstID;
_currDocVersionID = null;
if(_docVersionInfo != null) _currDocVersionID = (int?)_docVersionInfo.VersionID;
}
@ -610,30 +588,39 @@ namespace Volian.Controls.Library
if (unitInfoNode == null)
{
TreeNode tnn = tvROFST.Nodes.Add("Unit Information");
TreeNode cn = null;
ROFSTLookup.rochild roc = MyROFSTLookup.GetRoChild("FFFF00000001");
cn = tnn.Nodes.Add(roc.title);
cn.Tag = roc;
TreeNode cn = tnn.Nodes.Add("Number");
cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000001");
roc = MyROFSTLookup.GetRoChild("FFFF00000002");
cn = tnn.Nodes.Add(roc.title);
cn.Tag = roc;
cn = tnn.Nodes.Add("Other Number");
cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000002");
roc = MyROFSTLookup.GetRoChild("FFFF00000003");
cn = tnn.Nodes.Add(roc.title);
cn.Tag = roc;
cn = tnn.Nodes.Add("Text");
cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000003");
roc = MyROFSTLookup.GetRoChild("FFFF00000004");
cn = tnn.Nodes.Add(roc.title);
cn.Tag = roc;
cn = tnn.Nodes.Add("Other Text");
cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000004");
roc = MyROFSTLookup.GetRoChild("FFFF00000005");
cn = tnn.Nodes.Add(roc.title);
cn.Tag = roc;
cn = tnn.Nodes.Add("ID");
cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000005");
roc = MyROFSTLookup.GetRoChild("FFFF00000006");
cn = tnn.Nodes.Add(roc.title);
cn.Tag = roc;
cn = tnn.Nodes.Add("Other ID");
cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000006");
roc = MyROFSTLookup.GetRoChild("FFFF00000007");
cn = tnn.Nodes.Add(roc.title);
cn.Tag = roc;
cn = tnn.Nodes.Add("Name");
cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000007");
cn = tnn.Nodes.Add("Other Name");
cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000008");
roc = MyROFSTLookup.GetRoChild("FFFF00000008");
cn = tnn.Nodes.Add(roc.title);
cn.Tag = roc;
}
}
else if (unitInfoNode != null) // Add Unit Information Database if it doesn't exist [Not Multi-Unit DocVersion]
@ -644,61 +631,6 @@ namespace Volian.Controls.Library
_curROTypeFilter = _roTypeFilter;
//if (MyROFST != _curROFST || MyROFSTLookup != _curROFSTLookup || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0)
//{
// ROFSTLookup.rodbi[] dbs = MyROFSTLookup.GetRODatabaseList(true);
// for (int i = 0; i < dbs.Length; i++)
// {
// ROFSTLookup.rodbi db = dbs[i];
// TreeNode tn = new TreeNode(db.dbiTitle);
// tn.Tag = db;
// tvROFST.Nodes.Add(tn);
// AddDummyGroup(db, tn);
// }
//}
//var unitInfoNode = tvROFST.Nodes.Cast<TreeNode>().Where(x => x.Text == "Unit Information").FirstOrDefault();
//if ((ROTypeFilter == E_ROValueType.Text || ROTypeFilter == E_ROValueType.All) && this.MyDvi != null && this.MyDvi.MultiUnitCount > 1)
//{
// // Add Unit Information Database if it doesn't exist
// if (unitInfoNode == null)
// {
// TreeNode tnn = tvROFST.Nodes.Add("Unit Information");
// TreeNode cn = tnn.Nodes.Add("Number");
// cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000001");
// cn = tnn.Nodes.Add("Other Number");
// cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000002");
// cn = tnn.Nodes.Add("Text");
// cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000003");
// cn = tnn.Nodes.Add("Other Text");
// cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000004");
// cn = tnn.Nodes.Add("ID");
// cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000005");
// cn = tnn.Nodes.Add("Other ID");
// cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000006");
// cn = tnn.Nodes.Add("Name");
// cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000007");
// cn = tnn.Nodes.Add("Other Name");
// cn.Tag = MyROFSTLookup.GetRoChild("FFFF00000008");
// }
//}
//else if (unitInfoNode != null) // Add Unit Information Database if it doesn't exist [Not Multi-Unit DocVersion]
//{
// tvROFST.Nodes.Remove(unitInfoNode);
//}
//_curROFST = _myROFST;
//_curROFSTLookup = _myROFSTLookup;
//_curROTypeFilter = _roTypeFilter;
@ -732,7 +664,7 @@ namespace Volian.Controls.Library
#endregion
#region Private Methods?
#region Private Methods
private void LoadChildren(TreeNode tn)
{
@ -760,15 +692,11 @@ namespace Volian.Controls.Library
// if children, add dummy node
if (children != null && children.Length > 0)
{
//ProgressBar_Initialize(children.Length, tn.Text);
for (int i = 0; i < children.Length; i++)
{
//ProgressBar_SetValue(i);
TreeNode tmp = null;
ROFSTLookup.rochild roc = children[i];
// if this is a group, i.e. type 0, add a dummy node
if (roc.type == 0 && !MyROFSTLookup.HasChildren(ref roc))
{
@ -778,10 +706,20 @@ namespace Volian.Controls.Library
{
continue; // Ignore: Filter Doesn't Match
}
else if (roc.value == null)
else if (!string.IsNullOrEmpty(roc.appid))
{
MyROFSTLookup.LoadChildren(ref roc);
if (roc.children.Length == 1 && roc.children.First().roid.Length == 16)
{
roc.appid = roc.children.First().appid;
roc.roid = roc.children.First().roid;
roc.value = roc.children.First().value;
}
}
if (roc.value == null)
{
tmp = new TreeNode(roc.title);
tmp.Tag = roc;
@ -793,9 +731,7 @@ namespace Volian.Controls.Library
}
else
{
string ntitle = roc.title.Replace(@"\u160?", " ");
ntitle = GetPCDefaultValue(ntitle); // C2021-026 get the default RO value from P/C RO value information
tmp = new TreeNode(ntitle);
tmp = new TreeNode(roc.title);
tmp.Tag = roc;
if (roc.roid.Length == 16)
@ -810,8 +746,6 @@ namespace Volian.Controls.Library
}
}
}
//ProgressBar_Clear();
}
private void AddDummyGroup(ROFSTLookup.rodbi rodbi, TreeNode tn)
@ -825,17 +759,20 @@ namespace Volian.Controls.Library
private void ExpandNode(string roid)
{
// Clean-up Roid if necessary
roid = ROFSTLookup.FormatRoidKey(roid);
bool multValSel = (roid.Length == 16) ? true : false;
string db = roid.Substring(0, 4);
int dbiID = MyROFSTLookup.GetRODatabaseTitleIndex(roid);
bool multValSel = (roid.Length == 16) ? true : false;
ROFSTLookup.rochild rochld = MyROFSTLookup.GetRoChild(roid.Substring(0, 12).ToUpper());
// use this to walk up tree until database - this is used to expand tree.
List<int> path = new List<int>();
int myid = rochld.ID;
while (myid > 0)
while (myid >= 0)
{
path.Insert(0, myid);
myid = rochld.ParentID;
@ -849,7 +786,13 @@ namespace Volian.Controls.Library
//Find Database Node First
TreeNode dbNode = tvROFST.Nodes.Cast<TreeNode>().Where(x => (x.Tag is ROFSTLookup.rodbi) && ((ROFSTLookup.rodbi)x.Tag).dbiID == dbiID).FirstOrDefault();
TreeNode dbNode = null;
if (roid.StartsWith("FFFF"))
dbNode = tvROFST.Nodes.Cast<TreeNode>().Where(x => (x.Tag.Equals(null)) && (x.Text.Equals("Unit Information"))).FirstOrDefault();
else
dbNode = tvROFST.Nodes.Cast<TreeNode>().Where(x => (x.Tag is ROFSTLookup.rodbi) && ((ROFSTLookup.rodbi)x.Tag).dbiID == dbiID).FirstOrDefault();
if (dbNode != null)
{
LoadChildren(dbNode);
@ -891,30 +834,6 @@ namespace Volian.Controls.Library
tvROFST.SelectedNode = tnExpand;
}
private string GetPCDefaultValue(string roval)
{
// C2021-026 Get the Parent (Default) RO value if the return value include P/C information
// otherwise return the RO value as is.
// This is used for the insert RO interface on the Step Properties panel
string rntval = roval;
while (rntval.Contains("<APL DefaultVal=")) // C2021-026 remove Parent/Child values for the menu item text
{
int startCVIdx = rntval.IndexOf("<APL DefaultVal=");
int EndCVidx = rntval.IndexOf(" /APL>", startCVIdx);
string aplicValues = rntval.Substring(startCVIdx, EndCVidx + 6 - startCVIdx);
int endDefIdx = rntval.IndexOf(",", startCVIdx);
// C2022-001 - handle if there is no child value in the RO FSt
// B2022-051 - was sometimes leaving "/APL>" when processing return value made up from multiple RO (editor) fields
// added check to make where next found comma was within the current <APL ... /APL>
string defValue = rntval.Substring(startCVIdx + 16, ((endDefIdx > 0 && endDefIdx < EndCVidx) ? endDefIdx : EndCVidx) - (startCVIdx + 16));
rntval = rntval.Replace(aplicValues, defValue);
}
return rntval;
}
private int FindIndex(TreeNodeCollection nodes, string value)
{
int index = 0;
@ -947,47 +866,22 @@ namespace Volian.Controls.Library
if (dti.MyDSOTabPanel != null) // A Word Document tab is the active tab
{
string AccPageID = string.Empty;
if (roc.roid.StartsWith("FFFF"))
{
AccPageID = "<" + roc.appid + ">";
}
else
{
int dbiID = MyROFSTLookup.GetRODatabaseTitleIndex(roc.roid);
ROFSTLookup.rodbi db = MyROFSTLookup.GetRODatabase(roc.roid, true, false);
if (db.dbiID == dbiID)
{
string accPrefix = db.dbiAP.Replace(MyDvi.DocVersionConfig.RODefaults_graphicsprefix, "IG");
accPrefix = accPrefix.Replace(MyDvi.DocVersionConfig.RODefaults_setpointprefix, "SP");
string suffix = (roc.roid.Length == 12 || roc.roid.Substring(12, 4) == "0041") ? string.Empty : "." + ((char)Convert.ToInt32(roc.roid.Substring(12, 4), 16)).ToString();
AccPageID = string.Format("<{0}-{1}{2}>", accPrefix, roc.appid, suffix);// makes <SP1-A.1.B> for example
}
else
{
FlexibleMessageBox.Show("Error occurred finding RO. Contact Volian");
return;
}
}
string accPageID = string.Format("<{0}>", roc.appid);
// Insert the RO text at the current cursor position in the word document
// NOTE: assuming any type of RO can be put in an Accessory (MSWord) Document
if (dti.MyDSOTabPanel != null)
{
dti.MyDSOTabPanel.InsertText(AccPageID);
dti.MyDSOTabPanel.InsertText(accPageID);
}
}
else if (MyRTB != null) // a Procedure Steps section tab is active
{
if (CheckROSelection(roc)) // check for RO type is valid for this type of step/substep
{
// the roid may be 12 or 16 chars long, with the last 4 set if there is unit specific
// menuing. Pad to 12 to store in the rousage table.
string padroid = (roc.roid.Length <= 12) ? roc.roid + "0000" : roc.roid;
// the roid may be 12 or 16 chars long, with the last 4 set if there is unit specific value
// Pad to 16 to store in the RoUsage table.
string padroid = ROFSTLookup.FormatRoidKey(roc.roid, true);
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", padroid, MyROFST.RODbID);
// Resolve symbols and scientific notation in the RO return value
@ -1133,7 +1027,7 @@ namespace Volian.Controls.Library
{
if (MyROFST != null && searchValue.Length >= 2)
{
dicRoVals = MyROFSTLookup.Search(searchValue, searchTypeID, MaxNumSearchRecords);
dicRoVals = MyROFSTLookup.Search(searchValue, searchTypeID, false, MaxNumSearchRecords);
}
if (dicRoVals != null && dicRoVals.Count > 0)

View File

@ -715,13 +715,16 @@ namespace Volian.Controls.Library
get { return _MyLinkText; }
set
{
//if (value != _MyLinkText)
//{
// updates to the info panel were not always occurring when the previous two
// lines were active
if (value != _MyLinkText)
{
//updates to the info panel were not always occurring when the previous two lines were active
_MyLinkText = value;
OnLinkChanged(this, new StepPanelLinkEventArgs(_MyLinkText));
//}
}
else
{
_MyLinkText = value;
}
}
}
#endregion
@ -1768,11 +1771,20 @@ namespace Volian.Controls.Library
DebugPrint("RS------ SelectionChange > {0}", FindRangeStatus());
if (SelectionLength > 0 && IsSelectionLinked(SelectionStart, SelectionLength))
{
if (SelectedText.IndexOf(@"[END>") > 0) MyLinkText = SelectedText.Substring(0, SelectedText.IndexOf(@"[END>"));
else MyLinkText = SelectedText;
if (SelectedText.IndexOf(@"[END>") > 0)
{
MyLinkText = SelectedText.Substring(0, SelectedText.IndexOf(@"[END>"));
}
else
{
MyLinkText = SelectedText;
}
}
else
{
MyLinkText = null;
}
OnRTBSelectionChanged(this, new EventArgs());
_LastWasLeftArrow = false;
}

View File

@ -423,7 +423,8 @@ namespace Volian.Controls.Library
//}
#endregion
string accPageID = GetAccPageID(data);
ROFSTLookup.rochild? roc = MyLookup.GetRoChildByAccPagID(accPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
ROFSTLookup.rochild? roc = MyLookup.GetROChildByAccPageID(accPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
if (roc != null)
{
int index = GetROValueIndex(data);
@ -449,7 +450,7 @@ namespace Volian.Controls.Library
for (int i = 1; i < 4; i++)
{
tmpAccPageID = accPageID + suffix + i.ToString();
roc = MyLookup.GetRoChildByAccPagID(tmpAccPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
roc = MyLookup.GetROChildByAccPageID(tmpAccPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
if (roc != null)
{
int index = GetROValueIndex(data);
@ -460,12 +461,13 @@ namespace Volian.Controls.Library
}
}
}
//try LO1,2,3
suffix = "-LO";
for (int i = 1; i < 4; i++)
{
tmpAccPageID = accPageID + suffix + i.ToString();
roc = MyLookup.GetRoChildByAccPagID(tmpAccPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
roc = MyLookup.GetROChildByAccPageID(tmpAccPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
if (roc != null)
{
int index = GetROValueIndex(data);
@ -481,6 +483,7 @@ namespace Volian.Controls.Library
}
return rv;
}
private string GetAccPageID(string txt)
{
//<MEL FWS-MP-02B \\n \\H>
@ -491,11 +494,14 @@ namespace Volian.Controls.Library
txt = txt.Replace("<ARP ", "ARP-");
int i = txt.IndexOf(" ");
txt = txt.Substring(0, i);
return txt;
}
private int GetROValueIndex(string data)
{
int rv = -1;
if (data.StartsWith("<ARP"))
{
// arp children = \n alarm, \s value, \t type, \d description
@ -510,7 +516,7 @@ namespace Volian.Controls.Library
else
rv = -1;
}
if (data.StartsWith("<MEL"))
else if (data.StartsWith("<MEL"))
{
//mel children = \n name, \d description, \r room
if (data.IndexOf(@"\n") > 0)
@ -522,7 +528,7 @@ namespace Volian.Controls.Library
else
rv = -1;
}
if (data.StartsWith("<STP"))
else if (data.StartsWith("<STP"))
{
//stp children = \v value, \d description, \n id
if (data.IndexOf(@"\v") > 0)
@ -534,8 +540,10 @@ namespace Volian.Controls.Library
else
rv = -1;
}
return rv;
}
private void SaveRO_Click(object sender, EventArgs e)
{
DevComponents.DotNetBar.BaseItem btn = sender as DevComponents.DotNetBar.BaseItem;
@ -1252,10 +1260,12 @@ namespace Volian.Controls.Library
_MyLog.WarnFormat("Equation Editor executable could not be found.");
return retval;
}
private static string GetVisio() // Added support for Visio
{
string retval = _SpecifiedVisioPath; // use the Visio path specified by the user
if (retval != null && retval != "")
if (!string.IsNullOrEmpty(retval))
{
if (!retval.ToUpper().EndsWith(".EXE"))
retval += (retval.EndsWith("\\")) ? "visio.exe" : "\\visio.exe";
@ -1265,7 +1275,8 @@ namespace Volian.Controls.Library
retval = null; // look in the registry
}
}
if (retval == null || retval == "")
if (!string.IsNullOrEmpty(retval))
{
try
{
@ -1279,7 +1290,8 @@ namespace Volian.Controls.Library
_MyLog.WarnFormat("Visio was not found in the registry.");
}
}
return retval;
return retval;
}
private static string _EqnEdtPath = null;
public static string EqnEdtPath

View File

@ -14,7 +14,7 @@ namespace Volian.Print.Library
public class PDFReport
{
#region Enums
public enum ReportType
{
SearchResults = 0,
@ -28,7 +28,7 @@ namespace Volian.Print.Library
#endregion
#region Fields
private PdfWriter _MyPdfWriter;
private ICollection<ItemInfo> _ResultList;
@ -57,31 +57,31 @@ namespace Volian.Print.Library
#endregion
#region Properties
public ICollection<ItemInfo> ResultList
{
get { return _ResultList; }
set { _ResultList = value; }
}
public string FileName
{
get { return _FileName; }
set { _FileName = value; }
}
public string ReportTitle
{
get { return _ReportTitle; }
set { _ReportTitle = value; }
}
public string TypesSelected
{
get { return _TypesSelected; }
set { _TypesSelected = value; }
}
public bool ShowAnnotations
{
get { return _ShowAnnotations; }
@ -249,7 +249,7 @@ namespace Volian.Print.Library
#endregion
#region Public Methods
public void AddMainRODatabaseTitle(PdfPTable datatable, int dbTitleIndex, Font f2, Color bgColor)
{
string dbTitle = _ROFSTLookup.GetRODatabaseTitle(dbTitleIndex);
@ -403,7 +403,7 @@ namespace Volian.Print.Library
bool foundMisMatch = false;
// n-1 Exclude the "Working Draft" entry from the list
int n = NewPath.Length-1;
int n = NewPath.Length - 1;
int jstart = (skipFirst) ? 1 : 0;
if (StripLast)
@ -427,7 +427,7 @@ namespace Volian.Print.Library
if (!string.IsNullOrEmpty(NewPath[j]) && (foundMisMatch || OldPath.Length < j + 1 || NewPath[j] != OldPath[j]))
{
// B2020-006: Add hard space '\u160?'
sb.Append(sep + "".PadLeft(2 * level) + NewPath[j].Replace("\x11", " ")).Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace(@"\u9586?",@"\");
sb.Append(sep + "".PadLeft(2 * level) + NewPath[j].Replace("\x11", " ")).Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace(@"\u9586?", @"\");
sep = "\r\n";
foundMisMatch = true;
}
@ -592,7 +592,7 @@ namespace Volian.Print.Library
level = NewPath.Length - 1;
}
}
return level;
}
@ -603,7 +603,7 @@ namespace Volian.Print.Library
/// </summary>
/// <param name="document"></param>
/// <returns></returns>
private bool CreateResultsPDF(iTextSharp.text.Document document,int typ)
private bool CreateResultsPDF(iTextSharp.text.Document document, int typ)
{
int topMargin = 36;
@ -670,18 +670,18 @@ namespace Volian.Print.Library
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light cyan
datatable.AddCell(cell);
// C2019-013 add sorted by information if sorting is used
cell = new PdfPCell(new Phrase(TypesSelected + ((SortedBy.Length >0)?string.Format("\n{0}",SortedBy):string.Empty), f3));
cell = new PdfPCell(new Phrase(TypesSelected + ((SortedBy.Length > 0) ? string.Format("\n{0}", SortedBy) : string.Empty), f3));
cell.HorizontalAlignment = Element.ALIGN_LEFT;
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light cyan
datatable.AddCell(cell);
@ -737,15 +737,15 @@ namespace Volian.Print.Library
{
lastSectNumAndTitle = string.Empty; // C2020-019 reset we are processing a different procedure
}
lastProcNum = curProcNum;
// B2020-006: When doing a section, don't remove the last item or the procedure title won't print (if section is only item found w/ search string)
string stepPath = AddGroup(subTable, item.SearchPath ?? item.ShortPath, lastPath, f2, item.IsSection ? false : true, new Color(0xC0, 0xFF, 0xC0), true); // light green for procedure number and title
// C2020-019 add section number and title if is different from last item and it is not a Word Section (item will be a section if search item was found in a Word section)
string curSectNumTitle = GetCurSectionNumTitle(item);
if (curSectNumTitle != string.Empty && curSectNumTitle != lastSectNumAndTitle && !item.IsSection)
{
AddColSpanCell(subTable, curSectNumTitle, f2, StepSectColor, 2, 0);
@ -820,7 +820,7 @@ namespace Volian.Print.Library
}
}
if (str.Length > 0)
if (str.Length > 0)
p.Add(new Phrase(str, fnt));
return p;
@ -857,18 +857,18 @@ namespace Volian.Print.Library
{
// Adjusted from 20,80 to 25,75 to account for long Procedure Numbers
float[] headerwidths = { 25, 75 };
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
BuildLibDocProcSetList();
int splitAt = FindSpitLevel()-1; // find the split level of the common path - for all procedure sets that use these library documents
int splitAt = FindSpitLevel() - 1; // find the split level of the common path - for all procedure sets that use these library documents
string lastDvPath = string.Empty;
Color AnnoBackgroundColor = new Color(0xFF, 0xFF, 0xC0);
Color TextBackgroundColor = Color.WHITE;
Color NotUsedBackgroundColor = Color.WHITE;
MyPageHelper pghlp = _MyPdfWriter.PageEvent as MyPageHelper;
pghlp.HeaderTable = LibDocTable(document, headerwidths, f2,null);
pghlp.HeaderTable = LibDocTable(document, headerwidths, f2, null);
foreach (DocumentInfo di in _LibDocList)
{
@ -926,16 +926,16 @@ namespace Volian.Print.Library
private PdfPTable LibDocTable(iTextSharp.text.Document document, float[] headerwidths, iTextSharp.text.Font f2, DocumentInfo di)
{
PdfPTable datatable = new PdfPTable(1);// (headerwidths);
PdfPTable colheader = new PdfPTable(headerwidths);
PdfPTable colheader = new PdfPTable(headerwidths);
datatable.HeaderRows = 2;
datatable.KeepTogether = false;
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
//cell.Colspan = 2;
@ -977,9 +977,9 @@ namespace Volian.Print.Library
private void PutROusageForProcedure(PdfPTable curTable, Dictionary<string, List<ItemInfo>> rosused, float[] headerwidths)
{
//if (rosused.Count == 0) return; // nothing to process
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
foreach (string roKey in rosused.Keys)
{
@ -1006,7 +1006,7 @@ namespace Volian.Print.Library
{
ROTitleCell.BackgroundColor = new Color(0xDC, 0xE7, 0xC9); //new Color(0xD0, 0xF0, 0xD0);//ligt green //new Color(0xC8, 0xC8, 0x91);//(0xAF, 0xD8, 0xD8);//(0xF5, 0xE4, 0xA0);
}
rotable.AddCell(ROTitleCell); // put RO value and description
}
}
@ -1042,11 +1042,11 @@ namespace Volian.Print.Library
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
//cell.Colspan = 2;
@ -1134,7 +1134,7 @@ namespace Volian.Print.Library
{
string dictKey = GetCurProcNum(item.SearchPath) + " " + GetCurSectionNumTitle(item);
if (dictKey != null && dictKey != string.Empty)
if (!string.IsNullOrEmpty(dictKey))
{
if (procRoUse.ContainsKey(dictKey))
{
@ -1151,9 +1151,9 @@ namespace Volian.Print.Library
private void PutStepListForProcedure(PdfPTable rotable, SortedDictionary<string, ItemInfo> sortedStepList)
{
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
foreach (ItemInfo itm in sortedStepList.Values)
{
@ -1165,11 +1165,11 @@ namespace Volian.Print.Library
sortedStepList.Clear();
}
private void PutROusageForROID(PdfPTable curTable, SortedDictionary<string, List<ItemInfo>> procRoUse, float[] headerwidths, int splitAt , bool moreThanOneProcSet)
private void PutROusageForROID(PdfPTable curTable, SortedDictionary<string, List<ItemInfo>> procRoUse, float[] headerwidths, int splitAt, bool moreThanOneProcSet)
{
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
SortedDictionary<string, ItemInfo> sortedStepList = new SortedDictionary<string, ItemInfo>();
string lastProcKey = string.Empty;
@ -1249,14 +1249,15 @@ namespace Volian.Print.Library
{
string rotitle = string.Empty;
ROFSTLookup myrofstlookup = (itm == null)? _ROFSTLookup : itm.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(itm.MyDocVersion);
List<string> roTitleList = myrofstlookup.GetROTitleAndGroupPath(roid,_IncludeMissingROs,_ConvertCaretToDelta);
ROFSTLookup myrofstlookup = (itm == null) ? _ROFSTLookup : itm.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(itm.MyDocVersion);
List<string> roTitleList = myrofstlookup.GetROTitleAndGroupPath(roid, _IncludeMissingROs, _ConvertCaretToDelta);
if (roTitleList != null && roTitleList.Count > 0)
{
for (int cnt = 0; cnt < roTitleList.Count; cnt++)
{
if (cnt == roTitleList.Count - 1)
if (cnt == roTitleList.Count - 1) // Last roTitle in list, don't add a NewLine character after the value
rotitle += roTitleList[cnt];
else
rotitle += roTitleList[cnt] + "\n ";
@ -1269,15 +1270,15 @@ namespace Volian.Print.Library
private void AddROHeaderGroup(PdfPTable datatable, string curROID, ItemInfo itm, Font f2, Color bgColor)
{
string headerText = GetROTitleAndGroup(curROID, itm);
if (headerText != null && headerText.Length > 0)
if (!string.IsNullOrEmpty(headerText) && headerText.Length > 0)
{
PdfPCell cell = new PdfPCell(new Phrase(headerText, f2));
cell.Colspan = 2;
if (headerText.StartsWith("Missing RO"))
cell.BackgroundColor = Color.PINK;
else
cell.BackgroundColor = bgColor;
cell.BackgroundColor = (headerText.StartsWith("Missing RO")) ? Color.PINK : bgColor;
cell.BorderWidthTop = 1;
datatable.AddCell(cell);
}
}
@ -1285,6 +1286,7 @@ namespace Volian.Print.Library
private void BuildROUsageTableByRO(iTextSharp.text.Document document)
{
SortedDictionary<string, List<ItemInfo>> procRoUse = new SortedDictionary<string, List<ItemInfo>>();
float[] headerwidths = { 20, 80 };
PdfPTable datatable = new PdfPTable(1);
PdfPTable colHeader = new PdfPTable(headerwidths);
@ -1292,11 +1294,11 @@ namespace Volian.Print.Library
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light blue
@ -1360,9 +1362,9 @@ namespace Volian.Print.Library
// Check for different ROID
string curROID = item.FoundROID;
differentRO = lastROID != string.Empty && curROID.Substring(0, 12) != lastROID.Substring(0, 12);
differentRO = (!string.IsNullOrEmpty(lastROID) && !string.IsNullOrEmpty(curROID) && curROID.Substring(0, 12) != lastROID.Substring(0, 12));
if (procRoUse.Count > 0 && (differentProcSet || differentRO))
if (procRoUse.Count > 0 && (differentProcSet || differentRO))
{
if (!moreThanOneProcSet && !printedSetTitle)
{
@ -1450,55 +1452,68 @@ namespace Volian.Print.Library
private void BuildCompleteROReport(iTextSharp.text.Document document)
{
CompleteROReport compRORpt = new CompleteROReport(_MyPdfWriter, document,_RODataFile, _ConvertCaretToDelta, _IncludeEmptyROFields);
CompleteROReport compRORpt = new CompleteROReport(_MyPdfWriter, document, _RODataFile, _ConvertCaretToDelta, _IncludeEmptyROFields);
compRORpt.F10 = pdf.GetFont("Courier New", 10, 0, Color.BLACK);
compRORpt.F10Bold = pdf.GetFont("Courier New", 10, 1, Color.BLACK);
compRORpt.F12 = pdf.GetFont("Courier New", 12, 0, Color.BLACK);
compRORpt.F12Bold = pdf.GetFont("Courier New", 12, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
compRORpt.F14 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
compRORpt.ROFstID = _ROFSTLookup.MyDocVersionInfo.DocVersionAssociations[0].MyROFst.ROFstID;
// C2017-036 Get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
compRORpt.F14 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
//B2022 - 083: Support Conditional RO Values
compRORpt.ROFstID = _ROFSTLookup.RofstID;
compRORpt.Run();
}
private string GetROTitleAndGroupsForSummary(List<string>roTitleList, List<string> prevROTitleList)
private string GetROTitleAndGroupsForSummary(List<string> roTitleList, List<string> prevROTitleList)
{
string rotitle = string.Empty;
string indent = string.Empty;
for (int icnt = 0; icnt < roTitleList.Count; icnt++)
for (int icnt = 0; icnt < roTitleList.Count; icnt++)
{
indent += " ";
if (icnt == roTitleList.Count - 1)
{
indent += " ";
if (icnt == roTitleList.Count - 1)
{
rotitle += indent + roTitleList[icnt]; // this should be the ro description
break; //break out of for loop
}
if (prevROTitleList == null || (icnt < roTitleList.Count && icnt < prevROTitleList.Count && prevROTitleList[icnt] != roTitleList[icnt]))
{
if (rotitle == string.Empty && prevROTitleList != null)
rotitle = "\n";
rotitle += indent + roTitleList[icnt] + "\n";
}
rotitle += indent + roTitleList[icnt]; // this should be the ro description
break; //break out of for loop
}
if (prevROTitleList == null || (icnt < roTitleList.Count && icnt < prevROTitleList.Count && prevROTitleList[icnt] != roTitleList[icnt]))
{
if (rotitle == string.Empty && prevROTitleList != null)
rotitle = "\n";
rotitle += indent + roTitleList[icnt] + "\n";
}
}
return rotitle;
}
private List<string> AddROHeaderGroupForSummary(PdfPTable datatable, string curROID,List<string> prevROTitleList, Font f2, Color bgColor)
private List<string> AddROHeaderGroupForSummary(PdfPTable datatable, string curROID, List<string> prevROTitleList, Font f2, Color bgColor)
{
List<string> roTitleList = _ROFSTLookup.GetROTitleAndGroupPath(curROID,_IncludeMissingROs,_ConvertCaretToDelta);
List<string> roTitleList = _ROFSTLookup.GetROTitleAndGroupPath(curROID, _IncludeMissingROs, _ConvertCaretToDelta);
string headerText = GetROTitleAndGroupsForSummary(roTitleList, prevROTitleList);
if (headerText.Length > 0)
{
Paragraph pgh = new Paragraph(headerText, f2);
PdfPCell cell = new PdfPCell(pgh);
cell.FollowingIndent = 72;
cell.Colspan = 2;
cell.BorderColor = Color.WHITE;
cell.BackgroundColor = Color.WHITE;
cell.BorderWidthTop = 1;
datatable.AddCell(cell);
}
return roTitleList;
}
@ -1509,11 +1524,11 @@ namespace Volian.Print.Library
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 1, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
@ -1527,22 +1542,22 @@ namespace Volian.Print.Library
cell = new PdfPCell(new Phrase(roFSTDateTime, f2));
cell.BorderColor = Color.WHITE;
datatable.AddCell(cell);
datatable.HeaderRows = 2;//3 + (ProcSetList.Count == 1 ? 1 : 0);
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
string lastROID = string.Empty;
List<string> prevROTitleList = null;
List<string> prevROTitleList = null;
int lastDBindex = -1;
foreach (string curROID in _ROList)
{
string[] tmp = curROID.TrimEnd(',').Split(':'); //curROID.Split(':');// this is the RO FST id number (for plants with multiple RO FSTs)
string rolst = (tmp.Length == 2)? tmp[1] : tmp[0];
string rolst = (tmp.Length == 2) ? tmp[1] : tmp[0];
string[] roIdslst = rolst.Split(',');
foreach (string cROID in roIdslst)
{
if (string.IsNullOrEmpty(cROID))
if (string.IsNullOrEmpty(cROID))
break;
if (cROID.Length == 4)
@ -1579,7 +1594,7 @@ namespace Volian.Print.Library
}
}
private void ProcessROChild(PdfPTable datatable, iTextSharp.text.Font f2, iTextSharp.text.Font f3, ref PdfPCell cell, ref string lastROID, ref List<string> prevROTitleList, ref int lastDBindex,ROFSTLookup.rochild cld)
private void ProcessROChild(PdfPTable datatable, iTextSharp.text.Font f2, iTextSharp.text.Font f3, ref PdfPCell cell, ref string lastROID, ref List<string> prevROTitleList, ref int lastDBindex, ROFSTLookup.rochild cld)
{
if (cld.children == null || cld.children.Length <= 0) // leaf node
{
@ -1625,7 +1640,7 @@ namespace Volian.Print.Library
#endregion
#region Private Static Methods
private static PdfPTable BuildSubTable(iTextSharp.text.Document document, float[] headerwidths)
{
PdfPTable subtable = new PdfPTable(headerwidths);
@ -1874,7 +1889,7 @@ namespace Volian.Print.Library
public class MyPageHelper : PdfPageEventHelper
{
#region Fields
private PdfPTable _HeaderTable = null;
protected PdfTemplate total;
protected BaseFont helv;
@ -1884,7 +1899,7 @@ namespace Volian.Print.Library
#endregion
#region Properties
public PdfPTable HeaderTable
{
get { return _HeaderTable; }
@ -1894,7 +1909,7 @@ namespace Volian.Print.Library
#endregion
#region Constructors
public MyPageHelper(string byLine)
{
_ByLine = byLine;
@ -1903,7 +1918,7 @@ namespace Volian.Print.Library
#endregion
#region Public Methods
public override void OnOpenDocument(PdfWriter writer, iTextSharp.text.Document document)
{
total = writer.DirectContent.CreateTemplate(100, 100);
@ -1918,20 +1933,20 @@ namespace Volian.Print.Library
cb.SaveState();
if (HeaderTable != null)
HeaderTable.WriteSelectedRows(0, 2, 36, document.Top+44, cb);
HeaderTable.WriteSelectedRows(0, 2, 36, document.Top + 44, cb);
String text = "Page " + writer.PageNumber + " of ";
float textBase = document.Bottom - 19;//20;
cb.BeginText();
cb.SetFontAndSize(helv, ptSize);
float posCenter = document.Left + ((document.Right - document.Left) / 2) - (helv.GetWidthPoint(text+"XX", ptSize) / 2);
float posCenter = document.Left + ((document.Right - document.Left) / 2) - (helv.GetWidthPoint(text + "XX", ptSize) / 2);
cb.SetTextMatrix(posCenter, textBase);
cb.ShowText(text);
cb.EndText();
cb.AddTemplate(total, posCenter + helv.GetWidthPoint(text, ptSize), textBase);
cb.RestoreState();
AddVolianFooter(writer,document);
AddVolianFooter(writer, document);
AddDateFooter(writer, document);
}
@ -1949,7 +1964,7 @@ namespace Volian.Print.Library
#endregion
#region Private Methods
private void AddVolianFooter(PdfWriter writer, iTextSharp.text.Document document)
{
PdfContentByte cb = writer.DirectContent;

View File

@ -436,7 +436,7 @@ i = 0;
// a tabbing line - BGE wasn't using this in data at time of development. The following code may
// need expanded to support the tabbing/column definitions if this is found in data.
float lyoff = yOff - 4;
plist = plist.Replace("\r", "");
plist = plist.Replace("\r", string.Empty);
string[] lines = plist.Split("\n".ToCharArray());
DocStyle docstyle = MySection.MyDocStyle;
try
@ -444,7 +444,7 @@ i = 0;
foreach (string clinex in lines)
{
string cline = clinex.TrimEnd();
if (cline != "")
if (cline != string.Empty)
{
// xoff handles the columns. The separator between phone items is a double space. A phone
// item may have a single space within it (this comes from 16bit implementation)
@ -721,7 +721,7 @@ i = 0;
{
PdfDestination dest =pb.PdfDestination;
if(dest==null) dest = new PdfDestination(PdfDestination.FIT);
PdfOutline pdo = new PdfOutline(MyPdfOutlines[lev-1], dest,Regex.Replace(pb.Title, @"\\{Prerequisite Step: .*?\\}", ""), false);
PdfOutline pdo = new PdfOutline(MyPdfOutlines[lev-1], dest,Regex.Replace(pb.Title, @"\\{Prerequisite Step: .*?\\}", string.Empty), false);
if (MyPdfOutlines.Count == lev)
MyPdfOutlines.Add(pdo);
else
@ -861,7 +861,7 @@ i = 0;
set
{
_MySection = value;
MySectionTitle = ((_MySection.DisplayNumber ?? "")=="" ? "" : _MySection.DisplayNumber + " - ") + _MySection.DisplayText;
MySectionTitle = ((_MySection.DisplayNumber ?? string.Empty)==string.Empty ? string.Empty : _MySection.DisplayNumber + " - ") + _MySection.DisplayText;
bool forceLoadSvg = false;
if (value.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && value.MyDocStyle.ResetFirstPageOnSection)
DidFirstPageDocStyle = false;
@ -1185,7 +1185,7 @@ i = 0;
key = key + "." + MySection.ItemID;
break;
case E_NumberingSequence.WithinEachSectionNumber:
key = key + "." + ( MySection.DisplayNumber == "" ? (MySection.ActiveParent as ItemInfo).DisplayNumber : MySection.DisplayNumber);
key = key + "." + ( MySection.DisplayNumber == string.Empty ? (MySection.ActiveParent as ItemInfo).DisplayNumber : MySection.DisplayNumber);
break;
case E_NumberingSequence.GroupedByLevel:
case E_NumberingSequence.Like6_ButDoesntNeedSubsection:
@ -1245,7 +1245,7 @@ i = 0;
{
while (fibase.FormatID != fibase.ParentID) fibase = fibase.MyParent;
sGenMacBase = fibase.GenMac;
if (sGenMacBase != null && sGenMacBase != "")
if (sGenMacBase != null && sGenMacBase != string.Empty)
{
XmlDocument xDocGenMacBase = new XmlDocument();
xDocGenMacBase.LoadXml(sGenMacBase);
@ -1260,19 +1260,19 @@ i = 0;
}
}
}
if (sGenMac == null || sGenMac == "")
if (sGenMac == null || sGenMac == string.Empty)
{
// If subformat and does not have its own genmac, find an inherited genmac.
FormatInfo tmpf = FormatInfo.Get(activeFormat.ParentID);
while (tmpf.FormatID!=1 && (sGenMac==null||sGenMac==""))
while (tmpf.FormatID!=1 && (sGenMac==null||sGenMac==string.Empty))
{
sGenMac = tmpf.GenMac;
tmpf = FormatInfo.Get(tmpf.ParentID);
}
if (sGenMac == null || sGenMac == "")
if (sGenMac == null || sGenMac == string.Empty)
sGenMac = "<svg></svg>";
}
if (sGenMacBase != null && sGenMacBase != "")
if (sGenMacBase != null && sGenMacBase != string.Empty)
{
sGenMac = sGenMac.Replace("</svg>", sGenMacBase + "</svg>");
}
@ -1338,7 +1338,7 @@ i = 0;
//float rowAdj = 0; // = 18;
bool usePSIvalue = false; // C2021-065 used with ROLkUpMatch pagelist flag (Barakah Alarms)
string otherChildUnit = ""; // C2021-065 used when OTHER applicability information is used for the ROLookUp
string otherChildUnit = string.Empty; // C2021-065 used when OTHER applicability information is used for the ROLookUp
foreach (VEPROMS.CSLA.Library.PageItem pageItem in pageStyle.PageItems)
{
if (pageItem.Token == null) continue; // can be null if token is dependent on PSI lookup!
@ -1401,7 +1401,7 @@ i = 0;
parts[1] = parts[n + 1];// Get the last 2 parts
parts[2] = parts[n + 2];
}
string ROLookupVal = "";
string ROLookupVal = string.Empty;
// parts[0] - the RO to look up - for Alarms, is usually the EOP number thus uses the "{EOPNUM}" token
// parts[1] - Which of the multiple return value from the RO to return
// parts[2] - the value to use if not found in ROs - usually defined in a PSI field for that Alarm procedure
@ -1420,7 +1420,7 @@ i = 0;
int idx = procnum.IndexOf('-');
otherChildUnit = procnum.Substring(0, idx); // we need to get RO info for the Other child applicability - this gets child's number
}
ROLookupVal = ROLookup(parts[0], parts[1], "",otherChildUnit); // will return empty string if alarm point is not found in RO database
ROLookupVal = ROLookup(parts[0], parts[1], string.Empty,otherChildUnit); // will return empty string if alarm point is not found in RO database
usePSIvalue = (ROLookupVal != section.MyProcedure.DisplayNumber); // use PSI value if child alarm ID not found or does not match resolved procedure number (alarm point)
}
// C2021-065 if usePSIvalue is true, then we know alarm point info is not in the RO database, so just use the default (PSI) value
@ -1437,7 +1437,7 @@ i = 0;
ROLookupVal = dt1.StartText;
}
// replace the pagelist token with ROLookupVal
pltok = pltok.Substring(0, idxstart) + ROLookupVal + ((idxstart + idxend < pltok.Length) ? pltok.Substring(idxstart + idxend + 1) : "");
pltok = pltok.Substring(0, idxstart) + ROLookupVal + ((idxstart + idxend < pltok.Length) ? pltok.Substring(idxstart + idxend + 1) : string.Empty);
}
// C2021-065 (BNPP Alarms format) we are processing a paglist flag (ROLkUpMatch) to determine how to get Alarm Point information
// Nothing else is on this page list item, so use "continue" to jump to the next pagelist item as nothing gets printed for this item
@ -1447,13 +1447,13 @@ i = 0;
MatchCollection matches = regexFindToken.Matches(pltok);//(pageItem.Token);
if (matches.Count > 0)
{
string plstr = "";
string plstr = string.Empty;
// When a pagelist line (row) has more than one token that is resolved to text, each resolved token text was place on top
// of each other. Use a temporary string (plstr) to process the pagelist tokens for each pagelist line (row) before adding
// it to the svgGroup.
plstr = pltok;//pageItem.Token;
// F2017-046: Remove the '@@' characters that were getting printed on SAMG Sup Info facing pages for Calvert (BGESAM1 format).
if (MyPromsPrinter.DoingFacingPage && plstr.Contains("@@")) plstr = plstr.Replace("@@", "");
if (MyPromsPrinter.DoingFacingPage && plstr.Contains("@@")) plstr = plstr.Replace("@@", string.Empty);
foreach (Match match in matches)
{
string token = match.Value;
@ -1485,7 +1485,7 @@ i = 0;
{
//svgGroup.Add(PageItemToSvgText(pageItem.Token, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection));
svgGroup.Add(PageItemToSvgText(pltok, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection));
plstr = ""; // Clear it so it isn't put out twice (used below)
plstr = string.Empty; // Clear it so it isn't put out twice (used below)
}
}
}
@ -1494,11 +1494,11 @@ i = 0;
int eindx = token.IndexOf("}", bindx);
val = token.Substring(bindx + 1, eindx - bindx - 1);
}
if (val != null && val != "" && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null);
//if (val == null || val == "")
if (val != null && val != string.Empty && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null);
//if (val == null || val == string.Empty)
//val = " ";
if (val == null)
val = "";
val = string.Empty;
plstr = plstr.Replace(token, val);
// Get a list of Pagelist token that are inside the PS= conditional result
// Paglist tokens inside a PS= conditional are surrounded by square brackets instead of curley
@ -1540,7 +1540,7 @@ i = 0;
if (relval == "Y")
{
svgGroup.Add(PageItemToSvgText(pltok, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection));
plstr = ""; // Clear it so it isn't put out twice (used below)
plstr = string.Empty; // Clear it so it isn't put out twice (used below)
}
}
}
@ -1549,11 +1549,11 @@ i = 0;
int eindx = token.IndexOf("}", bindx);
val = token.Substring(bindx + 1, eindx - bindx - 1);
}
if (val != null && val != "" && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null);
//if (val == null || val == "")
if (val != null && val != string.Empty && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null);
//if (val == null || val == string.Empty)
//val = " ";
if (val == null)
val = "";
val = string.Empty;
plstr = plstr.Replace(token, val);
// Get a list of Pagelist token that are inside the SI= conditional result
// Paglist tokens inside a PS= conditional are surrounded by square brackets instead of curley
@ -1575,7 +1575,7 @@ i = 0;
if (!ProcessPaglistToken(section, svgGroup, pageItem, ref useFontForCheckOffHeader, ref plstr, token)) break;
}
} // end foreach matches
if (plstr != "")
if (plstr != string.Empty)
{
if (useFontForCheckOffHeader != null)
svgGroup.Add(PageItemToSvgText(pageItem, plstr, useFontForCheckOffHeader, MySection));
@ -1604,30 +1604,36 @@ i = 0;
else
Volian.Base.Library.BaselineMetaFile.WriteLine("No Pagelist Information");
}
private string ROLookup(string accpageid, string multiid, string deflt)
{
return ROLookup(accpageid, multiid, deflt, "");
return ROLookup(accpageid, multiid, deflt, string.Empty);
}
// C2021-065 pass in a override for the child unit - in this case the <u-Otherxxx> token is being used (Barakah Alarms)
private string ROLookup(string accpageid, string multiid, string deflt, string overrideChild)
{
ROFSTLookup myLookup = MySection.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MySection.MyDocVersion, overrideChild);
string accpgid = accpageid;
//accpgid = accpgid.Replace("-HIGH", "-HI").Replace("-LOW", "-LO").Replace("_HIGH", "-HI").Replace("_LOW", "-LO").Replace(@"\u8209?", "-");
string val = myLookup.GetROValueByAccPagID("<" + accpgid + "." + multiid + ">", MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
if (val == null)
ROFSTLookup.rochild roc = myLookup.GetROChildByAccPageID("<" + accpgid + "." + multiid + ">", MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
if (roc.value == null)
{
accpgid = accpgid.Replace(@"\u8209?", "-");
val = myLookup.GetROValueByAccPagID("<" + accpgid + "." + multiid + ">", MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
roc = myLookup.GetROChildByAccPageID("<" + accpgid + "." + multiid + ">", MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
}
if (!deflt.StartsWith("[") && val != null && val.Trim().Length > 0) // don't return val if it's an empty or blank string - jsj 01-28-2019
if (!deflt.StartsWith("[") && !string.IsNullOrEmpty(roc.value) && roc.value.Trim().Length > 0) // don't return val if it's an empty or blank string - jsj 01-28-2019
{
val = val.Replace("[xB3]", "\xB3");
val = val.Replace("[xB2]", "\xB2");
return val;
roc.value = roc.value.Replace("[xB3]", "\xB3");
roc.value = roc.value.Replace("[xB2]", "\xB2");
return roc.value;
}
return deflt;
}
private bool _DidHLSText = false;
public bool DidHLSText
{
@ -1640,23 +1646,23 @@ i = 0;
get { return _HasHLSTextId; }
set { _HasHLSTextId = value; }
}
private string _HLSText = "";
private string _HLSText = string.Empty;
public string HLSText
{
get { return _HLSText; }
set
{
if (_HLSText == "")
if (_HLSText == string.Empty)
_HLSText = value;
}
}
private string _HLSTAB = "";
private string _HLSTAB = string.Empty;
public string HLSTAB
{
get { return _HLSTAB; }
set { _HLSTAB = value; }
}
private string _HLRNO = "";
private string _HLRNO = string.Empty;
public string HLRNO
{
get { return _HLRNO; }
@ -1697,11 +1703,11 @@ i = 0;
{
case "{!atom}":
// Add an Atom Figure to the SVG
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
AddImage(svgGroup, 160.5f, 170.5f, 288f, 323f, "atom.bmp");
break;
case "{!cpllogo}":
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
AddImage(svgGroup, 10f, 10f, 78.7f, 29.8f, "cpllogo.bmp");
break;
//case "{!domlogo}":
@ -1738,7 +1744,7 @@ i = 0;
case "[BOX8]":
case "{BOX9}":
case "[BOX9]":
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
svgGroup.Add(PageItemToSvgUse(pageItem, FirstAndLast(token)));
break;
case "{PMODEBOX}": // need to set either 1 or 2 depending on number of columns
@ -1751,24 +1757,24 @@ i = 0;
else if (_MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.Two)
box = "2";
box = "{BOX" + box + "}";
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
svgGroup.Add(PageItemToSvgUse(pageItem, FirstAndLast(box)));
break;
case "{DRAFTPAGE}":
//if (!AllowedWatermarks.Contains("Draft")) AllowedWatermarks.Add("Draft"); -- B2018-124 not needed anymore
plstr = plstr.Replace(token, "");// Remove token since it is handled now
plstr = plstr.Replace(token, string.Empty);// Remove token since it is handled now
break;
case "{REFERENCEPAGE}":
//if (!AllowedWatermarks.Contains("Reference")) AllowedWatermarks.Add("Reference"); -- B2018-124 not needed anymore
plstr = plstr.Replace(token, "");// Remove token since it is handled now
plstr = plstr.Replace(token, string.Empty);// Remove token since it is handled now
break;
case "{MASTERPAGE}":
//if (!AllowedWatermarks.Contains("Master")) AllowedWatermarks.Add("Master"); -- B2018-124 not needed anymore
plstr = plstr.Replace(token, "");// Remove token since it is handled now
plstr = plstr.Replace(token, string.Empty);// Remove token since it is handled now
break;
case "{SAMPLEPAGE}":
//if (!AllowedWatermarks.Contains("Sample")) AllowedWatermarks.Add("Sample"); -- B2018-124 not needed anymore
plstr = plstr.Replace(token, "");// Remove token since it is handled now
plstr = plstr.Replace(token, string.Empty);// Remove token since it is handled now
break;
//case "{INFORMATIONPAGE}":
// if (!AllowedWatermarks.Contains("Information Only")) AllowedWatermarks.Add("Information Only"); -- B2018-124 not needed anymore
@ -1788,7 +1794,7 @@ i = 0;
float linelen = tlen * (float)pageItem.Font.CPI / 12;
string title = section.MyProcedure.MyContent.Text;
if (title.Contains("<NO TITLE>") && !section.ActiveFormat.PlantFormat.FormatData.ProcData.PrintNoTitle)
plstr = "";
plstr = string.Empty;
else
{
if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title = title.ToUpper();
@ -1833,7 +1839,7 @@ i = 0;
if (OldTemplateContMsg)
plstr = plstr.Replace("{CM:(Cont)}", "(Cont)");
else
plstr = plstr.Replace("{CM:(Cont)}", "");
plstr = plstr.Replace("{CM:(Cont)}", string.Empty);
break;
case "{RF:REFERENCE}":
// This token is used by IP2. In 16bit it is processed when the PO_DISTRIBUTEAPPROVED
@ -1842,13 +1848,13 @@ i = 0;
// unless/until it is determined that it is used (no data that Volian currently has
// contains this file). To implement it requires a config item off of the procedure level,
// user interface support on the Procedure Properties dialog and print support.
plstr = plstr.Replace("{RF:REFERENCE}", "");
plstr = plstr.Replace("{RF:REFERENCE}", string.Empty);
break;
case "{NULLDOCCURPAGE}":
// This token is used by IP2. There was no support for it in 16bit and the 16bit to 32bit
// output compared so it is just removed here so that a pagelist token error is not output
// in error log.
plstr = plstr.Replace("{NULLDOCCURPAGE}", "");
plstr = plstr.Replace("{NULLDOCCURPAGE}", string.Empty);
break;
case "{PDFDate}":
plstr = plstr.Replace("{PDFDate}", DateTime.Now.ToString("MM/dd/yyyy"));
@ -1882,16 +1888,16 @@ i = 0;
{
// copied Rgex from DisplayText and modifed to remove the Parent/Child Unit information
// i.e. <U>, <U-ID>, <U-NAME>, <U-TEXT>, <U-NUMBER>, <U-OTHERID>, <U-OTHERNAME>, <U-OTHERTEXT>, <U-OTHERNUMBER>
eopnum = Regex.Replace(eopnum, @"\<U\>", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)ID)\>(-|\\u8209\?)", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)NAME)\>(-|\\u8209\?)", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)TEXT)\>(-|\\u8209\?)", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)NUMBER)\>(-|\\u8209\?)", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<U\>", string.Empty, RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)ID)\>(-|\\u8209\?)", string.Empty, RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)NAME)\>(-|\\u8209\?)", string.Empty, RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)TEXT)\>(-|\\u8209\?)", string.Empty, RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)NUMBER)\>(-|\\u8209\?)", string.Empty, RegexOptions.IgnoreCase);
// B2021-148 remove space character after "OTHER"
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)OTHERID)\>(-|\\u8209\?)", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)OTHERNAME)\>(-|\\u8209\?)", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)OTHERTEXT)\>(-|\\u8209\?)", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)OTHERNUMBER)\>(-|\\u8209\?)", "", RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)OTHERID)\>(-|\\u8209\?)", string.Empty, RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)OTHERNAME)\>(-|\\u8209\?)", string.Empty, RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)OTHERTEXT)\>(-|\\u8209\?)", string.Empty, RegexOptions.IgnoreCase);
eopnum = Regex.Replace(eopnum, @"\<(U(-|\\u8209\?)OTHERNUMBER)\>(-|\\u8209\?)", string.Empty, RegexOptions.IgnoreCase);
}
else
eopnum = section.MyProcedure.DisplayNumber;// B2021-066: found and fixed during proc pc/pc work
@ -1933,7 +1939,7 @@ i = 0;
&& token.Contains("ATTACHTITLECONT") && DidFirstPageDocStyle)
{
string myMsg = section.MyDocStyle.Continue.Top.Message;
if (myMsg != null && myMsg != "")stitle = stitle + myMsg;
if (myMsg != null && myMsg != string.Empty)stitle = stitle + myMsg;
}
// B2021-119: large titles on Landscape Word Attachments are printing on 2 lines.
int? stl = (int)section.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumberAndTitleLength;
@ -1945,7 +1951,7 @@ i = 0;
PrintedSectionPage = (int)pageItem.Row - _sectLevelNumTtlDiff;
}
else
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
//svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayText));
break;
case "{METASECTIONTITLE}": // This will print the top level section title (versus level above current)
@ -1961,7 +1967,7 @@ i = 0;
plstr = SplitTitle(svgGroup, pageItem, top.DisplayText, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionTitleLength, token, plstr, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumberAndTitleLength);
}
else
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
break;
case "{SECTIONLEVELNUMBER}":
case "[SECTIONLEVELNUMBER]":
@ -1972,7 +1978,7 @@ i = 0;
_sectLevelNumTtlDiff = (int)pageItem.Row;
}
else
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
// B2020-040: pagelist was {SECTIONLEVELNUMBER}, {SECTIONLEVELTITLE} and if no SECTIONLEVELNUMBER exists, printed
// text starts with a ', ' - remove it.
if (plstr.StartsWith(", ") && plstr.IndexOf("{SECTIONLEVELTITLE}") == 2)
@ -1996,7 +2002,7 @@ i = 0;
plstr = plstr.Replace(token, top.DisplayNumber);
}
else
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
break;
case "{UNITTEXT}":
case "[UNITTEXT]":
@ -2069,12 +2075,12 @@ i = 0;
plstr = plstr.Replace(token, "BREAKER");
break;
default:
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
break;
}
}
else
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
break;
case "{STARTUP}":
ItemInfo firstHighs = ValveGetFirstStep(section);
@ -2092,12 +2098,12 @@ i = 0;
plstr = plstr.Replace(token, "STARTUP/");
break;
default:
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
break;
}
}
else
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
break;
case "{PROCDES}":
ProcDescrList pdl = section.ActiveFormat.PlantFormat.FormatData.PrintData.ProcDescrList;
@ -2112,7 +2118,7 @@ i = 0;
if (procnum.Contains(matchStr))
{
if (pd.ProcDescr1 == "{null}") // used to override fmt file inheritance & set null/empty string
plstr = "";
plstr = string.Empty;
else
plstr = pd.ProcDescr1;
break;
@ -2127,13 +2133,13 @@ i = 0;
if (Regex.IsMatch(procnum.Substring(0,1),"[A-Za-z]"))
plstr = pd.ProcDescr1;
else
plstr = "";
plstr = string.Empty;
break;
}
if (Regex.IsMatch(procnum, "^[A-Za-z]+$"))
plstr = pd.ProcDescr1;
else
plstr = "";
plstr = string.Empty;
break;
}
}
@ -2162,7 +2168,7 @@ i = 0;
if (Regex.IsMatch(procnum, "^[A-Za-z]+$"))
plstr = pd.ProcDescr2;
else
plstr = "";
plstr = string.Empty;
break;
}
}
@ -2180,7 +2186,7 @@ i = 0;
plstr = plstr.Replace(token, thisDate2.ToString("H:mm"));
break;
case "{HLRNO}":
plstr = HLRNO==null?"":plstr.Replace(token, HLRNO);
plstr = HLRNO==null?string.Empty:plstr.Replace(token, HLRNO);
break;
case "{HLSTAB}":
plstr = plstr.Replace(token, HLSTAB);
@ -2204,14 +2210,14 @@ i = 0;
//int sc = sectCfg.Section_CheckoffListSelection;
if (!MySection.HasInitials)
{
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
//PIInitials = pageItem;
}
else
{
if (pageItem.Row == -MySection.MyDocStyle.Layout.TopMargin)
{
plstr = plstr.Replace(token, "");
plstr = plstr.Replace(token, string.Empty);
PIInitials = pageItem;
}
else
@ -2222,7 +2228,7 @@ i = 0;
// copied from 16bit's pagelist.cs for BGE:
string revUnit = null;
string unitNum = MySection.MyDocVersion.DocVersionConfig.Print_UnitNumberForPageList;
if (Rev != null && Rev != "")
if (Rev != null && Rev != string.Empty)
{
revUnit = Rev;
int indxs = Rev.IndexOf(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/');
@ -2262,7 +2268,7 @@ i = 0;
if (val.ToUpper().Contains("<U>") || val.ToUpper().Contains("<U-")) // Replace token with the applicable unit information
{
string unbr3 = ResolveUnitApp(MySection.MyDocVersion, val);
plstr = unbr3 ?? "";
plstr = unbr3 ?? string.Empty;
}
plstr = plstr.Replace(token, val);
break; // B2019-134 break out of switch statement after processing the <SI- token so that it can loop and handle any other tokens on the same line
@ -2275,7 +2281,7 @@ i = 0;
if (plstr.ToUpper().Contains("<U>") || val.ToUpper().Contains("<U-")) // Replace token with the applicable unit information
{
string unbr3 = ResolveUnitApp(MySection.MyDocVersion, val);
plstr = unbr3 ?? "";
plstr = unbr3 ?? string.Empty;
}
// the first part of the string between the ? and ' ' is the other logical
// to see if it's on. If on, just use col and/or row as defined. Otherwise use
@ -2292,14 +2298,14 @@ i = 0;
col = System.Convert.ToInt32(newval.Substring(4));
}
svgGroup.Add(PageItemToSvgText(pageItem.Token, pageItem.Row ?? 0, col, pageItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, plstr, MySection));
plstr = ""; // clear so it doesn't get added twice, i.e. in the method that calls this.
plstr = string.Empty; // clear so it doesn't get added twice, i.e. in the method that calls this.
}
}
}
}
if (token.Contains(@"RO-"))
{
plstr = token.Replace("{","").Replace("}","");
plstr = token.Replace("{",string.Empty).Replace("}",string.Empty);
svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection));
}
if (token.Contains(@"PS-"))
@ -2317,7 +2323,7 @@ i = 0;
if(val.ToUpper().Contains("<U>") || val.ToUpper().Contains("<U-")) // Replace token with the applicable unit information
{
string unbr3 = ResolveUnitApp(MySection.MyDocVersion, val);
val = unbr3 ?? "";
val = unbr3 ?? string.Empty;
}
// MaxWidth is used to define width that the PSI text spans x-direction on page. If it is
// defined, see if the text is too wide for a single line (SplitTextMaxWidth). The
@ -2352,22 +2358,22 @@ i = 0;
col = System.Convert.ToInt32(newval.Substring(4));
}
svgGroup.Add(PageItemToSvgText(pageItem.Token, pageItem.Row ?? 0, col, pageItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, plstr, MySection));
plstr = ""; // clear so it doesn't get added twice, i.e. in the method that calls this.
plstr = string.Empty; // clear so it doesn't get added twice, i.e. in the method that calls this.
}
}
}
}
else
{
if (plstr != "")
if (plstr != string.Empty)
{
svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection));
plstr = "";
plstr = string.Empty;
}
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token));
}
//_MyLog.InfoFormat("Token not processed {0}", token);
if (plstr == "") retval = false;
if (plstr == string.Empty) retval = false;
break;
}
return retval;
@ -2409,7 +2415,7 @@ i = 0;
// if (dvConfig != null)
// {
// val = dvConfig.GetValue("SI", fieldName);
// if (val != null && val != "") return val; // the value exists within the docversion level
// if (val != null && val != string.Empty) return val; // the value exists within the docversion level
// }
// FolderInfo fi = pi.MyDocVersion.MyFolder;
// while (fi != null)
@ -2418,7 +2424,7 @@ i = 0;
// if (folderConfig != null)
// {
// val = folderConfig.GetValue("SI", fieldName);
// if (val != null && val != "") return val; // the value exists within this folder
// if (val != null && val != string.Empty) return val; // the value exists within this folder
// }
// fi = fi.ActiveParent as FolderInfo;
// }
@ -2476,11 +2482,11 @@ i = 0;
{
plstr = plstr.Replace(match, line); // include preceeding text with the first line v.c. summer
svgGroup.Add(PageItemToSvgText(pageItem, plstr, yOffset));
plstr = "";
plstr = string.Empty;
}
else
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
plstr = plstr.Replace(match, "");
plstr = plstr.Replace(match, string.Empty);
}
yOffset += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12);
}
@ -2489,7 +2495,7 @@ i = 0;
private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr,int? numAndTitleLen)
{
bool includePrecedingText = false;
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, "");
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, string.Empty);
// F2017-013 - Ginna (RGESAM1) this handles when you have {SECTIONLEVELNUMBER} and {SECTIONLEVELTITLE} on the same line.
// The section number was already replaced in plstr so when determining where to split the title,
// include the section number (and anything before the title) in the calculation of where to split.
@ -2508,9 +2514,9 @@ i = 0;
if ((len == null || len == 0 || ItemInfo.StripRtfFormatting(title).Length < len) && (!includePrecedingText || ItemInfo.StripRtfFormatting(title).Length < numAndTitleLen))
{
// B2022-061: don't print '\line' as part of procedure title in pagelist items.
if (match == "{PROCTITLE}") title = title.Replace("\\line ", "");
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, ""); // this would have been done in proctitle1
plstr = plstr.Replace(match, title).Replace("@@","");
if (match == "{PROCTITLE}") title = title.Replace("\\line ", string.Empty);
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, string.Empty); // this would have been done in proctitle1
plstr = plstr.Replace(match, title).Replace("@@",string.Empty);
//svgGroup.Add(PageItemToSvgText(pageItem, title));
return plstr;
}
@ -2520,7 +2526,7 @@ i = 0;
if (plstr.Contains("@@"))
{
DoSpecialSectNumTitle(svgGroup, pageItem, title, len, match, plstr);
return ""; // all resolved pagelist items were already added to svgGroup for printing.
return string.Empty; // all resolved pagelist items were already added to svgGroup for printing.
}
// Otherwise determine how many line to split the text into
List<string>titleLines = Volian.Base.Library.RtfTools.SplitText(title,(includePrecedingText)?(int)numAndTitleLen: (int)len);
@ -2555,11 +2561,11 @@ i = 0;
{
plstr = plstr.Replace(match, line); // include preceeding text with the first line v.c. summer
svgGroup.Add(PageItemToSvgText(pageItem, plstr, yOffset));
plstr = "";
plstr = string.Empty;
}
else
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
plstr = plstr.Replace(match, "");
plstr = plstr.Replace(match, string.Empty);
}
yOffset += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12);
}
@ -2632,7 +2638,7 @@ i = 0;
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
yOffset += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12);
}
return plstr.Replace(token, "");
return plstr.Replace(token, string.Empty);
}
private string SplitEOPNumber(SvgGroup svgGroup, PageItem pageItem, string eopnum, string token, string plstr)
{
@ -2643,7 +2649,7 @@ i = 0;
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
yOffset += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12);
}
return plstr.Replace(token, "");
return plstr.Replace(token, string.Empty);
}
//private string symblsStr = "\u25CF\u0394"; // string of possible symbol character in a tab
//// add symbol characters as needed
@ -2697,7 +2703,7 @@ i = 0;
if (lnCnt == 1) continue;
plstr = plstr.Replace(match, line);
svgGroup.Add(PageItemToSvgText(pageItem, plstr, yOffset));
plstr = ""; // clear it because it was added into the list in the line above this, i.e. don't duplicate
plstr = string.Empty; // clear it because it was added into the list in the line above this, i.e. don't duplicate
yOffset += 12;
}
return plstr;
@ -2815,7 +2821,7 @@ i = 0;
// there is a message in format file to use instead of text, then use it.
if (tmpi == 8 && mySize.Width > fontShrinkAftLen)
{
if (reptext != null && reptext != "")
if (reptext != null && reptext != string.Empty)
text = reptext;
else // As per PAL (11/15/21) have default message and highlight by italics (text was already bolded)
{
@ -2939,7 +2945,7 @@ i = 0;
// that are used.
// 16-bit had code to string preceeding blanks.
if (Rev != null && Rev != "") Rev = Rev.TrimStart(" ".ToCharArray());
if (Rev != null && Rev != string.Empty) Rev = Rev.TrimStart(" ".ToCharArray());
// Now check the format flags to determine if/how the Rev string should be parsed.
if ((MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && Rev.Contains("/"))
@ -2958,14 +2964,14 @@ i = 0;
case "{SETREV}":
return MySection.MyDocVersion.DocVersionConfig.ProcedureSetRev;
case "{NULLDOCCURPAGE}":
return "";
return string.Empty;
}
if (!_MissingTokens.Contains(match.Value))
{
_MissingTokens.Add(match.Value);
_MyLog.InfoFormat("Unhandled token {0}", match.Value);
}
return "";
return string.Empty;
}
}
public class ChkListBoxesHelper : List<ChkListBoxHelper>