using statement is an extremely useful feature of C# and it's quite disappointing that Phidgets did not implement
IDisposable. Thankfully it's fairly easy to create a wrapper for any Phidget that implements it so we can simply some code.
One cool package for playing around with your phidget(s) is
mono-csharp-shell which gives you an interactive C# shell (with tab completion).
apt-get install -y mono-csharp-shell
Once the package is installed, you can open it with
csharp but just like with
gmcs we have to include the reference to the Phidget library.
Since we cannot install
mono-complete on the PhidgetSBC2 currently, we are missing some of the C# namespaces. If you are trying to use any of the following namespaces and
gmcs cannot find it, you will have to install the respective package.
I really wanted to write the code in C# because it's simply better than Java and it's lot easier to implement a server in C# than in C. While the manual for the SBC2 says you can get Mono working if you install the correct packages, I couldn't find any information on the Phidget website on how to do it, so I had to figure it out myself.