Posting native events in nanoFramework

José Simões

To deal with situations that require native coding or when one faces the situation of needing to add native code that has no place on the core library, there is Interop. It’s a rather powerful feature that opens immense possibilities.

Sending data from the native code to the C# managed application can be done easily by using either parameters passed by reference or sending the data on the return value. But… what if you need to signal your application of random events that occurs on the native code? Well now you can!

Support for CustomEvent has just been added to nanoFramework.Runtime.Events.

Let me explain how easy it is to use this cool feature. 😉

On your native code, all you have to do it’s just adding a simple line of code. Really! Like this:

PostManagedEvent( EVENT_CUSTOM, 0, 1111, 2222 );

The payload that’s available consists of the last…

View original post 176 more words

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.