Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ast-visual-studio-extension/CxExtension/CxWindowControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.AccentDarkKey}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ActiveBorderKey}}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</Style.Triggers>
</Style>
<Style BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" TargetType="{x:Type Separator}" x:Key="SeparatorStyle">
Expand Down
31 changes: 20 additions & 11 deletions ast-visual-studio-extension/CxExtension/Toolbar/CxToolbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
StateManagerProvider.GetStateManager().enabledCustemStates.Add(state.name);
}
}

}
}

Expand Down Expand Up @@ -406,7 +406,7 @@

private static async Task<bool> ASTProjectMatchesWorkspaceProjectAsync(EnvDTE.DTE dte)
{
if (ResultsTreePanel.currentResults == null | ResultsTreePanel.currentResults.results == null || ResultsTreePanel.currentResults.results.Any())
if (ResultsTreePanel.currentResults == null || ResultsTreePanel.currentResults.results == null || ResultsTreePanel.currentResults.results.Any())
{
return false;
}
Expand Down Expand Up @@ -516,16 +516,25 @@
const string additionalParamaters = "{0} {1} {2}";

UpdateStatusBar(CxConstants.STATUS_CREATING_SCAN);
Scan scan = await cxWrapper.ScanCreateAsync(parameters, string.Format(additionalParamaters, CxCLI.CxConstants.FLAG_ASYNC, CxCLI.CxConstants.FLAG_INCREMENTAL, CxCLI.CxConstants.FLAG_RESUBMIT));

if (scan != null)
try
{
SettingsUtils.StoreToolbarValue(Package, SettingsUtils.toolbarCollection, SettingsUtils.createdScanIdProperty, scan.ID);
UpdateStatusBar(string.Format(CxConstants.STATUS_FORMAT_CREATED_SCAN, scan.ID));
Scan scan = await cxWrapper.ScanCreateAsync(parameters, string.Format(additionalParamaters, CxCLI.CxConstants.FLAG_ASYNC, CxCLI.CxConstants.FLAG_INCREMENTAL, CxCLI.CxConstants.FLAG_RESUBMIT));


if (scan != null)
{
SettingsUtils.StoreToolbarValue(Package, SettingsUtils.toolbarCollection, SettingsUtils.createdScanIdProperty, scan.ID);
UpdateStatusBar(string.Format(CxConstants.STATUS_FORMAT_CREATED_SCAN, scan.ID));
}
else
{
UpdateStatusBar(CxConstants.STATUS_CREATING_SCAN_FAILED);
}
}
else
catch (Exception ex)

Check warning on line 534 in ast-visual-studio-extension/CxExtension/Toolbar/CxToolbar.cs

View workflow job for this annotation

GitHub Actions / integration-tests

The variable 'ex' is declared but never used

Check warning on line 534 in ast-visual-studio-extension/CxExtension/Toolbar/CxToolbar.cs

View workflow job for this annotation

GitHub Actions / integration-tests

The variable 'ex' is declared but never used
{
UpdateStatusBar(CxConstants.STATUS_CREATING_SCAN_FAILED);
throw;
}
}

Expand All @@ -538,7 +547,7 @@

// Try to get directory from solution or active projects
string directory = null;

if (!string.IsNullOrEmpty(dte?.Solution?.FullName))
{
// Solution is loaded - get its directory or use the path itself if it's a directory
Expand Down Expand Up @@ -577,7 +586,7 @@
// Now search for .sln or .csproj in the directory
if (!string.IsNullOrEmpty(directory) && System.IO.Directory.Exists(directory))
{
return FindSolutionFileOrDirectory(directory);
return FindSolutionFileOrDirectory(directory);
}

return null;
Expand Down Expand Up @@ -697,4 +706,4 @@
});
}
}
}
}
Loading