Beispiel #1
0
        static void Main(string[] args)
        {
            // Init Transcript Recorder Session Manager
            _appSession = new TranscriptRecorderSessionManager();

            // Cancel token to terminate program early on cntrl + c
            CancellationTokenSource cts = new CancellationTokenSource();

            System.Console.CancelKeyPress += (s, e) =>
            {
                e.Cancel = true;
                cts.Cancel();
            };

            try
            {
                _appSession.RunAsync(cts.Token).Wait();
            }
            catch (Exception e)
            {
                NonBlockingConsole.WriteLine("TranscriptRecorderSessionManager exited with exception: " + e.ToString());
            }
            finally
            {
                Task shutdownTask = _appSession.ShutdownAsync();
                shutdownTask.Wait();
            }
        }
        static void Main(string[] args)
        {
            // Init Transcript Recorder Session Manager
            _appSession = new TranscriptRecorderSessionManager();

            // Cancel token to terminate program early on cntrl + c
            CancellationTokenSource cts = new CancellationTokenSource();
            System.Console.CancelKeyPress += (s, e) =>
            {
                e.Cancel = true;
                cts.Cancel();
            };

            try
            {
                _appSession.RunAsync(cts.Token).Wait();
            }
            catch (Exception e)
            {
                NonBlockingConsole.WriteLine("TranscriptRecorderSessionManager exited with exception: " + e.ToString());
            }
            finally
            {
                Task shutdownTask = _appSession.ShutdownAsync();
                shutdownTask.Wait();
            }
        }