public method O2GTradeTableRow.getCell
Brief
Gets a cell of the table.
Declaration | ||||
|
Parameters | |
column |
The index of the column. The index should be between |
Returns
Returns the cell value that can be of different types. To determine a type, it is necessary to
get a column by using the O2GGenericTableResponseReader.getColumns
and the O2GTableColumnCollection.Item
methods. The index passed to the latter
method should be the same as the column parameter.
The type of value is defined by using the O2GTableColumn.ColumnType
method.
The O2GTableColumnType
enumerator returned
by the above method contains the returned value type. A client application can cast object data to the returned type or can
use a abstract object.
Column types and cast operations:
Column type |
getCell value |
The method returns a 32-bit integer value. |
|
The method returns a double value. |
|
The method returns a boolean value. |
|
The method returns a date/time value. |
|
The method returns a string data value. |
Details
The method is used to work with an abstract table. The method provides common access to a row value independently of a row type (a table type).
Print Generic Table [hide]
private void PrintGenericTableInterface(O2GGenericTableResponseReader genericReader) { O2GTableColumnCollection columns = genericReader.Columns; for (int i = 0; i < genericReader.Count; i++) { int iCount = columns.Count; O2GRow row = genericReader.getGenericRow(i); for (int j = 0; j < iCount; j++) { object value = row.getCell(j); O2GTableColumn column = columns[j]; switch (column.ColumnType) { case O2GTableColumnType.Date: DateTime date = (DateTime)value; Console.WriteLine("{0} {1}", column.ID, date.ToString("yyyy-MM-dd HH:mm")); break; case O2GTableColumnType.Boolean: bool bVal = (bool)value; Console.WriteLine("{0} {1}", column.ID, bVal.ToString()); break; case O2GTableColumnType.Integer: int iVal = (int)value; Console.WriteLine("{0} {1}", column.ID, iVal.ToString()); break; case O2GTableColumnType.Double: double dVal = (double)value; Console.WriteLine("{0} {1}", column.ID, dVal.ToString()); break; case O2GTableColumnType.String: string sVal = (string)value; Console.WriteLine("{0} {1}", column.ID, sVal.ToString()); break; } } } }
Declared in O2GRow