mirror of
https://github.com/ckaczor/JenkinsStatusWindow.git
synced 2026-01-13 17:22:55 -05:00
Make sure timer restarts in case of exception
This commit is contained in:
@@ -72,17 +72,31 @@ namespace JenkinsStatusWindow
|
|||||||
|
|
||||||
private void UpdateText()
|
private void UpdateText()
|
||||||
{
|
{
|
||||||
var textResult = GetText();
|
try
|
||||||
|
|
||||||
// Update the window on the main thread
|
|
||||||
_dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
_floatingStatusWindow.SetText(textResult.WindowText.ToString());
|
var textResult = GetText();
|
||||||
|
|
||||||
_floatingStatusWindow.IconToolTipText = textResult.TooltipText.ToString();
|
// Update the window on the main thread
|
||||||
});
|
_dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
_floatingStatusWindow.SetText(textResult.WindowText.ToString());
|
||||||
|
|
||||||
_refreshTimer.Start();
|
_floatingStatusWindow.IconToolTipText = textResult.TooltipText.ToString();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
_dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
_floatingStatusWindow.SetText(exception.Message);
|
||||||
|
|
||||||
|
_floatingStatusWindow.IconToolTipText = exception.Message;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_refreshTimer.Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextResult GetText()
|
private TextResult GetText()
|
||||||
|
|||||||
Reference in New Issue
Block a user