From 4ca2cb29d8bf2b93c35ac12e6d629a3537bb4a0b Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 14 Jan 2019 12:48:33 +0200 Subject: Machine Studio v4.0.0.0 Added reset all graphs to tech board. --- .../DefaultStudioApplicationManager.cs | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 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 90a2e34e7..6146d8f45 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -89,18 +89,22 @@ namespace Tango.MachineStudio.UI.StudioApplication get { return _connectedMachine; } private set { - _connectedMachine = value; - RaisePropertyChangedAuto(); - RaisePropertyChanged(nameof(IsMachineConnected)); - RaisePropertyChanged(nameof(IsMachineConnectedViaTCP)); - - if (_connectedMachine != null) + if (_connectedMachine != value) { - _connectedMachine.StateChanged -= ConnectedMachine_StateChanged; - _connectedMachine.StateChanged += ConnectedMachine_StateChanged; - } + _connectedMachine = value; + RaisePropertyChangedAuto(); + RaisePropertyChanged(nameof(IsMachineConnected)); + RaisePropertyChanged(nameof(IsMachineConnectedViaTCP)); - ConnectedMachineChanged?.Invoke(this, _connectedMachine); + if (_connectedMachine != null) + { + _connectedMachine.StateChanged -= ConnectedMachine_StateChanged; + _connectedMachine.StateChanged += ConnectedMachine_StateChanged; + } + + + ConnectedMachineChanged?.Invoke(this, _connectedMachine); + } } } -- cgit v1.3.1