Asgard.BifrostClient.OnRaiseDisconnectedEvent C# (CSharp) Метод

OnRaiseDisconnectedEvent() приватный Метод

private OnRaiseDisconnectedEvent ( NetConnection connection ) : void
connection Lidgren.Network.NetConnection
Результат void
        private void OnRaiseDisconnectedEvent(NetConnection connection)
        {
            if (OnDisconnect == null) return;

            List<Exception> exceptions = null;

            var handlers = OnDisconnect.GetInvocationList();
            foreach (OnDisconnectHandler handler in handlers)
            {
                try
                {
                    handler((NetNode)connection);
                }
                catch (Exception e)
                {
                    if (exceptions == null)
                    {
                        exceptions = new List<Exception>();
                    }
                    exceptions.Add(e);
                    //TODO: log error maybe fail after all called.
                }
            }

            if (exceptions != null)
            {
                throw new AggregateException("handler error", exceptions);
            }

            return;
        }