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);
}
}