From 63b5c6ab73c4a2535579ea6f290b013e7bda4d0c Mon Sep 17 00:00:00 2001 From: shinichi Date: Mon, 19 Oct 2020 11:26:09 +0200 Subject: [PATCH 1/2] removed unnecessary code --- DoctorApp/ViewModels/ClientInfoViewModel.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/DoctorApp/ViewModels/ClientInfoViewModel.cs b/DoctorApp/ViewModels/ClientInfoViewModel.cs index 83517b1..eee0456 100644 --- a/DoctorApp/ViewModels/ClientInfoViewModel.cs +++ b/DoctorApp/ViewModels/ClientInfoViewModel.cs @@ -16,7 +16,6 @@ namespace DoctorApp.ViewModels class ClientInfoViewModel : ObservableObject { public PatientInfo PatientInfo { get; set; } - public ObservableCollection ChatLog { get; set; } public ICommand StartSession { get; set; } @@ -38,28 +37,24 @@ namespace DoctorApp.ViewModels MainWindowViewModel = mainWindowViewModel; this.PatientInfo = new PatientInfo() { Username = username, Status = "Waiting to start" }; PatientInfo.ChatLog = new ObservableCollection(); - ChatLog = new ObservableCollection(); client = mainWindowViewModel.client; StartSession = new RelayCommand(() => { client.sendMessage(DataParser.getStartSessionJson(PatientInfo.Username)); PatientInfo.Status = "Session started"; - System.Diagnostics.Debug.WriteLine("patient info status" + PatientInfo.Status); }); StopSession = new RelayCommand(() => { client.sendMessage(DataParser.getStopSessionJson(PatientInfo.Username)); PatientInfo.Status = "Session stopped, waiting to start again."; - System.Diagnostics.Debug.WriteLine("patient info status" + PatientInfo.Status); }); Chat = new RelayCommand((parameter) => { client.sendMessage(DataParser.getChatJson(PatientInfo.Username, ((TextBox)parameter).Text)); PatientInfo.ChatLog.Add(DateTime.Now + ": " + ((TextBox)parameter).Text); - ChatLog.Add(DateTime.Now + ":derp: " + ((TextBox)parameter).Text); }); //TODO RelayCommand ChatToAll From 163d2321cc9fd76178cc2d3a213ae250318cd5ef Mon Sep 17 00:00:00 2001 From: shinichi Date: Mon, 19 Oct 2020 11:49:34 +0200 Subject: [PATCH 2/2] username back added to tabs --- DoctorApp/App.xaml | 4 ++-- DoctorApp/Utils/Client.cs | 1 - DoctorApp/ViewModels/MainViewModel.cs | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DoctorApp/App.xaml b/DoctorApp/App.xaml index aac18d8..86b2dd4 100644 --- a/DoctorApp/App.xaml +++ b/DoctorApp/App.xaml @@ -9,11 +9,11 @@ - + - + diff --git a/DoctorApp/Utils/Client.cs b/DoctorApp/Utils/Client.cs index 4e727d0..f5fa102 100644 --- a/DoctorApp/Utils/Client.cs +++ b/DoctorApp/Utils/Client.cs @@ -111,7 +111,6 @@ namespace DoctorApp.Utils Console.WriteLine("Set resistance identifier"); break; case DataParser.NEW_CONNECTION: - Debug.WriteLine("doctor client new connection"); this.MainViewModel.NewConnectedUser(DataParser.getUsernameFromResponseJson(payloadbytes)); break; case DataParser.DISCONNECT: diff --git a/DoctorApp/ViewModels/MainViewModel.cs b/DoctorApp/ViewModels/MainViewModel.cs index b12d8dd..bd02499 100644 --- a/DoctorApp/ViewModels/MainViewModel.cs +++ b/DoctorApp/ViewModels/MainViewModel.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; +using System.Diagnostics; using System.Text; using System.Windows.Controls; using Util; @@ -26,6 +27,7 @@ namespace DoctorApp.ViewModels public void NewConnectedUser(string username) { + Debug.WriteLine("new tab with name " + username); App.Current.Dispatcher.Invoke((Action)delegate { Tabs.Add(new ClientInfoViewModel(MainWindowViewModel, username));