diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MetroWpf/FxRates.Common/FxRate.cs	Tue Mar 20 20:18:35 2012 +0000
@@ -0,0 +1,39 @@
+using System;
+
+namespace FxRates.Common
+{
+    public class FxRate : IFxRate
+    {
+        private FxRate(Ccy ccy, decimal bid, decimal offer, DateTime timestamp)
+        {
+            Ccy = ccy;
+            Bid = bid;
+            PreviousOffer = offer;
+            Offer = offer;
+            Timestamp = timestamp;
+        }
+
+        #region IFxRate Members
+
+        public decimal Bid { get; private set; }
+        public Ccy Ccy { get; private set; }
+        public decimal Offer { get; private set; }
+        public decimal PreviousOffer { get; private set; }
+        public DateTime Timestamp { get; private set; }
+
+        #endregion
+
+        public static FxRate Create(Ccy ccy, decimal bid, decimal offer, DateTime timestamp)
+        {
+            return new FxRate(ccy, bid, offer, timestamp);
+        }
+
+        public void UpdatePrice(decimal bid, decimal offer, DateTime timestamp)
+        {
+            Bid = bid;
+            PreviousOffer = Offer;
+            Offer = offer;
+            Timestamp = timestamp;
+        }
+    }
+}
\ No newline at end of file