annotate MetroWpf/FxRates.Common/FxRate.cs @ 106:62477c2e8837

Command tests
author stevenhollidge <stevenhollidge@hotmail.com>
date Sun, 06 May 2012 13:00:46 +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
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
3 namespace 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 public class FxRate : IFxRate
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 private FxRate(Ccy ccy, decimal bid, decimal offer, DateTime timestamp)
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 Ccy = ccy;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
10 Bid = bid;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
11 PreviousOffer = offer;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
12 Offer = offer;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
13 Timestamp = timestamp;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
14 }
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 #region IFxRate Members
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 public decimal Bid { get; private set; }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
19 public Ccy Ccy { get; private set; }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
20 public decimal Offer { get; private set; }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
21 public decimal PreviousOffer { get; private set; }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
22 public DateTime Timestamp { get; private set; }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
23
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
24 #endregion
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 public static FxRate Create(Ccy ccy, decimal bid, decimal offer, DateTime timestamp)
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
27 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
28 return new FxRate(ccy, bid, offer, timestamp);
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
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
31 public void UpdatePrice(decimal bid, decimal offer, DateTime timestamp)
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
32 {
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
33 Bid = bid;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
34 PreviousOffer = Offer;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
35 Offer = offer;
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
36 Timestamp = timestamp;
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 }
a8b50a087544 Stocks and FxRates working, new menu introduced. Working nicely so far
adminsh@apollo
parents:
diff changeset
39 }