Ejemplo n.º 1
0
        protected override void Initialize()
        {
            base.Initialize();

            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainAssemblyResolve;

            _solution = Services.GetService <SVsSolution, IVsSolution2>();
            if (_solution != null)
            {
                _solution.AdviseSolutionEvents(this, out solutionEventsCookie).ThrowOnFailure();
            }

            _dte         = Services.GetService <DTE>();
            _events      = (Events2)_dte.Events;
            _buildEvents = _events.BuildEvents;
            _buildEvents.OnBuildBegin += OnBuildBegin;
            _buildEvents.OnBuildDone  += OnBuildDone;
            new PackageCommands(this).AddCommands();

            IconHost = VsStatusBarIconHost.CreateAndInjectIntoVsStatusBar();

            Instance = this;

            TelemetryClient.Initialize(Constants.ProductVersion, _dte.Version, _dte.Edition);

            Logger.LogInfo("Initialized Package successfully.");
        }
Ejemplo n.º 2
0
        public static VsStatusBarIconHost CreateAndInjectIntoVsStatusBar()
        {
            Logger.LogInfo("Attempting to inject icon into VS' status bar.");

            VsStatusBarIconHost iconHost = new VsStatusBarIconHost();

            iconHost.InjectControl();

            return(iconHost);
        }