Stat.printData C# (CSharp) Method

printData() protected method

protected printData ( string statValues ) : void
statValues string
return void
    protected virtual void printData(string [] statValues)
    {
        //record all data in an ArrayList except AVG and stat
        //then gui stat and report can read this ArrayList
        //(before CreateOrUpdateAVGAndSD only read in treeview, and this doesn't work for report
        recordStatValues(statValues);

        if(toReport) {
            //LogB.Information("REPORT: {0}", statValues[0]);
            //print marked rows and AVG, SD rows
            bool allowedRow = isThisRowMarked(rowsPassedToReport);

            bool isAVGOrSD;
            string boldIni = "";
            string boldEnd = "";

            if(statValues[0] == Catalog.GetString("AVG") || statValues[0] == Catalog.GetString("SD")) {
                isAVGOrSD = true;
                boldIni = "<b>";
                boldEnd = "</b";
            }
            else
                isAVGOrSD = false;

            if(allowedRow || isAVGOrSD) {
                reportString += "<TR>";
                for (int i=0; i < statValues.Length ; i++) {
                    reportString += "<TD>" + boldIni + statValues[i] + boldEnd + "</TD>";
                }
                reportString += "</TR>\n";
            }
            rowsPassedToReport ++;
        } else {
            iter = new TreeIter();

            //iter = store.Append (iter);	//doesn't work
            //store.Append (out iter);	//add new row and make iter point to it
            iter = store.AppendNode ();

            //addAllNoneIfNeeded(statValues.Length);

            TreePath myPath = store.GetPath(iter);

            if(statValues[0] != Catalog.GetString("AVG") && statValues[0] != Catalog.GetString("SD")) {
                store.SetValue(iter, 0, true);	//first col is true if it's not AVG or SD
                markedRows.Add(myPath.ToString());
                //LogB.Information("FROM PRINTDATA Added to markedRows row:{0}", myPath.ToString());
            }

            for(int i=0; i < statValues.Length; i++) {
                store.SetValue(iter, i+1, statValues[i]);
            }
        }
    }