private void button2_Click(object sender, EventArgs e) // "Ok" Button { if (path.CompareTo("") != 0) { this.Hide(); SendFiles sf = new SendFiles(path, Conn, textBox1.Text, dad, false); sf.Show(); } //passare il valore }
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; } }
public Share(Login l, bool nascosto, string path) { hidden = nascosto; StringBuilder strBuilder = new StringBuilder(); firstGetHomeDir(strBuilder); homeDir = strBuilder.ToString(); closing = false; InitializeComponent(); log = l; cred = l.get_credentials(); connessione = creaConnessione(cred.ToString()); label4.Text = cred.get_nome(); label5.Text = cred.get_cognome(); pictureBox2.ImageLocation = cred.get_immagine_profilo(); System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath(); gp.AddEllipse(0, 0, pictureBox2.Width - 3, pictureBox2.Height - 3); Region rg = new Region(gp); pictureBox2.Region = rg; mainPipe = new NamedPipeClientStream(@"mainPipe"); p = new PollingPipe(null, null, null, null, mainPipe, this, null, 1, true); //-------------------- BackgroundMode code this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.components1 = new System.ComponentModel.Container(); this.contextMenu1 = new System.Windows.Forms.ContextMenu(); this.contextMenu1.MenuItems.AddRange( new System.Windows.Forms.MenuItem[] { this.menuItem1, this.menuItem2 }); this.menuItem1.Index = 0; this.menuItem1.Text = "Exit"; this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); this.menuItem2.Index = 1; this.menuItem2.Text = "Modalità Privata"; this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click); if (cred.get_visibility() == "false") { menuItem2.Checked = true; } else { menuItem2.Checked = false; } notifyIcon1.ContextMenu = this.contextMenu1; if (nascosto) { Opacity = 0; ShowInTaskbar = false; sf = new SendFiles(path, connessione, path, this, true); sf.Show(); } }