2024-08-15 11:45:39 +02:00
|
|
|
|
using System.Threading.Tasks;
|
2024-07-03 15:58:51 +02:00
|
|
|
|
using bib_talk.Repository;
|
|
|
|
|
|
|
|
|
|
namespace bib_talk.Business
|
|
|
|
|
{
|
|
|
|
|
public class MainWindowManager
|
|
|
|
|
{
|
|
|
|
|
private MainWindowDatabase mwDatabase;
|
|
|
|
|
private string loggedinUser;
|
|
|
|
|
|
|
|
|
|
public MainWindowManager(MainWindow mainWindow)
|
|
|
|
|
{
|
|
|
|
|
mwDatabase = new MainWindowDatabase(mainWindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MainWindowManager(MainWindow mainWindow, string user)
|
|
|
|
|
{
|
|
|
|
|
mwDatabase = new MainWindowDatabase(mainWindow, user);
|
|
|
|
|
loggedinUser = user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SendMessage()
|
|
|
|
|
{
|
|
|
|
|
mwDatabase.SendMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void LoadMessages()
|
|
|
|
|
{
|
|
|
|
|
mwDatabase.LoadMessages();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void LoadOnlineUsers()
|
|
|
|
|
{
|
|
|
|
|
mwDatabase.LoadOnlineUsers();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void LogoutUser()
|
|
|
|
|
{
|
|
|
|
|
mwDatabase.LogoutUser();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task UploadProfileImage(string filePath)
|
|
|
|
|
{
|
|
|
|
|
await mwDatabase.UploadProfileImage(filePath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|