private void PricingRequestOnPricingResponseAdded(object sender, EventArgs eventArgs) { if (PricingResponseDataGridView.InvokeRequired) { Invoke((UpdatePricingResponseGrid)PricingRequestOnPricingResponseAdded, sender, eventArgs); } else { var args = (PricingResponseEventArgs)eventArgs; var request = (PricingRequest)sender; var pricingResponse = new PricingResponse(request.RequestId, args.QuoteId, request) { Amount = args.Amount, LastSpotBid = args.LastSpotBid, LastSpotAsk = args.LastSpotAsk, NearBidPoints = args.NearBidPoints, NearAskPoints = args.NearAskPoints, NearAllInBid = args.NearAllInBid, NearAllInAsk = args.NearAllInAsk, FarBidPoints = args.FarBidPoints, FarAskPoints = args.FarAskPoints, FarAllInBid = args.FarAllInBid, FarAllInAsk = args.FarAllInAsk }; PricingResponseBindingSource.Add(pricingResponse); PricingResponseDataGridView.Refresh(); } }
public void AddPrice(PricingResponse price) { Prices.Add(price); var pricingResponseEventHandler = PricingResponseAdded; var args = new PricingResponseEventArgs { QuoteId = price.QuoteId, Amount = price.Amount, LastSpotBid = price.LastSpotBid, LastSpotAsk = price.LastSpotAsk, NearBidPoints = price.NearBidPoints, NearAskPoints = price.NearAskPoints, NearAllInBid = price.NearAllInBid, NearAllInAsk = price.NearAllInAsk, FarBidPoints = price.FarBidPoints, FarAskPoints = price.FarAskPoints, FarAllInBid = price.FarAllInBid, FarAllInAsk = price.FarAllInAsk }; if (pricingResponseEventHandler != null) { pricingResponseEventHandler(this, args); } }