From a05b392aead1d07a8ba0bf9e8430ea3ce09a4cef Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 14 Aug 2024 14:31:45 +0200 Subject: [PATCH] Klassen vom MainWindow getrennt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + Klassen getrennt + Business Schicht abgeändert --- bibtalk/bib-talk/Business/Message.cs | 16 +++++++++ bibtalk/bib-talk/Business/MessageDto.cs | 15 ++++++++ bibtalk/bib-talk/Business/User.cs | 19 ++++++++++ .../bib-talk/Repository/MainWindowDatabase.cs | 3 +- bibtalk/bib-talk/UI/MainWindow.xaml | 2 +- bibtalk/bib-talk/UI/MainWindow.xaml.cs | 36 ++----------------- 6 files changed, 56 insertions(+), 35 deletions(-) create mode 100644 bibtalk/bib-talk/Business/Message.cs create mode 100644 bibtalk/bib-talk/Business/MessageDto.cs create mode 100644 bibtalk/bib-talk/Business/User.cs diff --git a/bibtalk/bib-talk/Business/Message.cs b/bibtalk/bib-talk/Business/Message.cs new file mode 100644 index 0000000..44d709b --- /dev/null +++ b/bibtalk/bib-talk/Business/Message.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace bib_talk.Business +{ + public class Message + { + public int Id { get; set; } + public string Username { get; set; } + public string Text { get; set; } + public DateTime Timestamp { get; set; } + } +} diff --git a/bibtalk/bib-talk/Business/MessageDto.cs b/bibtalk/bib-talk/Business/MessageDto.cs new file mode 100644 index 0000000..5e05474 --- /dev/null +++ b/bibtalk/bib-talk/Business/MessageDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace bib_talk.Business +{ + public class MessageDto + { + public string Username { get; set; } + public string Message { get; set; } + public DateTime Timestamp { get; set; } + } +} diff --git a/bibtalk/bib-talk/Business/User.cs b/bibtalk/bib-talk/Business/User.cs new file mode 100644 index 0000000..a17fed9 --- /dev/null +++ b/bibtalk/bib-talk/Business/User.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace bib_talk.Business +{ + public class User + { + public int Id { get; set; } + public string Username { get; set; } + public string Password { get; set; } + public string Email { get; set; } + public string Birthday { get; set; } + public string IsOnline { get; set; } + public string ProfileImagePath { get; set; } + } +} diff --git a/bibtalk/bib-talk/Repository/MainWindowDatabase.cs b/bibtalk/bib-talk/Repository/MainWindowDatabase.cs index ac2510e..6cbb901 100644 --- a/bibtalk/bib-talk/Repository/MainWindowDatabase.cs +++ b/bibtalk/bib-talk/Repository/MainWindowDatabase.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using bib_talk.Business; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/bibtalk/bib-talk/UI/MainWindow.xaml b/bibtalk/bib-talk/UI/MainWindow.xaml index 15e6ac7..97394ab 100644 --- a/bibtalk/bib-talk/UI/MainWindow.xaml +++ b/bibtalk/bib-talk/UI/MainWindow.xaml @@ -132,7 +132,7 @@ - + diff --git a/bibtalk/bib-talk/UI/MainWindow.xaml.cs b/bibtalk/bib-talk/UI/MainWindow.xaml.cs index 8132844..1e483b5 100644 --- a/bibtalk/bib-talk/UI/MainWindow.xaml.cs +++ b/bibtalk/bib-talk/UI/MainWindow.xaml.cs @@ -120,7 +120,6 @@ namespace bib_talk private void Popup_LostFocus(object sender, RoutedEventArgs e) { - ClosePopup(); } @@ -129,10 +128,10 @@ namespace bib_talk popup.IsOpen = false; } - private void onlineUsersListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) - { + //private void onlineUsersListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + //{ - } + //} private async void uploadpbclick(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); @@ -144,33 +143,4 @@ namespace bib_talk } } } - - - - - public class Message - { - public int Id { get; set; } - public string Username { get; set; } - public string Text { get; set; } - public DateTime Timestamp { get; set; } - } - - public class MessageDto - { - public string Username { get; set; } - public string Message { get; set; } - public DateTime Timestamp { get; set; } - } - - public class User - { - public int Id { get; set; } - public string Username { get; set; } - public string Password { get; set; } - public string Email { get; set; } - public string Birthday { get; set; } - public string IsOnline { get; set; } - public string ProfileImagePath { get; set; } - } }