How to make the cleanest code when reporting progress to a user?

后端 未结 13 1488
失恋的感觉
失恋的感觉 2021-02-08 09:10

I\'ve struggled for the last couple of months to come up with some clean code to report progress to a user. Everything always seems to boil down to:

ReportProgr         


        
13条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-08 09:52

    You could create a Task class with a name property and delegate. Put each task in a collection, then iterate through it, printing the message and invoking the delegate for each task.

提交回复
热议问题