public void Stop()
{
try
{
if (isConnected)
{
//monitorClient.StopAsync().ContinueWith(t => Update());
if (monitorClient.IsStarted())
{
monitorClient.Stop();
Update();
}
}
else
{
if (monitor.IsStarted())
{
monitor.Stop();
Update();
}
}
timer.Stop();
}
catch (TimeoutException te)
{
#if DEBUG
view.ShowError(te.ToString());
#else
view.ShowError(te.Message);
#endif
}
catch (EndpointNotFoundException enfe)
{
#if DEBUG
view.ShowError(enfe.ToString());
#else
view.ShowError(enfe.Message);
#endif
}
}