コード例 #1
0
        static Table cvtAssessmentToTable(Assessment a)
        {
            // init table to be returned
            Table table = new Table(new float[MAX_NUM_COLS]);

            table.SetWidth(
                //width of table is available width of page divided by cols
                // to evenly space cells
                UnitValue.CreatePercentValue(100 / MAX_NUM_COLS)
                );

            JsonDocument assessmentJson = JsonDocument.Parse(JsonSerializer.Serialize(a));

//            string[] sections = new string[];
//           JsonDocument assessmentJson = JsonDocument
//                                            .Parse(JsonSerializer.Serialize(assessment));
            // parse this json document
            // get string, get property, check type
            // group element.enumerate object
            //assessmentJson.RootElement;

            // recurisve?
            // for every table entry, loop through sections[]

            /*
             *  for () {
             *      newTableEntry(table, firstforloopkey, 10, 0);
             *      // if value of key isn't a string then enter another for loop
             *      // 2nd layer for
             *      for () {
             *          // if value of key isn't a string then enter another for loop
             *          // for(){}
             *          newTableEntryPair(table, "Self", boolToString("0"), 10, 1);
             *      }
             *
             *  }
             */



            return(table);
        }