-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStockPriceChangeEvent.cs
More file actions
44 lines (40 loc) · 1.21 KB
/
StockPriceChangeEvent.cs
File metadata and controls
44 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace StockDataVisualizer
{
/// <summary>
/// Represents a StockPriceChange Event containing parameters that can change.
/// </summary>
public class StockPriceChangeEvent : EventArgs
{
public double BidPrice { get; set; }
public double AskPrice { get; set; }
public string Company { get; set; }
public double BidVolume { get; set; }
public double AskVolume { get; set; }
public StockPriceChangeEvent(string company,double bidPrice, double askPrice,double bidVol, double askVol)
{
Company = company;
BidPrice = bidPrice;
AskPrice = askPrice;
BidVolume = AskVolume;
AskVolume = AskVolume;
}
}
/// <summary>
/// The main class which raises events
/// </summary>
public class StockPriceTickerUpdate
{
public static EventHandler<StockPriceChangeEvent> Handler;
public void OnChangeRaiseEvent(StockPriceChangeEvent stockPriceEvt)
{
if(Handler != null)
{
Handler(this, stockPriceEvt);
}
}
}
}