public void onEachRow(string sRowID, O2GRow rowData)
        {
            if (rowData.TableType == O2GTableType.Orders ||
                rowData.TableType == O2GTableType.Trades)
            {
                string accountID = "";
                if (rowData.TableType == O2GTableType.Orders)
                {
                    accountID = ((O2GOrderTableRow)rowData).AccountID;
                }
                else
                {
                    accountID = ((O2GTradeTableRow)rowData).AccountID;
                }

                int columnsCount = rowData.Columns.Count;
                for (int i = 0; i < columnsCount; i++)
                {
                    if (string.IsNullOrEmpty(mAccountID) || mAccountID.Equals(accountID))
                    {
                        Console.Write(rowData.Columns[i].ID + "=" + rowData.getCell(i) + "; ");
                    }
                }
                Console.WriteLine("");
            }
        }
 public void onEachRow(string sRowID, O2GRow rowData)
 {
     if (rowData.TableType == O2GTableType.Orders)
     {
         int columnsCount = rowData.Columns.Count;
         for (int i = 0; i < columnsCount; i++)
         {
             if (string.IsNullOrEmpty(mAccountID) || mAccountID.Equals(((O2GOrderTableRow)rowData).AccountID))
             {
                 Console.Write(rowData.Columns[i].ID + "=" + rowData.getCell(i) + "; ");
             }
         }
         Console.WriteLine("");
     }
 }
Exemple #3
0
        public void GetTableData(O2GTable table, IO2GTableListener listener,
                                 O2GRow row, O2GTableManager mTblMgr)
        {
            try
            {
                table.subscribeUpdate(O2GTableUpdateType.Insert, listener);
                table.subscribeUpdate(O2GTableUpdateType.Update, listener);
                try
                {
                    mTblMgr.lockUpdates();
                    for (int ii = 0; ii < table.Count; ii++)
                    {
                        row = table.getGenericRow(ii);

                        foreach (O2GTableColumn CurrentColumn in table.Columns)
                        {
                            for (int jj = 0; jj < row.Columns.Count; jj++)
                            {
                                if (CurrentColumn.ID == row.Columns[jj].ID)
                                {
                                    dataGridView.Rows[ii].Cells[CurrentColumn.ID].Value = row.getCell(jj);
                                }
                            }
                        }
                    }
                }
                finally
                {
                    mTblMgr.unlockUpdates();
                }

                table.unsubscribeUpdate(O2GTableUpdateType.Insert, listener);
                table.unsubscribeUpdate(O2GTableUpdateType.Update, listener);
            }
            catch (Exception e)
            {
                LogDirector.DoAction(4, e);
            }
        }