private void OnActionsExecuted(object sender, ActionsExecutedEventArgs e)
        {
            Assumes.NotNull(e);

            if (e.Actions == null)
            {
                return;
            }

            string[] projectIds = e.Actions
                                  .Select(action => action.Project.GetMetadata <string>(NuGetProjectMetadataKeys.ProjectId))
                                  .Distinct()
                                  .ToArray();

            if (projectIds.Length > 0)
            {
                RaiseProjectActionsExecuted(projectIds);
            }
        }
Example #2
0
        private void SolutionManager_ActionsExecuted(object sender, ActionsExecutedEventArgs e)
        {
            if (Model.IsSolution)
            {
                Refresh();
            }
            else
            {
                // this is a project package manager, so there is one and only one project.
                var project     = Model.Context.Projects.First();
                var projectName = NuGetProject.GetUniqueNameOrName(project);

                // we need refresh when packages are installed into or uninstalled from the project
                if (e.Actions.Any(action =>
                                  NuGetProject.GetUniqueNameOrName(action.Project) == projectName))
                {
                    Refresh();
                }
            }
        }