diff options
author | marcinzelent <zelent.marcin@protonmail.com> | 2017-10-09 08:56:25 +0200 |
---|---|---|
committer | marcinzelent <zelent.marcin@protonmail.com> | 2017-10-09 08:56:25 +0200 |
commit | 295e3c10bb6d1c83796554edf8369e5aa87a20a8 (patch) | |
tree | f6ad54798c039b6db9aceca3099fd409f6ea4ba8 /Server/LogSingleton.cs |
Initial commit.
Diffstat (limited to 'Server/LogSingleton.cs')
-rw-r--r-- | Server/LogSingleton.cs | 40 |
1 files changed, 40 insertions, 0 deletions
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<ClientConnection> ConnectedClients { get; set; } + + private LogSingleton() + { + ConnectedClients = new List<ClientConnection>(); + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +} |