コード例 #1
0
 private void OnJsonLoaded(string json)
 {
     if (!string.IsNullOrEmpty(json))
     {
         UITable.Clear();
         TeamMembersTableModel teamMembersTableModel = JsonConvert.DeserializeObject <TeamMembersTableModel>(json);
         FillTable(teamMembersTableModel);
     }
 }
コード例 #2
0
    private void FillTable(TeamMembersTableModel teamMembersTableModel)
    {
        UITable.AddTitle(teamMembersTableModel.Title);
        UITable.AddHeaders(teamMembersTableModel.ColumnHeaders);
        List <string> content = new List <string>();

        foreach (var dic in teamMembersTableModel.Data)
        {
            foreach (var column in teamMembersTableModel.ColumnHeaders)
            {
                string text = String.Empty;
                if (dic.TryGetValue(column, out object value))
                {
                    text = value.ToString();
                }
                content.Add(text);
            }
            UITable.AddContent(content.ToArray());
            content.Clear();
        }
    }