aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-12-11 19:43:35 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-12-11 19:43:35 +0200
commit48f781d037a83c51fdd555fb6c9d1c2b4e424efe (patch)
treec13666e1ecb34dca68a8755af5c69534a493951f /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parent1952756022f71729aab3cea304d039f9b340b5d2 (diff)
downloadTango-48f781d037a83c51fdd555fb6c9d1c2b4e424efe.tar.gz
Tango-48f781d037a83c51fdd555fb6c9d1c2b4e424efe.zip
Working on PPC hotspot and external bridge.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs6
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs7
2 files changed, 13 insertions, 0 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 6303b1ac8..ccedde974 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -362,6 +362,12 @@ namespace Tango.MachineStudio.UI.StudioApplication
if (connectedMachine != null)
{
Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == connectedMachine.SerialNumber);
+
+ if (Machine == null)
+ {
+ throw new NullReferenceException($"The specified machine '{connectedMachine.SerialNumber}' could not be found on the database.");
+ }
+
ConnectedMachine = connectedMachine;
ConnectedMachine.SetMachine(Machine);
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
index 70378a4d5..d1f9cda64 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
@@ -453,6 +453,13 @@ namespace Tango.MachineStudio.UI.ViewModels
if (x.SelectedMachine.RequiresAuthentication)
{
+ //Check machine exist on my database first
+ if (!ObservablesStaticCollections.Instance.Machines.ToList().Exists(y => y.SerialNumber == x.SelectedMachine.SerialNumber))
+ {
+ _notificationProvider.ShowError( $"The specified machine '{x.SelectedMachine.SerialNumber}' could not be found on the database.");
+ return;
+ }
+
_notificationProvider.ShowModalDialog<MachineLoginViewVM>(async (login) =>
{
using (NotificationProvider.PushTaskItem("Connecting to machine " + x.SelectedMachine.ToString() + "..."))