comparison MetroWpf/FxRates.UI/Converters/CcyToDisplayNameConverter.cs @ 24:a8b50a087544

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