FlorianRappl/YAMP — pull request #3 by cureos (2012-11-15 11:40:33+00:00)
Title: Making YAMP portable

Dear Florian,

Congratulations for having reached the 1.0 milestone! I have taken the liberty of going through your new code, making it fully applicable in a portable class library. If you feel so inclined, please pull in the commits I have provided.

It should be fairly simple to go through each commit to see my changes; as far as I can tell I have maintained all functionality as-is, but I have modified the code to use more portable constructs.

I have not yet published my VS solution containing the portable class library, but at this stage my PCL library builds successfully. I have for the time being excluded the system functions `LoadFunction`, `SaveFunction` and `SleepFunction`; for parsing of mathematical functions I do not see that this is such a big limitation.

In the `Parser` class I am using `System.Threading.Tasks.Task` for asynchronous workflow (`BackgroundWorker` is not supported in PCL). Since your original library targets .NET 3.5 (where `Task` is not supported) I needed to include an `#if` directive to maintain buildability in both library versions.
Using `Task` limits the applicability of the portable library as well; only .NET 4+ and Windows Store applications can be targeted with the portable YAMP library because of this. It might not be such a big drawback after all; Silverlight and Windows Phone platforms are maybe not the primary targets for YAMP :-)
(BTW, the WP8 profile supports `Task`; I will have a look what it takes to include WP8 support in the portable YAMP library.)

Best regards,
Anders