FreSharp - Build Adobe Air Native Extensions using C#
While working on WebViewANE for Windows I wrapped FlashRuntimeExtensions in C++/CLI calls to allow me to more tightly integrate with C#.
I expanded this into a NuGet package to make writing ANEs in C# quicker.
Example - Convert a FREObject into a String, and String into FREObject
var inFre = argv[0];
try {
var airString = new FreObjectSharp(inFre).GetAsString();
Trace("String passed from AIR:" + airString);
}
catch (Exception e) {
Trace(@"caught in C#: type: {0} message: {1}", e.GetType(), e.Message);
}
const string sharpString = "I am a string from C#";
return new FreObjectSharp(sharpString).Get();
Example - Call a method on an FREObject
var addition = person.CallMethod("add", new ArrayList
{
new FreObjectSharp(100),
new FreObjectSharp(33)
});
var sum = addition.GetAsInt();
Trace("result is: " + sum);
The source and example project is available on Github
