-
Notifications
You must be signed in to change notification settings - Fork 1
/
WindowsLiveLocations.cs
56 lines (52 loc) · 1.92 KB
/
WindowsLiveLocations.cs
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
51
52
53
54
55
56
using CRMPluginUtils;
using System;
namespace MicrosoftDynamicsCRMPlugin
{
public enum WindowsLiveLocations
{
NorthAmerica,
NorthAmerica2,
EMEA,
APAC,
Oceania,
Japan,
SouthAmerica,
India,
Canada
}
public class WindowsLiveLocationHelper
{
public static WindowsLiveLocations FromString(string s)
{
switch (s)
{
case "North America": return WindowsLiveLocations.NorthAmerica;
case "North America 2": return WindowsLiveLocations.NorthAmerica2;
case "EMEA": return WindowsLiveLocations.EMEA;
case "APAC": return WindowsLiveLocations.APAC;
case "Oceania": return WindowsLiveLocations.Oceania;
case "Japan": return WindowsLiveLocations.Japan;
case "South America": return WindowsLiveLocations.SouthAmerica;
case "India": return WindowsLiveLocations.India;
case "Canada": return WindowsLiveLocations.Canada;
default: throw new ArgumentException(String.Format(LocalizedResourceManager.GetString("DotNetScript", "DynamicsPlugin.Error.InvalidWindowsLiveLocation"), s));
}
}
public static string ToString(WindowsLiveLocations wll)
{
switch (wll)
{
case WindowsLiveLocations.NorthAmerica: return "North America";
case WindowsLiveLocations.NorthAmerica2: return "North America 2";
case WindowsLiveLocations.EMEA: return "EMEA";
case WindowsLiveLocations.APAC: return "APAC";
case WindowsLiveLocations.Oceania: return "Oceania";
case WindowsLiveLocations.Japan: return "Japan";
case WindowsLiveLocations.SouthAmerica: return "South America";
case WindowsLiveLocations.India: return "India";
case WindowsLiveLocations.Canada: return "Canada";
default: throw new ArgumentException(String.Format(LocalizedResourceManager.GetString("DotNetScript", "DynamicsPlugin.Error.InvalidWindowsLiveLocation"), wll));
}
}
}
}