Beispiel #1
0
        private void invokeOnOpen()
        {
            if (OnOpen == null)
            {
                return;
            }

            try
            {
                var members = OnOpen.GetInvocationList().Cast <Func <Task> >();

                Task.WhenAll(members.Select(x => x()))
                .ContinueWith(t => InvokeOnError(t.Exception), TaskContinuationOptions.OnlyOnFaulted);
                //.Wait(0);
            }
            catch (Exception ex) when(ex.InnerException is TaskCanceledException)
            {
            }
        }