Esempio n. 1
0
        private async void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (dataGrid.SelectedItems.Count != 1 || uiService == null)
            {
                return;
            }


            var handle = uiService.StartIndicateLongOperation("Loading output for the benchmark...");

            try
            {
                ShowOutput w = new ShowOutput();
                w.Owner = this;
                w.Show();

                CompareBenchmarksViewModel elem = (CompareBenchmarksViewModel)dataGrid.SelectedItem;
                int inx = dataGrid.CurrentCell.Column.DisplayIndex;
                BenchmarkResultViewModel result = (inx == 1 || inx == 3 || inx == 5 || inx >= 8 && inx <= 10 || inx == 14) ? elem.Results1 : elem.Results2;

                string stdout = await result.GetStdOutAsync(true);

                string stderr = await result.GetStdErrAsync(true);

                ShowOutputViewModel vm = new ShowOutputViewModel(result.ID, elem.Filename, stdout, stderr);
                w.DataContext = vm;
            }
            finally
            {
                uiService.StopIndicateLongOperation(handle);
            }
        }
Esempio n. 2
0
        public async Task <ShowOutputViewModel> GetOutputViewModel()
        {
            var handle = uiService.StartIndicateLongOperation("Loading benchmark output...");

            try
            {
                return(await Task.Run(async() =>
                {
                    string stdOut = await GetStdOutAsync(true);
                    string stdErr = await GetStdErrAsync(true);
                    ShowOutputViewModel vm = new ShowOutputViewModel(ID, Filename, stdOut, stdErr);
                    return vm;
                }));
            }
            finally
            {
                uiService.StopIndicateLongOperation(handle);
            }
        }