When using shared projects, one of your most powerful tools is the use of preprocessor statements. If you are unfamiliar with them, C# has the ability to define preprocessor variables such as
#define IPHONE, and then using
#if IPHONE or
The following is a simple example of using the technique:
#if IPHONE Console.WriteLine("I am running on iOS"); #elif ANDROID Console.WriteLine("I am running on Android"); #else Console.WriteLine("I am running on ???"); #endif
In Xamarin Studio, you can define preprocessor variables in your project's options under Build | Compiler | Define Symbols, delimited with semicolons. These will be applied to the entire project. Be warned that you must set up these variables for each ...