Ejemplo n.º 1
0
        private async Task <string> GetLatestVersion()
        {
            if (IsGetting)
            {
                return(null);
            }
            IsGetting = true;

            try {
                var data = await CmApiProvider.GetStringAsync("data/manifest");

                if (data == null)
                {
                    LatestError = ToolsStrings.BaseUpdater_CannotDownloadInformation;
                    return(null);
                }

                return(VersionFromData(data));
            } catch (Exception e) {
                LatestError = ToolsStrings.BaseUpdater_CannotDownloadInformation;
                Logging.Warning("Cannot get data/manifest.json: " + e);
                return(null);
            } finally {
                IsGetting = false;
            }
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <PluginEntry> > DownloadAndParseList()
        {
            try {
                var loaded = await CmApiProvider.GetStringAsync("plugins/list");

                return(loaded == null ? null : JsonConvert.DeserializeObject <PluginEntry[]>(loaded).Where(x => x.IsAllRight));
            } catch (Exception e) {
                NonfatalError.NotifyBackground("Can’t download plugins list", e);
                return(null);
            }
        }
Ejemplo n.º 3
0
        public async Task <IEnumerable <PluginEntry> > DownloadAndParseList()
        {
            try {
                var loaded = await CmApiProvider.GetStringAsync("plugins/list");

                return(loaded == null ? null : JsonConvert.DeserializeObject <PluginEntry[]>(loaded).Where(x => x.IsAllRight));
            } catch (Exception e) {
                Logging.Warning("Cannot download plugins list: " + e);
                return(null);
            }
        }