Beispiel #1
0
        public CommandPromptOutputViewerViewModel GetLogFromOutput(string header, string output)
        {
            var vm = CommandPromptOutputViewerViewModel.Create(header);

            vm.CommandPromptOutput  = HtmlTemplate;
            vm.CommandPromptOutput += output.PrintWithPreTag(color: DefaultColor);
            return(vm);
        }
Beispiel #2
0
        public CommandPromptOutputViewerViewModel GetLog(string header, string logFile)
        {
            try
            {
                using (var fileStream = File.Open(logFile.Replace(@"""", string.Empty), FileMode.Open))
                {
                    var vm = CommandPromptOutputViewerViewModel.Create(header);
                    vm.CommandPromptOutput  = HtmlTemplate;
                    vm.CommandPromptOutput += fileStream
                                              .ReadToString().Encode()
                                              .PrintWithPreTag(color: DefaultColor);
                    return(vm);
                }
            }
            catch (Exception exp)
            {
                Trace.TraceError("Unable to Create Log {0}", exp);
            }

            return(null);
        }