Run() public method

public Run ( CancellationToken cancellationToken, Action log ) : void
cancellationToken System.Threading.CancellationToken
log Action
return void
        static void Main(string[] args)
        {
            var program = new Program();

            var tokenSource = new CancellationTokenSource();
            Console.CancelKeyPress += (sender, eventArgs) =>
                {
                    // NOTE: This cancelling logic does not work in the VS2010 debugger with .Net 4, but does fine otherwise
                    tokenSource.Cancel();
                    eventArgs.Cancel = true;
                };

            program.Run(tokenSource.Token, Console.WriteLine);
        }