summaryrefslogtreecommitdiff
blob: 158440dd5f8fda3ba907ec0db276ed07aea2b516 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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));
		}
	}
}