Merge branch 'develop' of https://github.com/SemvdH/Proftaak-RH-B4 into develop

This commit is contained in:
Sem van der Hoeven
2020-10-19 12:49:09 +02:00
3 changed files with 26 additions and 1 deletions

View File

@@ -167,6 +167,12 @@ namespace ClientApp.Utils
engineConnection.DoctorMessage = DataParser.getChatMessageFromJson(payloadbytes);
Debug.WriteLine("received message from doctor");
break;
case DataParser.NEW_CONNECTION:
this.LoginViewModel.DoctorConnected(DataParser.getUsernameFromJson(payloadbytes));
break;
case DataParser.DISCONNECT:
this.LoginViewModel.DoctorDisconnected(DataParser.getUsernameFromJson(payloadbytes));
break;
default:
Console.WriteLine($"Received json with identifier {identifier}:\n{Encoding.ASCII.GetString(payloadbytes)}");
break;

View File

@@ -42,5 +42,15 @@ namespace ClientApp.ViewModels
this.MainWindowViewModel.SelectedViewModel = new MainViewModel(MainWindowViewModel);
}
}
internal void DoctorConnected(string name)
{
this.MainWindowViewModel.InfoModel.DoctorConnected = true;
}
internal void DoctorDisconnected(string name)
{
this.MainWindowViewModel.InfoModel.DoctorConnected = false;
}
}
}