Click here to Skip to main content
15,907,910 members
Home / Discussions / C#
   

C#

 
QuestionDebug decompile - urgent project restore Pin
Ahmedtsadek2-May-21 19:05
Ahmedtsadek2-May-21 19:05 
AnswerRe: Debug decompile - urgent project restore Pin
OriginalGriff2-May-21 19:32
mveOriginalGriff2-May-21 19:32 
AnswerRe: Debug decompile - urgent project restore Pin
Kuolung19673-May-21 0:48
Kuolung19673-May-21 0:48 
AnswerRe: Debug decompile - urgent project restore Pin
Gerry Schmitz3-May-21 7:42
mveGerry Schmitz3-May-21 7:42 
GeneralRe: Debug decompile - urgent project restore Pin
Richard Andrew x643-May-21 10:32
professionalRichard Andrew x643-May-21 10:32 
GeneralRe: Debug decompile - urgent project restore Pin
Ahmedtsadek3-May-21 12:55
Ahmedtsadek3-May-21 12:55 
GeneralRe: Debug decompile - urgent project restore Pin
Gerry Schmitz3-May-21 21:41
mveGerry Schmitz3-May-21 21:41 
Questionlinq to objects Extract values between start and end strings Pin
Mou_kol1-May-21 3:09
Mou_kol1-May-21 3:09 
AnswerRe: linq to objects Extract values between start and end strings Pin
OriginalGriff1-May-21 4:28
mveOriginalGriff1-May-21 4:28 
AnswerRe: linq to objects Extract values between start and end strings Pin
Richard MacCutchan1-May-21 4:41
mveRichard MacCutchan1-May-21 4:41 
GeneralRe: linq to objects Extract values between start and end strings Pin
Mou_kol1-May-21 6:44
Mou_kol1-May-21 6:44 
GeneralRe: linq to objects Extract values between start and end strings Pin
Richard MacCutchan1-May-21 6:48
mveRichard MacCutchan1-May-21 6:48 
AnswerRe: linq to objects Extract values between start and end strings Pin
Gerry Schmitz1-May-21 7:16
mveGerry Schmitz1-May-21 7:16 
AnswerRe: linq to objects Extract values between start and end strings Pin
Mycroft Holmes1-May-21 11:54
professionalMycroft Holmes1-May-21 11:54 
GeneralRe: linq to objects Extract values between start and end strings Pin
Mou_kol1-May-21 21:18
Mou_kol1-May-21 21:18 
GeneralRe: linq to objects Extract values between start and end strings Pin
Mycroft Holmes2-May-21 12:21
professionalMycroft Holmes2-May-21 12:21 
AnswerRe: linq to objects Extract values between start and end strings Pin
Eddy Vluggen3-May-21 6:24
professionalEddy Vluggen3-May-21 6:24 
QuestionHow to report progress from Async function Pin
Mou_kol29-Apr-21 20:23
Mou_kol29-Apr-21 20:23 
AnswerRe: How to report progress from Async function Pin
Richard Deeming29-Apr-21 21:15
mveRichard Deeming29-Apr-21 21:15 
GeneralRe: How to report progress from Async function Pin
Mou_kol29-Apr-21 22:10
Mou_kol29-Apr-21 22:10 
Thanks for your sample code but i am using .Net v4.5.2. so i change the code this way as a result to compile. Sir please have a look at converted code and tell me is it ok ?

C#
private async void button1_Click(object sender, EventArgs e)
        {
            IProgress<string> progress = new Progress<string>(str =>
            {
                textBox1.Text += str+System.Environment.NewLine;
            });

           // IProgress<string> progress = new Progress<string>(str => textBox1.Text+ = str+System.Environment.NewLine);
            await Run(progress);
        }

        public async Task GetData(int i, IProgress<string> progress)
        {
            progress.Report("Task created "+i.ToString());
            //await Task.Delay(60000 + i * 1000);
            await Task.Delay(2000);
            progress.Report("Task completed "+i.ToString());
        }

        private async Task Run(IProgress<string> progress)
        {
            List<Task> tasks = new List<Task>();
            for (int i = 0; i < 5; i++)
            {
                tasks.Add(GetData(i + 1, progress));
            }
    
            await Task.WhenAll(tasks);
        }


modified 30-Apr-21 4:21am.

GeneralRe: How to report progress from Async function Pin
Richard Deeming30-Apr-21 1:45
mveRichard Deeming30-Apr-21 1:45 
GeneralRe: How to report progress from Async function Pin
Mou_kol1-May-21 3:18
Mou_kol1-May-21 3:18 
GeneralRe: How to report progress from Async function Pin
Dave Kreskowiak1-May-21 5:29
mveDave Kreskowiak1-May-21 5:29 
AnswerRe: How to report progress from Async function Pin
OriginalGriff30-Apr-21 19:56
mveOriginalGriff30-Apr-21 19:56 
GeneralRe: How to report progress from Async function Pin
Mou_kol1-May-21 3:15
Mou_kol1-May-21 3:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.