/// <summary>
        /// Checks if the active project has changed
        /// </summary>
        /// <param name="oldActiveProject">The file name of the old active project</param>
        private void CheckActiveProjectChange(string oldActiveProject)
        {
            _lastCollectedActiveProject = ActiveProject?.Root?.FileName;
            if (oldActiveProject == _lastCollectedActiveProject) return;

            var oldProject = Projects.FirstOrDefault(p => p.Root.FileName == oldActiveProject);
            var newProject = Projects.FirstOrDefault(p => p.Root.FileName == _lastCollectedActiveProject);
            ActiveProjectChanged?.Invoke(this, 
                new ActiveProjectChangedEventArgs(oldProject, newProject));
            if (newProject == null) return;

            SpectNetPackage.Log($"New active project: {newProject.Root.FileName}");
        }
Beispiel #2
0
 protected virtual void OnActiveProjectChanged(EventArgs e)
 {
     ActiveProjectChanged?.Invoke(this, EventArgs.Empty);
 }
 /// <summary>
 /// Raises the ActiveProjectChanged event.
 /// </summary>
 private void OnActiveProjectChanged(ProjectEventArgs e)
 {
     ActiveProjectChanged?.Invoke(this, e);
 }