private void Receive(object sender, MessageReceivedEventArgs e) { try { ExecutionTickerReply reply = JsonConvert.DeserializeObject <ExecutionTickerReply>(e.Message); if (reply != null) { EventHandler <ExecutionTickerReply> executionHandler = ExecutionUpdate; if (executionHandler != null) { executionHandler(this, reply); } EventHandler <OrderReply> quoteHandler = OrderUpdate; if (quoteHandler != null) { quoteHandler(this, reply.Order); } } } catch (SocketException ex) { //reconnect } catch (Exception ex) { Error(sender, new ErrorEventArgs(new Exception("Unsupported message received.\nex: " + ex.Message + "\nMessage: " + e.Message))); } }
private void UpdateExecution(ExecutionTickerReply reply) { EventHandler <ExecutionTickerReply> handler = ExecutionUpdated; if (handler != null) { handler(null, reply); } _dataAccess.UpdateExecution(reply); }
private void ExecutionUpdated(object sender, ExecutionTickerReply executionTickerReply) { UpdateOrder(executionTickerReply.Order); // Logic here to determine compeditors orders }
public void UpdateExecution(ExecutionTickerReply execution) { }