aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-12-30 14:27:05 +0200
committerMirta <mirta@twine-s.com>2020-12-30 14:27:05 +0200
commit1344a54c37f7cbba7a294674b4b733d72ee257ea (patch)
tree4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
parent124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff)
parent281610ac56799f6870c587a942495d91cd55b227 (diff)
downloadTango-1344a54c37f7cbba7a294674b4b733d72ee257ea.tar.gz
Tango-1344a54c37f7cbba7a294674b4b733d72ee257ea.zip
Hope it is fine
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs64
1 files changed, 0 insertions, 64 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
index e96f0ab62..f1f4f69c0 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
@@ -3,76 +3,12 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using System.Timers;
-using System.Windows.Threading;
using Tango.SharedUI;
namespace Tango.MachineStudio.UI.ViewModels
{
public class ConnectionLostViewVM : DialogViewVM
{
- private Timer _reconnectTimer;
-
public String Exception { get; set; }
-
- private int _reconnectinSeconds;
- public int ReconnectinSeconds
- {
- get { return _reconnectinSeconds; }
- set { _reconnectinSeconds = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _autoReconnect;
- public bool AutoReconnect
- {
- get { return _autoReconnect; }
- set { _autoReconnect = value; RaisePropertyChangedAuto(); }
- }
-
-
- public ConnectionLostViewVM() : base()
- {
- ReconnectinSeconds = 10;
- _reconnectTimer = new Timer();
- _reconnectTimer.Interval = TimeSpan.FromSeconds(1).TotalMilliseconds;
- _reconnectTimer.Elapsed += _reconnectTimer_Elapsed;
- }
-
- private void _reconnectTimer_Elapsed(object sender, ElapsedEventArgs e)
- {
- ReconnectinSeconds--;
-
- if (ReconnectinSeconds == -1)
- {
- _reconnectTimer.Stop();
-
- InvokeUI(() =>
- {
- Accept();
- });
- }
- }
-
- public override void OnShow()
- {
- base.OnShow();
-
- if (AutoReconnect)
- {
- _reconnectTimer.Start();
- }
- }
-
- protected override void Accept()
- {
- _reconnectTimer.Stop();
- base.Accept();
- }
-
- protected override void Cancel()
- {
- base.Cancel();
- _reconnectTimer.Stop();
- }
}
}