annotate MetroWpf/FxRates.UI/Converters/CcyToDisplayNameConverter.cs @ 44:382813d76dde Test

Removal of pdf project
author Steven Hollidge <stevenhollidge@hotmail.com>
date Wed, 04 Apr 2012 19:21:31 +0100
parents a8b50a087544
children
rev   line source
24
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
1 using System;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
2 using System.Windows.Data;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
3 using FxRates.Common;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
4
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
5 namespace FxRates.UI.Converters
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
6 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
7 public class CcyToDisplayNameConverter : IValueConverter
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
8 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
9 #region IValueConverter Members
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
10
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
11 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
12 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
13 string result;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
14 try
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
15 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
16 switch ((Ccy)value)
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
17 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
18 case Ccy.AUDtoUSD:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
19 result = "AUD to USD";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
20 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
21
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
22 case Ccy.EURtoCHF:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
23 result = "EUR to CHF";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
24 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
25
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
26 case Ccy.EURtoGBP:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
27 result = "EUR to GBP";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
28 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
29
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
30 case Ccy.EURtoJPY:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
31 result = "EUR to JPY";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
32 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
33
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
34 case Ccy.EURtoUSD:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
35 result = "EUR to USD";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
36 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
37
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
38 case Ccy.GBPtoJPY:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
39 result = "GBP to JPY";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
40 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
41
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
42 case Ccy.GBPtoUSD:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
43 result = "GBP to USD";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
44 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
45
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
46 case Ccy.USDtoCAD:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
47 result = "USD to CAD";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
48 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
49
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
50 case Ccy.USDtoCHF:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
51 result = "USD to CHF";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
52 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
53
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
54 case Ccy.USDtoJPY:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
55 result = "USD to JPY";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
56 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
57
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
58 default:
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
59 result = "Unknown";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
60 break;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
61 }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
62 }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
63 catch
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
64 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
65 result = "Unknown";
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
66 }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
67
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
68 return result;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
69 }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
70
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
71 public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
72 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
73 throw new NotImplementedException();
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
74 }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
75
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
76 #endregion
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
77 }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
78 }