Beispiel #1
0
        private void ApplicationExitHandler(object sender, EventArgs e)
        {
            _log.Information(LogHelper.GetMethodName(this), "Exit process started");

            if (File.Exists(_config.StaticConfig.AlbumArtImagePath))
            {
                _log.Information(LogHelper.GetMethodName(this), $"Delete album art");
                File.Delete(_config.StaticConfig.AlbumArtImagePath);
            }

            if (!_config.ExternalConfig.LeaveShorcutInStartMenu)
            {
                _shortcutHelper.DeleteShortcut();
                _log.Information(LogHelper.GetMethodName(this), $"Shortcut removed from start menu");
            }

            _rpTrayIcon.Dispose();

            if (_config.ExternalConfig.DeleteAllData)
            {
                _shortcutHelper.DeleteShortcut();
                _config.ExternalConfig.DeleteConfigRootFolder();
            }
            else
            {
                _log.Information(LogHelper.GetMethodName(this), $@"Finished
********************************************************************
********************************************************************
********************************************************************
********************************************************************
********************************************************************");
            }
        }