Merged Theming with AsyncDialogs

This commit is contained in:
Patrick Hellebrand
2021-09-23 16:06:55 +02:00
5 changed files with 38 additions and 37 deletions

View File

@@ -15,9 +15,9 @@ namespace PolyChat.Models
private SocketIOSocket Socket;
private bool Connected = false;
private readonly string IP;
private Action<string, bool> DeleteConnection;
private Action<string, bool, bool> DeleteConnection;
public Connection(string ip, ushort port, Action<JToken[]> onMessage, Action<string, bool> onClose)
public Connection(string ip, ushort port, Action<JToken[]> onMessage, Action<string, bool, bool> onClose)
{
Debug.WriteLine("! CONNECTING TO SERVER !");
IP = ip;
@@ -32,7 +32,7 @@ namespace PolyChat.Models
Client.On("message", (Action<JToken[]>) onMessage);
}
public Connection(SocketIOSocket socket, Action<JToken[]> onMessage, Action<string, bool> onClose)
public Connection(SocketIOSocket socket, Action<JToken[]> onMessage, Action<string, bool, bool> onClose)
{
Socket = socket;
DeleteConnection = onClose;
@@ -66,7 +66,7 @@ namespace PolyChat.Models
{
Debug.WriteLine("--- Disconnected! ---");
Debug.WriteLine($"--- Deleting Connection with IP: {IP}---");
DeleteConnection(IP, IsConnected());
DeleteConnection(IP, IsConnected(),false);
Connected = false;
}
private void OnError(JToken[] data)

View File

@@ -36,7 +36,7 @@ namespace PolyChat.Models
{
foreach (String path in filepaths)
{
if (Path.GetFileName(path).Equals(ip))
if (Path.GetFileName(path).Equals(ip+".txt"))
{
File.Delete(path);
return;