示例#1
0
        private async void ViewControllerOnViewIndexChangedEvent(object sender, int e)
        {
            if (e != (int)ViewIndex.ValidateMods)
            {
                return;
            }

            IsInitialValidating = true;

            await ValidateMods();

            _nxmHandle.StartServer();

            IsInitialValidating = false;

            IsUserPremium = _apiBase.IsUserLoggedIn() && _apiBase.IsUserPremium();
        }
示例#2
0
        private async void QueueDownload(object caller, PipedData pipedData)
        {
            if (!MissingMods.Any(x => x.FileId == pipedData.FileId && x.ModId == pipedData.ModId) || !_apiBase.IsUserLoggedIn())
            {
                return;
            }

            var downloadUrl = await _apiEndpoints.GenerateModDownloadLinkAsync(pipedData);

            var matchingModObject = MissingMods.First(x => x.FileId == pipedData.FileId && x.ModId == pipedData.ModId);

            MissingMods.First(x => x == matchingModObject).IsIndeterminateProcess = true;

            if (matchingModObject == null)
            {
                return;
            }

            _downloadClient.QueueDownload(downloadUrl, matchingModObject);
        }