https://github.com/protiguous/whyiuseawait
A simple demo of how to use await.
https://github.com/protiguous/whyiuseawait
async await demo example winform-ui winforms
Last synced: 4 months ago
JSON representation
A simple demo of how to use await.
- Host: GitHub
- URL: https://github.com/protiguous/whyiuseawait
- Owner: Protiguous
- License: gpl-3.0
- Created: 2019-06-23T16:42:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T16:44:38.000Z (almost 2 years ago)
- Last Synced: 2024-02-19T16:26:26.028Z (almost 2 years ago)
- Topics: async, await, demo, example, winform-ui, winforms
- Language: C#
- Size: 38.1 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WhyIUseAwait
A simple demo of how to use await with Winforms and .NET.
# How to install
* Clone/Download this repository.
* Load the solution in Visual Studio.
The project should be ready to run now.
# How to use
This application demo offers two buttons.
The first button runs the "long calculation" using a standard method.
The second button calls the exact same method, but wrapped in a Task.Run().
Run the application, press either button, and try to drag the window.
See the different results?
The left button blocks the UI when running the calculation.
The right button does not block the UI (by running the calculation in an awaited Task).
Examine the code, and you'll see how it works.