private void OnSend(string arg) { var candle = JsonConvert.DeserializeObject <Candle>(arg); var IsNew = (candle.time != LastCandleEvent) ? true : false; if (IsNew) { if (!candlesHistory.ContainsKey(candle.figi)) { candlesHistory.Add(candle.figi, new List <Candle>()); } candlesHistory[candle.figi].Add(candle); } else { if (!candlesHistory.ContainsKey(candle.figi)) { candlesHistory.Add(candle.figi, new List <Candle>()); } var item = candlesHistory[candle.figi]; item[item.Count - 1] = candle; } CandleEvent?.Invoke(candle, IsNew); LastCandleEvent = candle.time; }
protected override void OnItemHoverted(object userData) { base.OnItemHoverted(userData); CandleEventArgs args = userData as CandleEventArgs; if (CandleHovered != null) { CandleHovered.Invoke(args); } }
public static void OnCandleEvent(CandleEventArgs e) { CandleEvent?.Invoke(typeof(Events), e); }