B2019-106 Added Error Handling to code that opens PDF file
This commit is contained in:
parent
2df227fdaa
commit
04d3770f40
@ -238,10 +238,13 @@ namespace VEPROMS
|
|||||||
// set a delay so that the word document containing the newly generated placekeeper will appear on top of everything else.
|
// set a delay so that the word document containing the newly generated placekeeper will appear on top of everything else.
|
||||||
// - requested by Calvert Cliffs
|
// - requested by Calvert Cliffs
|
||||||
private void OpenPDFandPlacekeeper(string pdffile)
|
private void OpenPDFandPlacekeeper(string pdffile)
|
||||||
|
{
|
||||||
|
try // B2019-106 Error Handling for PDF Open
|
||||||
{
|
{
|
||||||
if ((pdffile ?? "") != "" && !OnlyShowContinuousActionSummary)
|
if ((pdffile ?? "") != "" && !OnlyShowContinuousActionSummary)
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(pdffile);
|
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(pdffile);
|
||||||
|
if (sdp != null)
|
||||||
sdp.WaitForInputIdle();
|
sdp.WaitForInputIdle();
|
||||||
}
|
}
|
||||||
if (OnlyShowContinuousActionSummary)
|
if (OnlyShowContinuousActionSummary)
|
||||||
@ -267,7 +270,12 @@ namespace VEPROMS
|
|||||||
System.Threading.Thread.Sleep(mydelay);
|
System.Threading.Thread.Sleep(mydelay);
|
||||||
MyPromsPrinter.MyContActSummary.Visible();
|
MyPromsPrinter.MyContActSummary.Visible();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
string str = string.Format("{0} - {1} - {2}",pdffile,ex.GetType().Name,ex.Message);
|
||||||
|
MessageBox.Show(str, "Error Opening PDFFile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private void btnOpenFolder_Click(object sender, EventArgs e)
|
private void btnOpenFolder_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user