Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use my old c#-libraries with WinJS?

I have some old c#-libraries. Is it possible to use them in a browser application? Can I use them with the JavaScript-Object for example?

Thanks

like image 413
koalabruder Avatar asked Oct 09 '22 19:10

koalabruder


2 Answers

You probably will be able to do that, but it will require some work from you.

To use the library, create a project whose output type is "WinMD file" (either new one, or change the library you have). In this project, all public types and their non-private members have to adhere to some WinRT rules.

For example:

  • classes should be sealed (with exceptions for GUI controls)
  • custom types may not be generic
  • most generic types from the framework may not be used, with the exception of some collection interfaces
like image 50
svick Avatar answered Oct 11 '22 08:10

svick


Yes you can. WinJS is built on top of WinRT which has a "translating layer" from any (supported) platform language. So you definitely should be able to use any "old" C# libraries in your code written in JavaScript in WinJS.

like image 39
Alexey Raga Avatar answered Oct 11 '22 08:10

Alexey Raga