Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add resource support to C# generator (#939)
This adds resource support to the C# generator and also fixes a few miscellaneous issues that were preventing tests from passing. I believe the code generated for imported resources is reasonably ergonomic, although I'm pretty new to C#, so I'm open to suggestions to make it more idiomatic. As with other languages, the code for exported resources is a bit less ergonomic, I'm using an `interface` to represent the API, but I also want implementations to inherit code which manages the resource handle, for which I'm currently using a `class`. The upshot is that implementing an exported resource involves both extending a `class` and implementing an `interface`. Again, I'm open to suggestions about improving this. Note that exporting resources tends to be a lot less common in end-user code than importing them, so we probably don't need to obsess over ergonomics in that case. disable C# runtime tests on non-Windows platforms As of this writing, they only work on Windows, although Linux support is on the horizon. Update lib.rs Fixes lots of warnings and makes the C# code more idiomatic rename rep_table.cs to RepTable.cs; address PR feedback per-resource RepTables; use zero as handle sentinel add comments explaining handle mgmt for exported resources Signed-off-by: Joel Dice <joel.dice@fermyon.com>
- Loading branch information