public string toJSON(CView view, CIniFile config) { string json = "{"; int pos = 0; foreach (LangDef LangDef in config.LangEnbList) { if (pos < view.Names.Count) { json += "\"name_" + LangDef.LangAbbreviation + "\":\"" + view.Names[pos] + "\", "; } pos++; } json += "\"defLang\": \"" + view.defLang + "\", "; if (FieldList.Count != 0) { json += "\"field\":["; foreach (CField field in FieldList) { string fieldJSON = field.toJSON(field); json += fieldJSON; } json = json.Substring(0, json.Length - 1); json += "]"; } else { json = json.Substring(0, json.Length - 1); } json += "},"; return(json); }
public void AddView(CView CViewInstance) { ViewList.Add(CViewInstance); }