<commit_before>﻿using System.ComponentModel.Composition;

namespace NuGet.VisualStudio
{
    [Export(typeof(IVsPackageInstallerEvents))]
    [Export(typeof(VsPackageInstallerEvents))]
    public class VsPackageInstallerEvents : IVsPackageInstallerEvents
    {
        public event VsPackageEventHandler PackageInstalled;

        public event VsPackageEventHandler PackageUninstalling;

        public event VsPackageEventHandler PackageInstalling;

        public event VsPackageEventHandler PackageUninstalled;

        public event VsPackageEventHandler PackageReferenceAdded = delegate { };

        public event VsPackageEventHandler PackageReferenceRemoved = delegate { }; 

        internal void NotifyInstalling(PackageOperationEventArgs e)<commit_msg>VsPackageInstallerEvents hook up<commit_after>﻿using NuGet.PackageManagement;
using System.Collections.Generic;
using System.ComponentModel.Composition;

namespace NuGet.VisualStudio
{
    [Export(typeof(IVsPackageInstallerEvents))]
    [Export(typeof(VsPackageInstallerEvents))]
    public class VsPackageInstallerEvents : IVsPackageInstallerEvents
    {
        public event VsPackageEventHandler PackageInstalled;

        public event VsPackageEventHandler PackageUninstalling;

        public event VsPackageEventHandler PackageInstalling;

        public event VsPackageEventHandler PackageUninstalled;

        public event VsPackageEventHandler PackageReferenceAdded = delegate { };

        public event VsPackageEventHandler PackageReferenceRemoved = delegate { };

        private readonly PackageEvents _eventSource;

        [ImportingConstructor]
        public VsPackageInstallerEvents(IPackageEventsProvider eventProvider)
        {
            _eventSource = eventProvider.GetPackageEvents();

            _eventSource.PackageInstalled += Source_PackageInstalled;
            _eventSource.PackageInstalling += Source_PackageInstalling;
            _eventSource.PackageReferenceAdded += Source_PackageReferenceAdded;
            _eventSource.PackageReferenceRemoved += Source_PackageReferenceRemoved;
            _eventSource.PackageUninstalled += Source_PackageUninstalled;
            _eventSource.PackageUninstalling += Source_PackageUninstalling;
        }

        private void Source_PackageUninstalling(object sender, PackageEventArgs e)
        {
            NotifyUninstalling(new PackageOperationEventArgs(e.InstallPath, e.Identity, null));
        }

        private void Source_PackageUninstalled(object sender, PackageEventArgs e)
        {
            NotifyUninstalled(new PackageOperationEventArgs(e.InstallPath, e.Identity, null));
        }

        private void Source_PackageReferenceRemoved(object sender, PackageEventArgs e)
        {
            NotifyReferenceRemoved(new PackageOperationEventArgs(e.InstallPath, e.Identity, null));
        }

        private void Source_PackageReferenceAdded(object sender, PackageEventArgs e)
        {
            NotifyReferenceAdded(new PackageOperationEventArgs(e.InstallPath, e.Identity, null));
        }

        private void Source_PackageInstalling(object sender, PackageEventArgs e)
        {
            NotifyInstalling(new PackageOperationEventArgs(e.InstallPath, e.Identity, null));
        }

        private void Source_PackageInstalled(object sender, PackageEventArgs e)
        {
            NotifyInstalled(new PackageOperationEventArgs(e.InstallPath, e.Identity, null));
        }

        internal void NotifyInstalling(PackageOperationEventArgs e)
{'fraction_non_alphanumeric': 0.056776034236804565, 'fraction_numerical': 0.0, 'mean_word_length': 3.725067385444744, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3138462', 'n_tokens_mistral': 830, 'n_tokens_neox': 802, 'n_words': 167}