Exemplo n.º 1
0
        /// <inheritdoc />
        /// <summary>
        ///     Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            if (Target != null)
            {
                Target.QueryCurrentStartupProjects -= Solution_QueryCurrentStartupProjects;
                Target.QueryStartupProjects        -= Solution_QueryStartupProjects;
                Target.QueryConfiguration          -= Solution_QueryConfiguration;
                Target.ParseConfiguration          -= Solution_ParseConfiguration;
                Target.CurrentProfileChanged       -= Solution_CurrentProfileChanged;
                Target.Opened               -= Solution_Opened;
                Target.ClosingProject       -= Solution_ClosingProject;
                Target.OpenedProject        -= Solution_OpenedProject;
                Target.ConfigurationChanged -= Solution_ConfigurationChanged;
            }

            if (_configurationFileTrackers != null)
            {
                _configurationFileTrackers.ForEach(s =>
                {
                    s.FileChanged -= ConfigurationFileTracker_FileChanged;
                    s.Stop();
                });
                _configurationFileTrackers.Clear();
            }

            _projectCache?.Dispose();
        }