Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //FORM OBJECT
- public partial class Form1 : Form {
- Progress prog;
- ...
- //transfer data only
- private void button4_Click(object sender, EventArgs e) {
- prog = new Progress();
- foreach (Object o in checkedListBox1.CheckedItems) {
- Device d = (Device)o;
- if (!d.isEmpty) {
- toolStripStatusLabel1.Text = "Processing " + d.Name;
- prog.add( d.Name );
- Thread t = new Thread((ParameterizedThreadStart) d.transfer);
- t.Start(this);
- }
- }
- prog.show();
- }
- ....
- /// IN Device Object
- public void transfer(Object x) {
- ....
- transferFile(timestamp, 0, dataEnd, target, false, (Form1) x);
- }
- public void transferFile(DateTime t, long startPage, long endPage, String target, bool wipe, Form1 form) {
- .........
- if (page > (oldPage + pageInc) {
- oldPage = page;
- THE INVOKER CODE SHOULD GO HERE
- ----> I want this to happen -->form.prog.update(this.name);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement