Beispiel #1
0
        public void OnAllPersonsChanged()
        {
            PersonsUpdateHistory.Append("Update: ").Append(PrintPersons()).AppendLine();

            var accounts = new List <ViewerAccount>();

            if (_showMan != null)
            {
                accounts.Add(_showMan);
            }

            try
            {
                AllPersons = accounts.Concat(_players).Concat(_viewers)
                             .Where(account => account.IsConnected)
                             .ToDictionary(account => account.Name);
            }
            catch (ArgumentException exc)
            {
                throw new Exception($"OnAllPersonsChanged error: {PersonsUpdateHistory}", exc);
            }

            if (!AllPersons.ContainsKey(Name))
            {
                throw new Exception($"!AllPersons.ContainsKey({Name})! {string.Join(",", AllPersons.Keys)} {PersonsUpdateHistory}");
            }
        }
Beispiel #2
0
        public void OnAllPersonsChanged()
        {
            AllPersons = new ViewerAccount[] { _showMan }
            .Concat(Players)
            .Concat(Viewers)
            .Where(a => a.IsConnected)
            .ToDictionary(a => a.Name);

            PersonsUpdateHistory.Append($"Update: ").Append(PrintPersons());
        }
Beispiel #3
0
        public void OnAllPersonsChanged()
        {
            try
            {
                AllPersons = new ViewerAccount[] { _showMan }
                .Concat(Players)
                .Concat(Viewers)
                .Where(a => a.IsConnected)
                .ToDictionary(a => a.Name);
            }
            catch (ArgumentException exc)
            {
                throw new Exception($"OnAllPersonsChanged error: {PersonsUpdateHistory}", exc);
            }

            PersonsUpdateHistory.Append($"Update: ").Append(PrintPersons());
        }