public static String GetPath(MacOSVersion version)
{
// Set the base path
String basedir = "/Library/Frameworks/Mono.framework/Libraries/mono";
IDictionary<MacOSVersion, String> map = new Dictionary<MacOSVersion, String> () {
{ MacOSVersion.MacOS105, "monobjc-10.5" },
{ MacOSVersion.MacOS106, "monobjc-10.6" },
{ MacOSVersion.MacOS107, "monobjc-10.7" },
{ MacOSVersion.MacOS108, "monobjc-10.8" },
{ MacOSVersion.MacOS109, "monobjc-10.9" },
{ MacOSVersion.MacOS1010, "monobjc-10.10" },
};
String result = null;
foreach(var slot in map) {
String dir = Path.Combine (basedir, slot.Value);
if (!Directory.Exists (dir)) {
continue;
}
result = dir;
if (version <= slot.Key) {
break;
}
}
if (!String.IsNullOrEmpty(result)) {
return result;
}
// TODO: I18N
throw new NotSupportedException ("Unsupported version of Mac OS X");
}