private void OnInsertTableSelectionChanged(object sender, TableSelectionChangedEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex >= 0) { this.radRichTextBox1.InsertTable(e.RowIndex + 1, e.ColumnIndex + 1); } }
public override void PostprocessSelectionChanged(TableSelectionChangedEventArgs e) { base.PostprocessSelectionChanged(e); foreach (var processor in _additionalEventProcessors) { processor.PostprocessSelectionChanged(e); } }
public override void PreprocessSelectionChanged(TableSelectionChangedEventArgs e) { ThreadHelper.ThrowIfNotOnUIThread(); ProjectSystemToolsPackage.UpdateQueryStatus(); base.PreprocessSelectionChanged(e); }
/// <summary> /// Updates suppression state information when the selected entries change in the error list. /// </summary> public void ProcessSelectionChanged(TableSelectionChangedEventArgs e) { var hasAddedSuppressionStateEntry = ProcessEntries(e.AddedEntries, added: true); var hasRemovedSuppressionStateEntry = ProcessEntries(e.RemovedEntries, added: false); // If any entry that supports suppression state was ever involved, update query status since each item in the error list // can have different context menu. if (hasAddedSuppressionStateEntry || hasRemovedSuppressionStateEntry) { UpdateQueryStatus(); } InitializeFromTableControlIfNeeded(); }
/// <summary> /// Handles the single-click Error List event. /// Binds the selected item to the Tool Window. /// Does not show the tool window if it is not already open. Displaying of the tool window is handed by PreprocessNavigate. /// </summary> public override void PreprocessSelectionChanged(TableSelectionChangedEventArgs e) { SarifErrorListItem sarifResult; ListView errorList = (ListView)e.SelectionChangedEventArgs.Source; if (errorList.SelectedItems.Count != 1) { // There's more, or less, than one selected item. Clear the SARIF Explorer. SarifViewerPackage.SarifToolWindow.Control.DataContext = null; return; } ITableEntryHandle entryHandle = errorList.SelectedItems[0] as ITableEntryHandle; if (!TryGetSarifResult(entryHandle, out sarifResult)) { // The selected item is not a SARIF result. Clear the SARIF Explorer. SarifViewerPackage.SarifToolWindow.Control.DataContext = null; return; } // Set the current sarif error in the manager so we track code locations. CodeAnalysisResultManager.Instance.CurrentSarifError = sarifResult; if (sarifResult.HasDetails) { // Setting the DataContext to be null first forces the TabControl to select the appropriate tab. SarifViewerPackage.SarifToolWindow.Control.DataContext = null; SarifViewerPackage.SarifToolWindow.Control.DataContext = sarifResult; } else { SarifViewerPackage.SarifToolWindow.Control.DataContext = null; } if (sarifResult.Locations?.Count > 0) { sarifResult.Locations[0].ApplyDefaultSourceFileHighlighting(); } base.PreprocessSelectionChanged(e); }
void ITableControlEventProcessor.PostprocessSelectionChanged(TableSelectionChangedEventArgs e) { try { IAnalysisIssueVisualization selected = null; if (wpfTableControl.SelectedEntries.Count() == 1 && wpfTableControl.SelectedEntry.TryGetSnapshot(out var snapshot, out var index) && snapshot.TryGetValue(index, SonarLintTableControlConstants.IssueVizColumnName, out var issueObject) && issueObject is IAnalysisIssueVisualization issueFromTable) { selected = issueFromTable; } selectionService.SelectedIssue = selected; } catch (Exception ex) when(!ErrorHandler.IsCriticalException(ex)) { // No-op } }
public override void PostprocessSelectionChanged(TableSelectionChangedEventArgs e) { // Update the suppression state information for the new error list selection. _suppressionStateService.ProcessSelectionChanged(e); }
/// <summary> /// Handles the single-click Error List event. /// Binds the selected item to the Tool Window. /// Does not show the tool window if it is not already open. Displaying of the tool window is handed by PreprocessNavigate. /// </summary> public override void PreprocessSelectionChanged(TableSelectionChangedEventArgs e) { SarifErrorListItem sarifResult; ListView errorList = (ListView)e.SelectionChangedEventArgs.Source; // Remove all source code highlighting CodeAnalysisResultManager.Instance.DetachFromAllDocuments(); if (errorList.SelectedItems.Count != 1) { // There's more, or less, than one selected item. Clear the SARIF Explorer. SarifViewerPackage.SarifToolWindow.Control.DataContext = null; return; } ITableEntryHandle entryHandle = errorList.SelectedItems[0] as ITableEntryHandle; if (!TryGetSarifResult(entryHandle, out sarifResult)) { // The selected item is not a SARIF result. Clear the SARIF Explorer. SarifViewerPackage.SarifToolWindow.Control.DataContext = null; return; } if (sarifResult.HasDetails) { // Setting the DataContext to be null first forces the TabControl to select the appropriate tab. SarifViewerPackage.SarifToolWindow.Control.DataContext = null; SarifViewerPackage.SarifToolWindow.Control.DataContext = sarifResult; } else { SarifViewerPackage.SarifToolWindow.Control.DataContext = null; } // Set the current sarif error in the manager so we track code locations. CodeAnalysisResultManager.Instance.CurrentSarifError = sarifResult; base.PreprocessSelectionChanged(e); }
void ITableControlEventProcessor.PreprocessSelectionChanged(TableSelectionChangedEventArgs args) { }
public override void PreprocessSelectionChanged(TableSelectionChangedEventArgs e) { ProjectSystemToolsPackage.UpdateQueryStatus(); base.PreprocessSelectionChanged(e); }