Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Product.cs - github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bdb8a60d276840aab391104e890e7fb018f87a08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Linq;
using System.Collections.Generic;
using Monodoc;

namespace macdoc
{
	public enum Product
	{
		MonoTouch,
		MonoMac
	}

	public static class ProductUtils
	{
		public static string GetFriendlyName (Product product)
		{
			switch (product) {
			case Product.MonoTouch:
				return "Xamarin.iOS";
			case Product.MonoMac:
				return "Xamarin.Mac";
			default:
				return string.Empty;
			}
		}

		public static IEnumerable<Product> ToProducts (this IEnumerable<HelpSource> sources)
		{
			foreach (var hs in sources) {
				if (hs.Name.StartsWith ("MonoTouch", StringComparison.InvariantCultureIgnoreCase))
					yield return Product.MonoTouch;
				else if (hs.Name.StartsWith ("MonoMac", StringComparison.InvariantCultureIgnoreCase))
					yield return Product.MonoMac;
			}
		}

		public static string GetMergeToolForProduct (Product product)
		{
			switch (product) {
			case Product.MonoTouch:
				return "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/share/doc/MonoTouch/apple-doc-wizard";
			case Product.MonoMac:
				return "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/usr/share/doc/Xamarin.Mac/apple-doc-wizard";
			default:
				return null;
			}
		}
	}
}