public void pressAbort() { try { if (this.InvokeRequired) { SetNullCallback d = new SetNullCallback(pressAbort); this.BeginInvoke(d); return; } else { logger.Debug("Download Complete"); if (myStartDownloadButton.Text.Equals("Abort")) { myStartDownloadButton_Click(new object(), new EventArgs()); } } } catch (Exception e) { logger.Debug(e.Message); logger.Error(e.StackTrace); throw e; } }
//This function will fill the rates table and put it in a list to be accessed later internal void fillRatesGrid() { //This is to make sure the current thread is calling this function, if not call it agian if (INSTANCE.InvokeRequired) { try { SetNullCallback callback = new SetNullCallback(fillRatesGrid); Invoke(callback, new object[] { }); } catch (Exception ex) { logger.Error(ex.Message); throw ex; } } else { //Get list of symbols from the offers table O2GTableIterator iterator = new O2GTableIterator(); O2GOfferTableRow offerRow = null; if (tss != null) { Thread.Sleep(3000); O2GOffersTable offersTbl = tss.OffersTable; if (offersTbl == null) { //Log.logMessageToFile("Login", "OfferTable null"); logger.Debug("OfferTable is empty"); return; } temp = new ConcurrentDictionary <int, string>(); templist = new ConcurrentBag <int>(); while (offersTbl.getNextRow(iterator, out offerRow)) { if (offerRow.SubscriptionStatus.Equals("T")) { templist.Add(Convert.ToInt32(offerRow.OfferID)); logger.Debug("Offer {0}; Symbol {1}", offerRow.OfferID, offerRow.Instrument); temp.TryAdd(Convert.ToInt32(offerRow.OfferID), offerRow.Instrument); } } } } }