Azure.ApiManagement.IngestTool.StartApimImportWizardCommand.MenuItemCallback C# (CSharp) Method

MenuItemCallback() private method

This function is the callback used to execute the command when the menu item is clicked. See the constructor to see how the menu item is associated with this function using OleMenuCommandService service and MenuCommand class.
private MenuItemCallback ( object sender, EventArgs e ) : void
sender object Event sender.
e System.EventArgs Event args.
return void
        private void MenuItemCallback(object sender, EventArgs e)
        {
            var dte = (DTE)ServiceProvider.GetService(typeof(DTE));
            var projects = (Array)dte.ActiveSolutionProjects;

            foreach (var item in projects)
            {
                Project project = (EnvDTE.Project)item;
                IVsSolution solution = (IVsSolution)ServiceProvider.GetService(typeof(IVsSolution));
                IVsHierarchy hierarchy = null;
                solution.GetProjectOfUniqueName(project.UniqueName, out hierarchy);

                if (this.ConnectedServicesManager == null)
                    (Package.GetGlobalService(typeof(SComponentModel)) as IComponentModel)
                        .DefaultCompositionService.SatisfyImportsOnce(this);

                ConnectedServicesManager.ConfigureServiceAsync(Constants.CONNECTED_SERVICE_NAME, hierarchy);
            }
        }