hbons/SparkleShare — pull request #440 by wimh (2011-11-18 23:11:39+00:00)
Title: Partial classes for platform dependant code

To continue the discussion where we left at [pull request 320][1], I have now prepared a first working example. This is not finished yet, so do not merge yet. But I like to know if I am on the right track.

I propose the following :

* For code which is completely different on different operating systems, such as the UI, separate files are created in a different directory.
* When there are just small differences, partial classes are used. The `class.cs` file contains code which is shared among all platforms, `class.platform.cs` contains the code for just that platform.
* The following platform names are used `windows`, `linux`, `macos`, `posix`. (posix is used for mac and linux).
* `#if` is not used.
* `using Gtk;`, `using Mono.Unix;` and `using Mono.Unix.Native;` does not belong in the normal .cs files, as they are not available on windows when compiling using the native .net tools.

The goal is to make the main .cs files identical on windows and linux, so the windows version contains just additional files in the windows folders, and the *,windows.cs files. Merging should become very simple...

I have tested the changes until now on linux, it seems to work this way.

[1]: https://github.com/hbons/SparkleShare/pull/320#issuecomment-1925396