private async Task GetMySaves()
        {
            listMyGameSaves = await DynamicControls.GetAllSavesForCurrentUser(Constants.User);

            lbMyGameSaves.ItemsSource = listMyGameSaves;
            lbMyGameSaves.Items.Refresh();
        }
        private async Task RefreshLB()
        {
            DynamicControls.ResetUpdateAndDLUI(txtDLSaveTitle, txtDLSaveDescription, cmbDLSaveRegion, txtDLSaveType, txtDLHasExtData, txtDLCount, txtDLUploader, lbFilesIncludedInDownload);
            DynamicControls.ResetUpdateAndDLUI(txtMUSaveTitle, txtMUSaveDescription, cmbMUSaveRegion, txtMUSaveType, txtMUHasExtData, null, null, lbMySaveSlotsInGameFolder);
            DynamicControls.ResetUploadUI(txtSaveTitle, txtSaveDescription, cmbSaveRegion, txtHasExtData, lbSaveSlotsInGameFolder, lbGameSavesInDevice);

            await LoadSaves();
        }
        private async void MenuItemUpdate_Click(object sender, RoutedEventArgs e)
        {
            if (lbMyGameSaves.SelectedIndex == -1)
            {
                return;
            }
            else
            {
                if (lbMyGameSaves.HasItems && lbMyGameSaves.SelectedIndex >= 0)
                {
                    if (!txtMUSaveTitle.Text.Equals(""))
                    {
                        if (!txtMUSaveDescription.Equals(""))
                        {
                            if (cmbMUSaveRegion.SelectedIndex >= 0)
                            {
                                isOtherProcRunning      = true;
                                gridMyUploads.IsEnabled = false;
                                TabSaves.IsEnabled      = false;

                                //AGREGAR FilePath = FTPitem.FullName, al listMyGameSaves (desde el ftp) para poder saber desde donde debo recobrar los archivos para hacer upload y luego update.
                                listMyGameSaves[lbMyGameSaves.SelectedIndex].FilePath = await Mega.DownloadFilesAsyncForUpdate(listMyGameSaves[lbMyGameSaves.SelectedIndex].FileName, Constants.TempFolder, PBNotifyProgress, lblNotifyProgress);

                                if (listMyGameSaves[lbMyGameSaves.SelectedIndex].FilePath != null && await FTP.DownloadFilesToLocal(txtDeviceIPAddress.Text, listMyGameSaves[lbMyGameSaves.SelectedIndex].FilePath, txtMUSaveTitle.Text, txtMUSaveDescription.Text, SaveRegionMySaves, null, txtMUHasExtData, PBNotifyProgress, lblNotifyProgress))
                                {
                                    DynamicControls.ResetUploadUI(txtMUSaveTitle, txtMUSaveDescription, cmbMUSaveRegion, txtMUHasExtData, lbMySaveSlotsInGameFolder, lbMyGameSaves);
                                    await LoadSaves();
                                }
                                //Deleting TempFolder once the upload is done.
                                Misc.Dir.DeleteDir(Constants.TempFolder + System.IO.Path.DirectorySeparatorChar + "TempSaves");
                                gridMyUploads.IsEnabled = true;
                                TabSaves.IsEnabled      = true;
                            }
                            else
                            {
                                MessageBox.Show("Select the region for the save you are updating.");
                            }
                        }
                        else
                        {
                            MessageBox.Show("You must write a description for the save you want to update. Say % of completion, achievements unlocket, etc...");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You must write a title for the save you want to update. Choose something brief and descriptive.");
                    }
                }
                else
                {
                    MessageBox.Show("You must select one save to update.");
                }
                isOtherProcRunning      = false;
                gridMyUploads.IsEnabled = true;
                TabSaves.IsEnabled      = true;
            }
        }
        private async Task GetAllSaves()
        {
            listGameSavesToDownload = await DynamicControls.GetAllSaves();

            lbGameSavesToDownload.ItemsSource = listGameSavesToDownload;
            lbGameSavesToDownload.Items.Refresh();
            cmbFilterJumpToLetter.ItemsSource       = (await DynamicControls.GetAllSavesFirstLetter()).DefaultView;
            cmbFilterJumpToLetter.DisplayMemberPath = "GameName";
            cmbFilterJumpToLetter.SelectedValuePath = "GameName";
        }
 private void cmbMUSaveRegion_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cmbMUSaveRegion.HasItems && cmbMUSaveRegion.SelectedIndex >= 0)
     {
         SaveRegionMySaves = DynamicControls.GetDeviceRegion(cmbMUSaveRegion.SelectedValue.ToString());
     }
     else
     {
         SaveRegionMySaves = "";
     }
 }
        private async void txtFilterSearch_TextChanged(object sender, TextChangedEventArgs e)
        {
            string SelValue = "";

            if (cmbFilterSaveByRegion.SelectedIndex >= 0)
            {
                SelValue = cmbFilterSaveByRegion.SelectedValue.ToString();
            }
            listGameSavesToDownload = await DynamicControls.LoadWithFilter(SelValue, txtFilterSearch.Text);

            lbGameSavesToDownload.ItemsSource = listGameSavesToDownload;
            lbGameSavesToDownload.Items.Refresh();
            DynamicControls.ResetUpdateAndDLUI(txtDLSaveTitle, txtDLSaveDescription, cmbDLSaveRegion, txtDLSaveType, txtDLHasExtData, txtDLCount, txtDLUploader, lbFilesIncludedInDownload);
        }
 private async void btnUpdateMySaves_Click(object sender, RoutedEventArgs e)
 {
     if (lbMyGameSaves.HasItems && lbMyGameSaves.SelectedIndex >= 0)
     {
         if (!txtMUSaveTitle.Text.Equals(""))
         {
             if (!txtMUSaveDescription.Equals(""))
             {
                 if (cmbMUSaveRegion.SelectedIndex >= 0)
                 {
                     isOtherProcRunning      = true;
                     gridMyUploads.IsEnabled = false;
                     TabSaves.IsEnabled      = false;
                     SavesClass SV = new SavesClass();
                     SV.FileName    = listMyGameSaves[lbMyGameSaves.SelectedIndex].FileName;
                     SV.Title       = txtMUSaveTitle.Text;
                     SV.Description = txtMUSaveDescription.Text;
                     SV.Region      = SaveRegionMySaves;
                     if (await Update.UpdateSaveInfo(SV, PBNotifyProgress, lblNotifyProgress))
                     {
                         DynamicControls.ResetUploadUI(txtMUSaveTitle, txtMUSaveDescription, cmbMUSaveRegion, txtMUHasExtData, lbMySaveSlotsInGameFolder, lbMyGameSaves);
                         await LoadSaves();
                     }
                     gridMyUploads.IsEnabled = true;
                     TabSaves.IsEnabled      = true;
                 }
                 else
                 {
                     MessageBox.Show("Select the region for the save you are updating.");
                 }
             }
             else
             {
                 MessageBox.Show("You must write a description for the save you want to update. Say % of completion, achievements unlocket, etc...");
             }
         }
         else
         {
             MessageBox.Show("You must write a title for the save you want to update. Choose something brief and descriptive.");
         }
     }
     else
     {
         MessageBox.Show("You must select one save to update.");
     }
     isOtherProcRunning      = false;
     gridMyUploads.IsEnabled = true;
     TabSaves.IsEnabled      = true;
 }
 private async void btnUploadSave_Click(object sender, RoutedEventArgs e)
 {
     if (lbSaveSlotsInGameFolder.HasItems && lbSaveSlotsInGameFolder.SelectedIndex >= 0)
     {
         if (!txtSaveTitle.Text.Equals(""))
         {
             if (!txtSaveDescription.Equals(""))
             {
                 if (cmbSaveRegion.SelectedIndex >= 0)
                 {
                     isOtherProcRunning   = true;
                     gridUpload.IsEnabled = false;
                     TabSaves.IsEnabled   = false;
                     if (await FTP.DownloadFilesToLocal(txtDeviceIPAddress.Text, listSaveSlots[lbSaveSlotsInGameFolder.SelectedIndex].FilePath, txtSaveTitle.Text, txtSaveDescription.Text, SaveRegionUpload, SaveTypeUpload, txtHasExtData, PBNotifyProgress, lblNotifyProgress))
                     {
                         DynamicControls.ResetUploadUI(txtSaveTitle, txtSaveDescription, cmbSaveRegion, txtHasExtData, lbSaveSlotsInGameFolder, lbGameSavesInDevice);
                         await LoadSaves();
                     }
                     //Deleting TempFolder once the upload is done.
                     Misc.Dir.DeleteDir(Constants.TempFolder + System.IO.Path.DirectorySeparatorChar + "TempSaves");
                     gridUpload.IsEnabled = true;
                     TabSaves.IsEnabled   = true;
                 }
                 else
                 {
                     MessageBox.Show("Select the region for the save you are uploading.");
                 }
             }
             else
             {
                 MessageBox.Show("You must write a description for the save to upload. Say % of completion, achievements unlocket, etc...");
             }
         }
         else
         {
             MessageBox.Show("You must write a title for the save to upload. Choose something brief and descriptive.");
         }
     }
     else
     {
         MessageBox.Show("You must select one save slot to upload.");
     }
     isOtherProcRunning   = false;
     gridUpload.IsEnabled = true;
     TabSaves.IsEnabled   = true;
 }
        private async void lbMyGameSaves_SelChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = lbMyGameSaves.SelectedIndex;

            if (lbMyGameSaves.HasItems && index >= 0)
            {
                listMySaveSlots = await DynamicControls.GetFilesIncludedFromLocalDB(listMyGameSaves[index].Username, listMyGameSaves[index].FileName, txtMUSaveTitle, txtMUSaveDescription, cmbMUSaveRegion, txtMUSaveType, txtMUHasExtData, null, null);

                if (listMySaveSlots == null)
                {
                    lbMySaveSlotsInGameFolder.ItemsSource = null;
                }
                else
                {
                    lbMySaveSlotsInGameFolder.ItemsSource = listMySaveSlots;
                }
                lbMySaveSlotsInGameFolder.Items.Refresh();
            }
        }
Пример #10
0
        private async void btnFTPConnect_Click(object sender, RoutedEventArgs e)
        {
            listGameSaves = await DynamicControls.GetGSavesFromDevice(txtDeviceIPAddress.Text, "/JKSV/Saves");

            if (listGameSaves == null)
            {
                lbGameSavesInDevice.ItemsSource = null;
                SaveTypeUpload   = "";
                txtSaveType.Text = "";
            }
            else
            {
                SaveTypeUpload   = ((int)Constants.SaveType.N3DS).ToString();
                txtSaveType.Text = "Nintendo 3DS";
                lbGameSavesInDevice.ItemsSource = listGameSaves;
            }
            ShowHideMenu("sbHideRightMenu", btnRightMenuHide, btnRightMenuShow, pnlRightMenu);
            lbGameSavesInDevice.Items.Refresh();
        }
Пример #11
0
        private async void lbGameSavesInDevice_SelChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = lbGameSavesInDevice.SelectedIndex;

            if (lbGameSavesInDevice.HasItems && index >= 0)
            {
                listSaveSlots = await DynamicControls.GetGSavesFromDevice(txtDeviceIPAddress.Text, listGameSaves[index].FilePath);

                if (listGameSaves == null)
                {
                    lbSaveSlotsInGameFolder.ItemsSource = null;
                }
                else
                {
                    lbSaveSlotsInGameFolder.ItemsSource = listSaveSlots;
                }
                lbSaveSlotsInGameFolder.Items.Refresh();
            }
        }
Пример #12
0
        private async void lbGameSavesToDownload_SelChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = lbGameSavesToDownload.SelectedIndex;

            if (lbGameSavesToDownload.HasItems && index >= 0)
            {
                listGSToDownloadFilesIncluded = await DynamicControls.GetFilesIncludedFromLocalDB(listGameSavesToDownload[index].Username, listGameSavesToDownload[index].FileName, txtDLSaveTitle, txtDLSaveDescription, cmbDLSaveRegion, txtDLSaveType, txtDLHasExtData, txtDLCount, txtDLUploader);

                if (listGSToDownloadFilesIncluded == null)
                {
                    lbFilesIncludedInDownload.ItemsSource = null;
                }
                else
                {
                    lbFilesIncludedInDownload.ItemsSource = listGSToDownloadFilesIncluded;
                }
                lbFilesIncludedInDownload.Items.Refresh();
            }
        }