Esempio n. 1
0
        private async void Btn_Upload_Livery_Click(object sender, RoutedEventArgs e)
        {
            Lbl_Info.Content = "Uploading...";

            string err = await LiveryController.UploadLivery(Box_Livery_Upload.Text);

            Lbl_Info.Content = err;

            // silently refresh the list
            await UpdateLiveryListAsync();
        }
Esempio n. 2
0
        private async void Btn_Down_All_Click(object sender, RoutedEventArgs e)
        {
            Lbl_Info.Content = "Downloading all liveries, this can take a while...";


            ReleaseImageLocks();

            string err = await LiveryController.UpdateAllRemoteLiveries(Box_ACCPath.Text);

            Lbl_Info.Content = err;


            //  this will update the installed/update needed columns
            LiveryController.RefreshInstalled(Box_ACCPath.Text);
            LiveryController.RefreshUpdateNeeded(Box_ACCPath.Text);
            List_Liveries.ItemsSource = LiveryController.liveries;
        }
Esempio n. 3
0
        private async Task UpdateLiveryListAsync()
        {
            try
            {
                LiveryController.liveries = await Connector.GetLiveries();
            }
            catch (System.UriFormatException)
            {
                Lbl_Info.Content = "Invalid Host Url";
                return;
            }


            LiveryController.RefreshInstalled(Box_ACCPath.Text);
            LiveryController.RefreshUpdateNeeded(Box_ACCPath.Text);

            List_Liveries.ItemsSource = LiveryController.liveries;
        }
Esempio n. 4
0
        private async void Button_DeleteLivery_Click(object sender, RoutedEventArgs e)
        {
            var item = List_Liveries.SelectedItem;

            if (item is Livery liv)
            {
                // image can stay locked, as no local files are deleted

                Lbl_Info.Content = "Deleting remote...";

                string err = await LiveryController.DeleteRemoteLivery(List_Liveries.SelectedIndex);

                Lbl_Info.Content = err;

                // silently refresh the list
                await UpdateLiveryListAsync();
            }
            else
            {
                Lbl_Info.Content = "Please select an entry from the list";
            }
        }
Esempio n. 5
0
        private async void Btn_Down_Selection_Click(object sender, RoutedEventArgs e)
        {
            var item = List_Liveries.SelectedItem;

            if (item is Livery liv)
            {
                // release access to files
                ReleaseImageLocks();

                Lbl_Info.Content = "Downloading...";

                string err = await LiveryController.UpdateRemoteLivery(Box_ACCPath.Text, List_Liveries.SelectedIndex);

                Lbl_Info.Content = err;


                //  this will update the installed/update needed columns
                await UpdateLiveryListAsync();
            }
            else
            {
                Lbl_Info.Content = "Please select an entry from the list";
            }
        }