Exemplo n.º 1
0
        int IVsSelectionEvents.OnElementValueChanged(uint elementid, object varValueOld, object varValueNew)
        {
            if (elementid == (uint)VSConstants.VSSELELEMID.SEID_StartupProject)
            {
                StartupProjectChanged?.Invoke((IVsHierarchy)varValueNew);
            }

            return(VSConstants.S_OK);
        }
Exemplo n.º 2
0
        int IVsSelectionEvents.OnElementValueChanged(uint elementid, object varValueOld, object varValueNew)
        {
            if (elementid == (uint)VSConstants.VSSELELEMID.SEID_StartupProject)
            {
                StartupProjectChanged?.Invoke(this, new StartupProjectChangedEventArgs(
                                                  solutionBrowser.EnumerateStartupProjects().ToList()));
            }

            return(VSConstants.S_OK);
        }
 int IVsSelectionEvents.OnElementValueChanged(uint elementid, object varValueOld, object varValueNew)
 {
     if (elementid == (uint)VSConstants.VSSELELEMID.SEID_StartupProject)
     {
         if (varValueNew != null)
         {
             StartupProjectChanged?.Invoke(this, EventArgs.Empty);
         }
     }
     return(S_OK);
 }
        private void OnStartupProjectChanged(IVsHierarchy startupProjectHierarchy)
        {
            StartupProjectChanged?.Invoke(this, EventArgs.Empty);

            var curStartUpProjects = StartupProjectUniqueNames().ToList();

            SynchronizationContext context = SynchronizationContext.Current;

            _startupProjectCheckTimer?.Dispose();
            _startupProjectCheckTimer = new Timer(
                (ignore) =>
            {
                _startupProjectCheckTimer?.Dispose();
                context.Post(ignore2 =>
                {
                    var newStartUpProjects = StartupProjectUniqueNames().ToList();
                    if (newStartUpProjects.Count != curStartUpProjects.Count || newStartUpProjects.Zip(curStartUpProjects, (s1, s2) => s1 != s2).Any(b => b))
                    {
                        StartupProjectChanged?.Invoke(this, EventArgs.Empty);
                    }
                }, null);
            }, null, 500, Timeout.Infinite);
        }
 private void OnStartupProjectChanged(IVsHierarchy startupProjectHierarchy)
 {
     StartupProjectChanged?.Invoke(this, EventArgs.Empty);
 }