public override async Task LoadConfigAsync(CancellationToken ct)
        {
            var tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
            var sourceUrl  = $"{_cdnUrl}/config.json";
            var fileTarget = Path.Combine(tempFolder, "config.json");

            Fs.EnsureFolderExists(tempFolder);

            await DownloadContentAsync(sourceUrl, fileTarget, ct);

            Config = TemplatesSourceConfig.LoadFromFile(fileTarget);

            Fs.SafeDeleteDirectory(tempFolder);
        }
        public override void LoadConfig()
        {
            var tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
            var sourceUrl  = $"{_cdnUrl}/config.json";
            var fileTarget = Path.Combine(tempFolder, "config.json");

            Fs.EnsureFolder(tempFolder);

            DownloadContent(sourceUrl, fileTarget);

            Config = TemplatesSourceConfig.LoadFromFile(fileTarget);

            Fs.SafeDeleteDirectory(tempFolder);
        }
        public static TemplatesSourceConfig LoadFromFile(string filePath)
        {
            TemplatesSourceConfig result = null;

            try
            {
                if (File.Exists(filePath))
                {
                    string configData = File.ReadAllText(filePath, Encoding.UTF8);

                    JsonSerializerSettings settings = new JsonSerializerSettings();
                    settings.NullValueHandling = NullValueHandling.Ignore;
                    settings.Converters.Add(new StringEnumConverter());
                    result = JsonConvert.DeserializeObject <TemplatesSourceConfig>(configData, settings);
                }
            }
            catch (Exception ex)
            {
                AppHealth.Current.Exception.TrackAsync(ex, StringRes.TemplatesSourceErrorLoadingConfigFileMessage).FireAndForget();
                result = null;
            }

            return(result);
        }