/// <summary> /// Upload the file to the network. /// </summary> private async void UploadButton(object sender, RoutedEventArgs e) { bool uploaded = await FileAPIController.UploadFile(user._savedInformation._id, fileLocation); if (uploaded) { SetUploadMessage(Brushes.Green, "Uploaded file!"); FilmResponse res = await FileAPIController.GetAllFilesInNetwork(user._savedInformation._id); main_files_listView.ItemsSource = res.data; } else { SetUploadMessage(Brushes.Red, "Failed to upload!"); } }
/// <summary> /// Called if the user had been logged in, it it downloads all users data. /// </summary> private async void SetupUI() { // Set the users details. main_username_label.Content = user._savedInformation._username; main_email_label.Content = user._savedInformation._email; main_storage_label.Content = user._savedInformation._storageUsage + "MB/" + user._savedInformation._storageTier + "MB"; main_storage_amount.Text = holder._savedInformation.storageAmount.ToString(); main_allowStorage_check.IsChecked = user._savedInformation._allowStorage; // Get all of the the uers files in the network. FilmResponse res = await FileAPIController.GetAllFilesInNetwork(user._savedInformation._id); main_files_listView.ItemsSource = res.data; // Update the settings panel, changes button from Activate to Update etc. UpdateSettingsPanel(); }