private void reloginToolStripMenuItem_Click(object sender, EventArgs e) { AuthenticationApplication authenticationApp = new AuthenticationApplication(this); authenticationApp.ShowDialog(); Login(); }
private void deleteAccountToolStripMenuItem_Click(object sender, EventArgs e) { service.DeleteAccount(client); AuthenticationApplication authenticationApp = new AuthenticationApplication(this); authenticationApp.ShowDialog(); listView1.Clear(); Login(); }
private void Login() { try { service = new TransferServiceClient(); service.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None; service.ClientCredentials.UserName.UserName = login; service.ClientCredentials.UserName.Password = password; client = service.GetClient(login); DirectoryInfo rootDir = service.GetRootRepository(client); clientRoot = CheckForFirsSing(rootDir); _controller.CurrentDirectory = clientRoot; OpenDirectory(""); if (sync != null) { try { sync.Abort(); } catch { } } string path = @"D:\Cursova\DropBox\" + client.login; sync = new Thread(() => SyncFunction(path, service, client)); sync.IsBackground = true; sync.Start(); } catch { MessageBox.Show("uncorrect data please try again"); if (!isExit) { AuthenticationApplication app = new AuthenticationApplication(this); app.ShowDialog(); Login(); } else { Application.Exit(); } } }
public DropBox() { InitializeComponent(); listView1.SmallImageList = imageList1; listView1.LargeImageList = imageList1; listView1.DragOver += FileAttributeChanger_DragOver; listView1.DragDrop += FileAttributeChanger_DragDrop; _controller = new DirectoryController(""); AuthenticationApplication authenticationApp = new AuthenticationApplication(this); authenticationApp.ShowDialog(); Login(); //string path = @"D:\Cursova\DropBox\" + client.login; //sync = new Thread(() => SyncFunction(path, service, client)); //sync.IsBackground = true; //sync.Start(); }