Самке
Самке
CC#
Created by Самке on 7/7/2024 in #help
Updating progress on the screen problem
To be honest this is just an exercise so it is not something important to me 😁 but still it was odd to see result in a wrong order. I think i will stick with Task.Delay for now and i will do a little bit of research on event queue and callback async
19 replies
CC#
Created by Самке on 7/7/2024 in #help
Updating progress on the screen problem
why because WriteLine?
19 replies
CC#
Created by Самке on 7/7/2024 in #help
Updating progress on the screen problem
c#
progress.ProgressChanged += (sender, tuple) =>
{
Console.WriteLine($"index: {tuple.index} progress: {tuple.currNumber}");
};
c#
progress.ProgressChanged += (sender, tuple) =>
{
Console.WriteLine($"index: {tuple.index} progress: {tuple.currNumber}");
};
Result: Press C to exit Enter the number: 15 index: 2 progress: 3 index: 1 progress: 1 index: 5 progress: 15 index: 3 progress: 6 index: 4 progress: 10 index: 10 progress: 55 index: 6 progress: 21 index: 8 progress: 36 index: 7 progress: 28 index: 15 progress: 120 index: 13 progress: 91 index: 12 progress: 78 index: 9 progress: 45 index: 11 progress: 66 index: 14 progress: 105 Final result: 120
19 replies
CC#
Created by Самке on 7/7/2024 in #help
Updating progress on the screen problem
Can this be solved without adding that line?
19 replies
CC#
Created by Самке on 7/7/2024 in #help
Updating progress on the screen problem
And if i add the Task.Delay(1).Wait(); in my Calc task then i will get the correct output Result after modification: Press C to exit Enter the number: 15 index: 1 progress: 1 index: 2 progress: 3 index: 3 progress: 6 index: 4 progress: 10 index: 5 progress: 15 index: 6 progress: 21 index: 7 progress: 28 index: 8 progress: 36 index: 9 progress: 45 index: 10 progress: 55 index: 11 progress: 66 index: 12 progress: 78 index: 13 progress: 91 index: 14 progress: 105 index: 15 progress: 120 Final result: 120
19 replies