3 ms·
Miguel is a pretty l33t developer, so he glosses over a lot of the details. I suspect that code is contained in a class library project. Aka, generates a DLL.
by jinushaun 15y ago
Miguel is a pretty l33t developer, so he glosses over a lot of the details.
I suspect that code is contained in a class library project. Aka, generates a DLL. So no, not all sealed classes will be components.
The second method is there to illustrate what asynchronous programming will look like in C# 5. Native support for async is THE big feature in C# 5. The "await" allows you to call slow blocking code without a thorny nest of callbacks. There's some magic behind await. You can find out more on Google. Miguel could've definitely left out the SubAsync method in this example for clarity.
A component that adds 2 means a DLL that exposes the methods Add and SubAsync. In WinRT, you can code libraries in C# and use them in C++. Or Javascript.
- krig 15y agoAha, that almost makes sense. You're saying "add 2" might mean a component that exposes two methods. Not sure what exactly he is demonstrating there, actually. I mean, here's a DLL written in C that exposes the same two methods (although not asynchronous): int Add(int a, int b) { return a + b; } int Sub(int a, int b) { return a - CountEveryBitByHand(b); } So, I guess the example is just to show the async stuff, really.