Beispiel #1
0
 private void updateProgress(double received)
 {
     if (received == -1)
     {
         Download_ProgressBar.Value = 100;
         ServerService.MediationServerClient server = new ServerService.MediationServerClient();
         user.loadFiles(uploadPath);
         Files_DataGrid.ItemsSource = user.userFiles;
         server.SignOut(JsonConvert.SerializeObject(user));
         server.SignIn(JsonConvert.SerializeObject(user));
     }
     else
     {
         Download_ProgressBar.Value = (double)(received / downloadFileSize) * 100;
     }
 }
Beispiel #2
0
        private void SignIn_Btn_Click(object sender, RoutedEventArgs e)
        {
            ServerService.MediationServerClient client = new ServerService.MediationServerClient();
            User   user     = new User(configData);
            string userData = JsonConvert.SerializeObject(user, Formatting.Indented);

            if (client.SignIn(userData))
            {
                //MessageBox.Show("Hello " + user.name);
            }
            else
            {
                MessageBox.Show("Error in sign in.");
            }

            FileManagerWindow fileManagerWindow = new FileManagerWindow(user, configData.UploadPath, configData.DownloadPath);

            fileManagerWindow.ShowDialog();
        }