/// <summary> /// Get the required field data from the specified row of the Position Table /// </summary> /// <param name="list">the position table UI object</param> /// <param name="rowNumber">Row number from which data needs to fished out of the Position table</param> /// <param name="header">column header of data that is expected</param> /// <returns>value in the specified field of the specified row of the Position table</returns> public static object GetData(this ListView list, int rowNumber, PositionTableColumnHeader header) { switch (header) { case PositionTableColumnHeader.Symbol: return(list.Rows[rowNumber].Cells[TestDataInfrastructure.GetTestInputData("PositionTableSymbol")].Text); case PositionTableColumnHeader.NumberOfShares: return(Convert.ToInt32(list.Rows[rowNumber].Cells[TestDataInfrastructure.GetTestInputData("PositionTableShares")].Text, CultureInfo.CurrentCulture)); default: return(null); } }
/// <summary> /// Get the required field data for the specified symbol from the Position Table /// </summary> /// <param name="list">the position table UI object</param> /// <param name="forSymbol">symbol for which data is required</param> /// <param name="header">column header of data that is expected</param> /// <returns>value in the specified field of the specified symbol row of the Position table</returns> public static object GetData(this ListView list, string forSymbol, PositionTableColumnHeader header) { switch (header) { case PositionTableColumnHeader.Symbol: return(forSymbol); case PositionTableColumnHeader.NumberOfShares: return(Convert.ToInt32(list.Rows.Find(r => r.Cells[TestDataInfrastructure.GetTestInputData("PositionTableSymbol")].Text.Equals(forSymbol)) .Cells[TestDataInfrastructure.GetTestInputData("PositionTableShares")].Text, CultureInfo.CurrentCulture)); default: return(null); } }