comparison MetroWpf/FxRates.Common/FxRate.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
3 namespace FxRates.Common
4 {
5 public class FxRate : IFxRate
6 {
7 private FxRate(Ccy ccy, decimal bid, decimal offer, DateTime timestamp)
8 {
9 Ccy = ccy;
10 Bid = bid;
11 PreviousOffer = offer;
12 Offer = offer;
13 Timestamp = timestamp;
14 }
15
16 #region IFxRate Members
17
18 public decimal Bid { get; private set; }
19 public Ccy Ccy { get; private set; }
20 public decimal Offer { get; private set; }
21 public decimal PreviousOffer { get; private set; }
22 public DateTime Timestamp { get; private set; }
23
24 #endregion
25
26 public static FxRate Create(Ccy ccy, decimal bid, decimal offer, DateTime timestamp)
27 {
28 return new FxRate(ccy, bid, offer, timestamp);
29 }
30
31 public void UpdatePrice(decimal bid, decimal offer, DateTime timestamp)
32 {
33 Bid = bid;
34 PreviousOffer = Offer;
35 Offer = offer;
36 Timestamp = timestamp;
37 }
38 }
39 }