From 295e3c10bb6d1c83796554edf8369e5aa87a20a8 Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Mon, 9 Oct 2017 08:56:25 +0200 Subject: Initial commit. --- Server/LogSingleton.cs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Server/LogSingleton.cs (limited to 'Server/LogSingleton.cs') diff --git a/Server/LogSingleton.cs b/Server/LogSingleton.cs new file mode 100644 index 0000000..158440d --- /dev/null +++ b/Server/LogSingleton.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace Server +{ + public class LogSingleton : INotifyPropertyChanged + { + private static LogSingleton _instance; + public static LogSingleton Instance => _instance ?? (_instance = new LogSingleton()); + + private string log; + public string Log + { + get + { + return log; + } + set + { + log = value; + OnPropertyChanged(); + } + } + + public List ConnectedClients { get; set; } + + private LogSingleton() + { + ConnectedClients = new List(); + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +} -- cgit v1.2.3