Last active
August 29, 2015 14:06
-
-
Save buchmoyerm/5db4d4612a18bd2ee219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyForm | |
{ | |
public void UpdateProgress(int step) { | |
if (InvokeRequired) { | |
this.Invoke(new Action<int>(UpdateProgress), step); | |
} else { | |
prgOverallProgress.Value = step; | |
} | |
} | |
public void DoBtnClick() | |
{ | |
Task.Factory.StartNew(() => | |
{ | |
var c = new MyClass(); | |
c.GetTeamProjects(UpdateProgress); | |
}); | |
} | |
} | |
class MyClass | |
{ | |
void GetTeamProjects(Action<int> updateStatus) | |
{ | |
//do stuff | |
//on update of the status | |
updateStatus(x); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment