private void txtDrillDown_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.F5) { if (this.idQueryCTS != null) { this.idQueryCTS.Cancel(); } this.idQueryCTS = new CancellationTokenSource(); string query = this.txtDrillDown.Text; QueryWindowHelpers.ExecuteQueryAsync(this.Model, query, this.Model.GetPlayback(), this.idQueryCTS, (type, result) => { this.gridDetails.ItemsSource = result; return(null); }); this.Show(); } }
private void ExecuteRunQuery(object param) { ResetQuery(); this.ResultPanel.Children.Clear(); this.ResultPanel.RowDefinitions.Clear(); this.ChartPane.Children.Clear(); this.ChartPane.RowDefinitions.Clear(); Playback scope = this.View.QueryModel.GetPlayback(); StringWriter errors = new StringWriter(); StringWriter output = new StringWriter(); this.View.QueryModel.Status = "Executing Query"; QueryWindowHelpers.ExecuteQueryAsync(this.View.QueryModel, this.View.EditorModel.QueryString, scope, this.queryCancelationToken, (type, result) => { return(this.OnStartQuery(type, result)); }); }
private void txtDurationQuery_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.F5) { if (this.drillDownCTS != null) { drillDownCTS.Cancel(); } drillDownCTS = new CancellationTokenSource(); string query = this.txtDurationQuery.Text; QueryWindowHelpers.ExecuteQueryAsync(this.Model, query, this.Model.GetPlayback(), drillDownCTS, (type, result) => { this.gridDuration.ItemsSource = result; Action completion = () => { bool hasX, hasY; if (QueryWindowHelpers.CanShowChart(type, out hasX, out hasY)) { QueryWindowHelpers.PopulateChart(this.histogramChart, hasX, type, result); } else { this.histogramChart.Visibility = Visibility.Collapsed; } }; return(completion); }); this.Show(); } }