예제 #1
0
        /// <summary>
        /// Initializes the singleton instance of the command.
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        public static async Task InitializeAsync(AsyncPackage package)
        {
            // Switch to the main thread - the call to AddCommand in ShareVulnerabilityFromHistoryCommand's constructor requires
            // the UI thread.
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Instance = new ShareVulnerabilityFromHistoryCommand(package, commandService);
        }
 public ShareVulnerabilityDialog(ShareVulnerabilityFromHistoryCommand shareVulnerabilityFromHistoryCommand)
 {
     InitializeComponent();
     Width      = 800;
     Height     = 450;
     ResizeMode = ResizeMode.NoResize;
     Title      = "Share Vulnerability With MICScan";
     cweEntries = cweEntries.OrderBy(c => c.Title).ToList();
     cweEntries.Insert(0, new CweEntry {
         Title = "Other"
     });
     shareButton.IsEnabled = false;
     viewDescriptionHyperlink.IsEnabled        = false;
     this.shareVulnerabilityFromHistoryCommand = shareVulnerabilityFromHistoryCommand;
 }