Exemplo n.º 1
0
        public static async Task OutputMessageAsync(IAsyncServiceProvider serviceProvider, String message)
        {
            await TaskScheduler.Default;
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            OutputPane outputPane = OutputPane.Create(serviceProvider);

            OutputTimestamp(outputPane);
            outputPane.WriteLine(message);
            outputPane.WriteLine("");
        }
Exemplo n.º 2
0
        public static async Task OutputExecutionResultAsync(IAsyncServiceProvider serviceProvider, String message, ExecutionResult result)
        {
            await TaskScheduler.Default;
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            OutputPane outputPane = OutputPane.Create(serviceProvider);

            OutputTimestamp(outputPane);
            outputPane.WriteLine(message);
            if (!String.IsNullOrEmpty(result.OutputData))
            {
                outputPane.WriteLine("Output:");
                outputPane.WriteLine(result.OutputData);
            }
            if (!String.IsNullOrEmpty(result.ErrorData))
            {
                outputPane.WriteLine("Error:");
                outputPane.WriteLine(result.ErrorData);
            }
            outputPane.WriteLine("");
        }
Exemplo n.º 3
0
 private static void OutputTimestamp(OutputPane outputPane)
 {
     ThreadHelper.ThrowIfNotOnUIThread();
     outputPane.Write($"[{DateTime.Now:HH:mm:ss}] ");
 }