Added ability to perform a profile (Determine which sections of code are using the majority of the CPU time.)
Fixed logic that determines if the debug output should be created in the PDF. Added ability to track DB actions. Change cursor to a wait curcor when the print button is pressed. Added Profile debug Added a time-out for determining if a RO.FST file is newer. Added a property (PrintAllAtOnce) to the ItemInfo object so that the code can differentiate between objects that are being used for edit or print. Added logic to improve print performance. Specifically initialize a number of item properties when the procedure is loaded for printing, rather than waiting for the properties to be lazy-loaded. Added Profile debug Changed NextItem property to use GetNextItem method when printing.
This commit is contained in:
@@ -15,6 +15,7 @@ using Csla;
|
||||
using Csla.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
//using VEPROMS.Properties;
|
||||
|
||||
namespace VEPROMS.CSLA.Library
|
||||
@@ -164,6 +165,27 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public partial class DocVersionInfo : IVEDrillDownReadOnly
|
||||
{
|
||||
public TimeSpan tsTimeOut = TimeSpan.FromSeconds(6);
|
||||
public bool pathExists(string path)
|
||||
{
|
||||
bool exists = true;
|
||||
Thread t = new Thread(
|
||||
new ThreadStart(delegate()
|
||||
{
|
||||
exists = System.IO.File.Exists(path);
|
||||
})
|
||||
);
|
||||
t.Start();
|
||||
bool completed = t.Join(tsTimeOut); //wait 6 seconds then 3 then 1.5 then .75 seconds
|
||||
if (!completed)
|
||||
{
|
||||
exists = false;
|
||||
t.Abort();
|
||||
if (tsTimeOut > TimeSpan.FromSeconds(1))
|
||||
tsTimeOut = TimeSpan.FromTicks( tsTimeOut.Ticks / 2);
|
||||
}
|
||||
return exists;
|
||||
}
|
||||
public bool NewerRoFst
|
||||
{
|
||||
get
|
||||
@@ -172,7 +194,12 @@ namespace VEPROMS.CSLA.Library
|
||||
ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID);
|
||||
RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID);
|
||||
string rofstPath = rdi.FolderPath + @"\ro.fst";
|
||||
if (!File.Exists(rofstPath)) return false;
|
||||
//if (!File.Exists(rofstPath)) return false;
|
||||
if (!pathExists(rofstPath))
|
||||
{
|
||||
_MyLog.WarnFormat("RO Path '{0}' could not be found", rofstPath);
|
||||
return false;
|
||||
}
|
||||
FileInfo fiRofst = new FileInfo(rofstPath);
|
||||
|
||||
// if the database Ro.Fst is newer or if the files have identical DTS,
|
||||
|
Reference in New Issue
Block a user