aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-08-30 12:35:00 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-08-30 12:35:00 +0300
commit7171e1a3b7579420f2060798c649088d70565401 (patch)
tree5033e86d5ad91234194a1e0b2306a690d133cd11 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
parentc7c4975fd0010fc666c467105a39b1cd93cb818d (diff)
downloadTango-7171e1a3b7579420f2060798c649088d70565401.tar.gz
Tango-7171e1a3b7579420f2060798c649088d70565401.zip
Implemented In-Memory Transport Adapter.
Implemented Embedded In-Memory Emulator.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs35
1 files changed, 30 insertions, 5 deletions
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 17bf57f56..29bb459ee 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -19,6 +19,8 @@ using Tango.Integration.ExternalBridge;
using Tango.MachineStudio.Common.EventLogging;
using Tango.BL.Enumerations;
using Tango.Core.DI;
+using Tango.BL.Entities;
+using Tango.BL;
namespace Tango.MachineStudio.UI.StudioApplication
{
@@ -55,22 +57,23 @@ namespace Tango.MachineStudio.UI.StudioApplication
public bool IsShuttingDown { get; private set; }
/// <summary>
- /// The connected machine
+ /// Occurs when the connected machine property has changed.
/// </summary>
- private IExternalBridgeClient _connectedMachine;
+ public event EventHandler<IExternalBridgeClient> ConnectedMachineChanged;
/// <summary>
- /// Occurs when the connected machine property has changed.
+ /// Gets or sets the machine.
/// </summary>
- public event EventHandler<IExternalBridgeClient> ConnectedMachineChanged;
+ public Machine Machine { get; private set; }
+ private IExternalBridgeClient _connectedMachine;
/// <summary>
/// Gets or sets the currently connected machine if any.
/// </summary>
public IExternalBridgeClient ConnectedMachine
{
get { return _connectedMachine; }
- set
+ private set
{
_connectedMachine = value;
RaisePropertyChangedAuto();
@@ -270,9 +273,31 @@ namespace Tango.MachineStudio.UI.StudioApplication
}
}
+ /// <summary>
+ /// Raises the application ready event.
+ /// </summary>
public void NotifyApplicationReady()
{
TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>().ToList().ForEach(x => x.OnApplicationReady());
}
+
+ /// <summary>
+ /// Sets the connected machine.
+ /// </summary>
+ /// <param name="connectedMachine">The connected machine.</param>
+ public void SetConnectedMachine(IExternalBridgeClient connectedMachine)
+ {
+ if (connectedMachine != null)
+ {
+ Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == connectedMachine.SerialNumber);
+ ConnectedMachine = connectedMachine;
+ ConnectedMachine.SetMachine(Machine);
+ }
+ else
+ {
+ Machine = null;
+ ConnectedMachine = null;
+ }
+ }
}
}