public ProgressBarDialogRic(string nomeUtente, string nPipe, bool accepted) { acc = accepted; InitializeComponent(); if (acc) { this.Show(); } else { this.Hide(); } label4.Text = nomeUtente; prima = DateTime.Now; mut_pipe = new Mutex(); is_pipe_closed = false; updateProgressBar = new delegateUpdateProgressBar(modify_progress_bar); progressBar1.Maximum = 100; progressBar1.Minimum = 0; progressBar1.MarqueeAnimationSpeed = 0; string pipeName = "pipe" + nPipe; serverPipe = new NamedPipeClientStream(pipeName); pp = new PollingPipe(null, updateProgressBar, null, this, serverPipe, null, mut_pipe, 2, acc); }
public ProgressBarDialog(IntPtr connection, utente usr, string path, SendFiles padre, Share nonno) { grandDad = nonno; InitializeComponent(); prima = DateTime.Now; mut_pipe = new Mutex(); is_pipe_closed = false; updateProgressBar = new delegateUpdateProgressBar(modify_progress_bar); StringBuilder str = new StringBuilder(); connessione = connection; inviaFile(connessione, path, usr.MAC, str); progressBar1.Maximum = 100; progressBar1.Minimum = 0; progressBar1.MarqueeAnimationSpeed = 0; string tmpID = str.ToString(); if (tmpID == "-1") { SendFiles padre2 = new SendFiles(padre.path, padre.conn, padre.nomeFile, nonno, false); padre.Close(); padre2.Show(); this.Close(); } else { this.Show(); pipe = new NamedPipeClientStream(tmpID); p = new PollingPipe(updateProgressBar, null, this, null, pipe, null, mut_pipe, 3, true); nome_file = path; label3.Text = nome_file; label4.Text = usr.Nome + " " + usr.Cognome; } }