细节调整

This commit is contained in:
suntao committed 2020-10-27 10:20:47 +08:00
1 parent a9e8137aaa
commit fec18db7a8
10 files changed
+135 -72

No files matched your search

+17 -3
View File
@@ -30,9 +30,20 @@ namespace OnlineUserPool.ViewModels
public ObservableCollection<MsgModel> Customers { get; private set; } =
new ObservableCollection<MsgModel>();
private string _Title = "";
public string Title
{
get { return _Title; }
set
{
SetProperty(ref _Title, value);
}
}
public MainWindowViewModel()
{
Title = $"{ ConfigHelp.Ip }:{ ConfigHelp.Port }";
dispatcher = Dispatcher.CurrentDispatcher;
//Customers.Add("suntao");
@@ -143,10 +154,13 @@ namespace OnlineUserPool.ViewModels
dispatcher.Invoke(() =>
{
Customers.Clear();
foreach (var item in receiveMes)
{
if (Customers.Any(c => c.MemberId == item.MemberId))
{
continue;
}
Customers.Add(item);
}
@@ -179,7 +193,7 @@ namespace OnlineUserPool.ViewModels
}
catch (Exception e)
{
Log.Error("NotifyClient:" + e.Message);
Log.Error($"NotifyClient:{ e.Message }\r\n{ e.StackTrace }");
}
}
@@ -195,7 +209,7 @@ namespace OnlineUserPool.ViewModels
}
catch (Exception e)
{
Log.Error(item.IPEndPoint.ToString() + ":" + e.Message);
Log.Error($"{ item.IPEndPoint.ToString() }:{ e.Message }\r\n{ e.StackTrace }");
}
}
}