Advertisement
Guest User

Untitled

a guest
Sep 5th, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. //FORM OBJECT
  2.  
  3.     public partial class Form1 : Form    {
  4.         Progress prog;
  5.  
  6.  
  7. ...
  8.         //transfer data only
  9.         private void button4_Click(object sender, EventArgs e) {
  10.             prog = new Progress();
  11.             foreach (Object o in checkedListBox1.CheckedItems) {
  12.                 Device d = (Device)o;
  13.                 if (!d.isEmpty) {
  14.                     toolStripStatusLabel1.Text = "Processing " + d.Name;
  15.                     prog.add( d.Name );        
  16.                     Thread t = new Thread((ParameterizedThreadStart) d.transfer);
  17.                     t.Start(this);
  18.                 }
  19.             }
  20.             prog.show();
  21.         }
  22.  
  23.  
  24. ....
  25. /// IN Device Object
  26.  
  27.         public void transfer(Object x) {
  28.            
  29.             ....
  30.  
  31.             transferFile(timestamp, 0, dataEnd, target, false, (Form1) x);
  32.         }
  33.  
  34.  
  35.    
  36.       public void transferFile(DateTime t, long startPage, long endPage, String target, bool wipe, Form1 form) {
  37.     .........
  38.  
  39.         if (page > (oldPage + pageInc) {
  40.                     oldPage = page;
  41.                    
  42.             THE INVOKER CODE SHOULD GO HERE
  43.  
  44.     ----> I want this to happen -->form.prog.update(this.name);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement