From 6a64a71a5197897cfa6d904274399bad3fb0b2da Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 18 Jan 2020 17:23:37 +0200 Subject: Implemented Machine Studio => PPC auto reconnection. Implemented SignalR Adapter reconnection. --- .../StudioApplication/DefaultStudioApplicationManager.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index 0235f8cca..2c3c9ccb9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -48,6 +48,11 @@ namespace Tango.MachineStudio.UI.StudioApplication /// public event EventHandler ApplicationReady; + /// + /// Occurs when the connected machine session has been lost and an automatic reconnection with the last machine is required. + /// + public event EventHandler ReconnectionRequired; + /// /// Initializes a new instance of the class. /// @@ -126,6 +131,8 @@ namespace Tango.MachineStudio.UI.StudioApplication { if (e == Transport.TransportComponentState.Disconnected || e == Transport.TransportComponentState.Failed) { + bool reconnect = ConnectedMachine is IExternalBridgeSecureClient; + ConnectedMachine = null; if (e == Transport.TransportComponentState.Failed) @@ -134,12 +141,16 @@ namespace Tango.MachineStudio.UI.StudioApplication ConnectionLostViewVM vm = new ConnectionLostViewVM() { - Exception = failed_reason + Exception = failed_reason, + AutoReconnect = reconnect, }; InvokeUI(() => { - _notification.ShowModalDialog(vm, (x) => { }, () => { }); + _notification.ShowModalDialog(vm, (x) => + { + ReconnectionRequired?.Invoke(this, new EventArgs()); + }, () => { }); }); } } -- cgit v1.3.1