public int ConvertAllSvgToIco(string folder, bool recursive, bool refresh, int[] sizes,
                                      int maxDegreeOfParallelism)
        {
            var resultCode      = 0;
            var iconInfos       = _iconInfoProvider.GetIconInfos(folder, recursive, sizes);
            var parallelOptions = new ParallelOptions()
            {
                MaxDegreeOfParallelism = maxDegreeOfParallelism
            };

            Parallel.ForEach(iconInfos, parallelOptions, (iconInfo, state) =>
            {
                try
                {
                    var isupdated      = ConvertSvgToPngs(iconInfo, sizes, refresh);
                    var iconFileExists = iconInfo.IconFile.Exists;
                    if (isupdated || !iconFileExists || refresh)
                    {
                        _imageMagicProvider.CreateIconFromPngFilesFromSvg(iconInfo);
                    }
                    else
                    {
                        _logger.Info("Icon up to date: " + iconInfo.IconFile.FullName);
                    }
                }
                catch (Exception ex)
                {
                    _logger.Error(ex.Message);
                }
            });
            return(resultCode);
        }
        public Result <int> ConvertSvgToIco(string svgFileName, int[] sizes, bool refresh)
        {
            var exitCode = 0;

            VerifySvgFile(svgFileName);

            var iconInfo = new IconInfo(svgFileName, sizes);

            if (refresh || iconInfo.NeedUpdate())
            {
                _inkscapeProvider.ExportSvgToPngs(iconInfo);
                _imageMagicProvider.CreateIconFromPngFilesFromSvg(iconInfo);
            }
            else
            {
                _logger.Info("Icon up to date: " + iconInfo.IconFile.FullName);
            }
            return(Result.Ok(exitCode));
        }