Ejemplo n.º 1
0
        private async void RefreshLiteloader()
        {
            Version ver = null;

            if (verToInstallLiteComboBox.SelectedItem != null)
            {
                ver = (Version)verToInstallLiteComboBox.SelectedItem;
            }
            else
            {
                await this.ShowMessageAsync("您未选择要安装Liteloader的版本", "您需要选择一个需要安装Liteloader的Minecraft本体");

                return;
            }
            var loading = await this.ShowProgressAsync("获取Liteloader列表中", "请稍后");

            loading.SetIndeterminate();
            JWLiteloader result = new JWLiteloader();

            liteloaderList.Clear();
            try
            {
                result = await apiHandler.GetLiteloaderList(ver);
            }
            catch (WebException)
            {
                await this.ShowMessageAsync("获取Liteloader列表失败", "请检查您的网络是否正常或稍后再试");

                return;
            }
            await loading.CloseAsync();

            if (result == null)
            {
                await this.ShowMessageAsync("没有匹配该版本的Liteloader", "貌似没有支持这个版本的Liteloader,请尝试更换另一个版本");
            }
            else
            {
                liteloaderList.Add(result);
            }
        }
Ejemplo n.º 2
0
        private async void RefreshLiteloader()
        {
            Version ver = null;

            if (verToInstallLiteComboBox.SelectedItem != null)
            {
                ver = (Version)verToInstallLiteComboBox.SelectedItem;
            }
            else
            {
                await this.ShowMessageAsync("您未选择要安装Liteloader的版本", "您需要选择一个需要安装Liteloader的Minecraft本体");

                return;
            }
            var loading = await this.ShowProgressAsync("获取Liteloader列表中", "请稍后");

            loading.SetIndeterminate();
            List <JWLiteloader> result = new List <JWLiteloader>();

            try
            {
                result.Add(await apiHandler.GetLiteloaderList(ver));
            }
            catch (WebException)
            {
                result = null;
            }
            await loading.CloseAsync();

            if (result == null)
            {
                await this.ShowMessageAsync("获取Liteloader列表失败", "请检查您的网络是否正常或更改下载源");
            }
            else
            {
                liteloaderListDataGrid.ItemsSource = result;
            }
        }