From 1e3e8acb3e38ff05c137833c525c3c5f1a0b8978 Mon Sep 17 00:00:00 2001 From: elchananarb Date: Tue, 24 Dec 2024 10:36:32 +0200 Subject: [PATCH] fix --- .../Commands/AddExtensionWindowCmd.cs | 1 + .../CxExtension/CxWindowPackage.cs | 16 +--------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/ast-visual-studio-extension/CxExtension/Commands/AddExtensionWindowCmd.cs b/ast-visual-studio-extension/CxExtension/Commands/AddExtensionWindowCmd.cs index 3d66acc..97c9c6b 100644 --- a/ast-visual-studio-extension/CxExtension/Commands/AddExtensionWindowCmd.cs +++ b/ast-visual-studio-extension/CxExtension/Commands/AddExtensionWindowCmd.cs @@ -28,6 +28,7 @@ private CxWindowCommand(AsyncPackage package, OleMenuCommandService commandServi var menuCommandID = new CommandID(CommandSet, CxWindowCommandId); var menuItem = new MenuCommand(this.Execute, menuCommandID); commandService.AddCommand(menuItem); + InitializeInBackground(); } public static CxWindowCommand Instance diff --git a/ast-visual-studio-extension/CxExtension/CxWindowPackage.cs b/ast-visual-studio-extension/CxExtension/CxWindowPackage.cs index aa764c4..172946c 100644 --- a/ast-visual-studio-extension/CxExtension/CxWindowPackage.cs +++ b/ast-visual-studio-extension/CxExtension/CxWindowPackage.cs @@ -41,7 +41,6 @@ public sealed class CxWindowPackage : AsyncPackage private static bool isInitialized = false; - #region Package Members /// @@ -60,23 +59,10 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. - - // Command to create Checkmarx extension main window - // Check credentials and open window await this.JoinableTaskFactory.SwitchToMainThreadAsync(); - if (CxUtils.AreCxCredentialsDefined(this) && !isInitialized) - { - await CxWindowCommand.InitializeAsync(this); - isInitialized = true; - await Task.Delay(1000, cancellationToken); - CxWindowCommand.Instance.InitializeInBackground(); - return; - } + // Command to create Checkmarx extension main window await CxWindowCommand.InitializeAsync(this); - - - } catch (Exception ex) {