public Task ExecuteCommand(CancellationToken token)
        {
            var task = Task.Run((Action)ConsoleActions.WriteConsoleParent, token)
                       .ContinueWith(x => ConsoleActions.WriteConsoleChild());

            return(task);
        }
        public Task ExecuteCommand(CancellationToken token)
        {
            var task = Task.Run((Action)ConsoleActions.WriteConsoleParent)
                       .ContinueWith(x => ConsoleActions.WriteConsoleChild(), TaskContinuationOptions.NotOnRanToCompletion);

            return(task);
        }
Exemple #3
0
        public Task ExecuteCommand(CancellationToken token)
        {
            var task = Task.Factory.StartNew(ConsoleActions.WriteConsoleParent)
                       .ContinueWith(x => ConsoleActions.WriteConsoleChild(), TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously);

            return(task);
        }
        public Task ExecuteCommand(CancellationToken token)
        {
            token.Register(ConsoleActions.WriteConsoleChild, false);
            var task = Task.Factory.StartNew(ConsoleActions.WriteConsoleParent)
                       .ContinueWith(x => ConsoleActions.WriteConsoleChild(), token);

            return(task);
        }