GenericWindow.GetCell C# (CSharp) Method

GetCell() public method

public GetCell ( int uniqueID, int column ) : int
uniqueID int
column int
return int
    public int GetCell(int uniqueID, int column)
    {
        //LogB.Information(" GetCell " + uniqueID.ToString() + " " + column.ToString());
        Gtk.TreeIter iter;
        bool okIter = store.GetIterFirst(out iter);
        if(okIter) {
            do {
                //LogB.Information("_0_ " + (string) store.GetValue (iter, 0));
                //LogB.Information("_column_ " + column.ToString() + " " + (string) store.GetValue (iter, column));
                if( ((string) store.GetValue (iter, 0)) == uniqueID.ToString()) {
                    return Convert.ToInt32( (string) store.GetValue (iter, column) );
                }
            } while ( store.IterNext(ref iter) );
        }

        return 0;
    }

Usage Example

    protected void updateEncoderCompareInterAndReps()
    {
        EncoderCompareInter = new ArrayList();

        //find RepsActive
        string [] selectedID   = genericWin.GetColumn(0, true);          //only active
        string [] selectedDate = genericWin.GetColumn(dateColumn, true); //only active
        for (int i = 0; i < selectedID.Length; i++)
        {
            int id = Convert.ToInt32(selectedID[i]);
            RepsActive += genericWin.GetCell(id, allRepsColumn);
            EncoderCompareInter.Add(id + ":" + selectedDate[i]);
        }

        //find RepsAll
        string [] allID = genericWin.GetColumn(0, false);        //unchecked (session or person don't need to be selected)
        for (int i = 0; i < allID.Length; i++)
        {
            int id = Convert.ToInt32(allID[i]);
            RepsAll += genericWin.GetCell(id, allRepsColumn);
        }
    }