Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 35 additions & 31 deletions Src/Common/Controls/FwControls/ProgressDialogWithTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,20 @@ public virtual string Message
{
CheckDisposed();

if (m_fCreatedProgressDlg && m_synchronizeInvoke.InvokeRequired)
try
{
try
if (m_fCreatedProgressDlg && m_synchronizeInvoke.InvokeRequired)
{
m_synchronizeInvoke.Invoke((Action<string>)(s => m_progressDialog.Message = s), new[] { value });
}
catch (Exception e)
{
// Fixes LT-22357.
Debug.Assert(false);
}
else
m_progressDialog.Message = value;
}
catch (Exception e)
{
// Fixes LT-22357.
Debug.Assert(false);
}
else
m_progressDialog.Message = value;
}
}

Expand Down Expand Up @@ -361,20 +361,21 @@ public int Minimum
{
CheckDisposed();

if (m_fCreatedProgressDlg && m_synchronizeInvoke.InvokeRequired)
try
{
try
if (m_fCreatedProgressDlg && m_synchronizeInvoke.InvokeRequired)
{
m_synchronizeInvoke.Invoke((Action<int>)(i => m_progressDialog.Minimum = i), new object[] { value });
}
catch (Exception e)
{
// Fixes LT-22357.
Debug.Assert(false);
}
else
m_progressDialog.Minimum = value;

}
catch (Exception e)
{
// Fixes LT-22357.
Debug.Assert(false);
}
else
m_progressDialog.Minimum = value;
}
}

Expand All @@ -398,20 +399,20 @@ public int Maximum
{
CheckDisposed();

if (m_fCreatedProgressDlg && m_synchronizeInvoke.InvokeRequired)
try
{
try
if (m_fCreatedProgressDlg && m_synchronizeInvoke.InvokeRequired)
{
m_synchronizeInvoke.Invoke((Action<int>)(i => m_progressDialog.Maximum = i), new object[] { value });
}
catch (Exception e)
{
// Fixes LT-22357.
Debug.Assert(false);
}
else
m_progressDialog.Maximum = value;
}
catch (Exception e)
{
// Fixes LT-22357.
Debug.Assert(false);
}
else
m_progressDialog.Maximum = value;
}
}
#endregion
Expand Down Expand Up @@ -829,10 +830,13 @@ private void m_progressDialog_FormClosing(object sender, FormClosingEventArgs e)

private void m_worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (m_fCreatedProgressDlg && m_synchronizeInvoke.InvokeRequired)
m_synchronizeInvoke.Invoke((Action)m_progressDialog.Close, null);
else
m_progressDialog.Close();
if (m_progressDialog != null)
{
if (m_fCreatedProgressDlg && m_synchronizeInvoke.InvokeRequired)
m_synchronizeInvoke.Invoke((Action)m_progressDialog.Close, null);
else
m_progressDialog.Close();
}
}
#endregion
}
Expand Down
4 changes: 4 additions & 0 deletions Src/xWorks/XhtmlDocView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,10 @@ private object SaveConfiguredXhtml(IThreadedProgress progress, object[] args)
progress.Message = xWorksStrings.ksObtainingEntriesToDisplay;
var configuration = new DictionaryConfigurationModel(configurationFile, Cache);
publicationDecorator.Refresh();
if (Clerk.IsDisposed)
{
return null;
}
var entriesToPublish = publicationDecorator.GetEntriesToPublish(m_propertyTable, Clerk.VirtualFlid);
var start = DateTime.Now;
var entriesPerPage = allOnOnePage ? entriesToPublish.Length : LcmXhtmlGenerator.EntriesPerPage;
Expand Down
Loading