private string AddPanel()
{
try
{
JsonArray panels = GetPanelsArray();
int maxPanelId = 0;
foreach (JsonObject panel in panels)
{
int currentPanelId = int.Parse(panel["id"].ToString().Substring(8));
if (currentPanelId > maxPanelId)
maxPanelId = currentPanelId;
}
string panelId = "tabPanel" + (maxPanelId + 1).ToString();
panels.Add(new JsonObject(new string[] { "id", "selected" }, new string[] { panelId, "false" }));
ControlInfo.Properties.SetPropertyValue("DesignTimeTabs", JsonConvert.ExportToString(panels));
// Uncollapse the created panel
return panelId;
}
catch (Exception e)
{
return "";
}
}